I am compiling a pyo3 example code using cargo build. I see this error at the end
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Other codes compile fine. I see this error only when I use pyo3.
I am using MacBook with M1 chip. I have Xcode installed. Rust toolchain stable-aarch64-apple-darwin (default) Python 3.82 (arm64)
This is how I am seeing my dependencies for pyo3
[dependencies.pyo3]
version = "0.14.5"
features = ["extension-module"]
What worked for me
- changing python to x86_64 and rust toolchain to x86_64. This works.
Does anyone else have issues compiling rust with arm Mac?
This is the example code that I am trying https://github.com/bedroombuilds/python2rust/tree/main/15_pymod_in_rust/rust/pyo3_monte_carlo_pi