Undefined symbols for architecture x86_64:
"_PyBaseObject_Type", referenced from:
...
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: could not compile `peano` (lib) due to 1 previous error
Ah, I had been adding rustflags to Cargo.toml of the project by mistake. Adding this to ~/.cargo/config.toml (which had to be created) fixed it - at least on M1 / arm64.
Bug Description
Trying to run
cargo build
in this project.First I thought it was an Apple silicon issue, but it also fails on intel Mac.
Steps to Reproduce
My Python and Rust are installed via asdf
I try to build the rust library in this project.
I have tried all the tricks I could find:
Added this in
Cargo.toml
:Added this in build.rs:
Backtrace
No response
Your operating system and version
Sonoma 14.5
Your Python version (
python --version
)3.11.6
Your Rust version (
rustc --version
)rustc 1.79.0 (129f3b996 2024-06-10)
Your PyO3 version
0.18.2
How did you install python? Did you use a virtualenv?
asdf Not using virtualenv.
Additional Info
Changing Pyo3 version to 0.20.2 in Cargo.toml did not help.