Replies: 2 comments
-
Hi again, I was able to find what I did wrong and what I was missing: I added the Now the code successfully compiles and I was able to test it in my armv7 board ;) The only question that remains for me is: Why is it required to set the |
Beta Was this translation helpful? Give feedback.
-
Hi, sorry it's taken me a couple of days to reply. I'd love for us to cover more documentation around this topic (see #2017). As for |
Beta Was this translation helpful? Give feedback.
-
Bug Description
Hi,
I am trying to cross compile a Rust app that does a simple Hello python print call. This, however, seems to be not that easy.
Using Docker, I cross compiled python3.9 to arm and then I use this interpreter, together with cargo to build the application to the desired target, but it does not work. Here is the output:
error: failed to run custom build command for `pyo3 v0.15.1` Caused by: process didn't exit successfully: `/target/debug/build/pyo3-05cbb6ee27470b67/build-script-build` (exit status: 1) --- stdout cargo:rerun-if-env-changed=PYO3_CROSS cargo:rerun-if-env-changed=PYO3_CROSS_LIB_DIR cargo:rerun-if-env-changed=PYO3_CROSS_PYTHON_VERSION cargo:rerun-if-env-changed=_PYTHON_SYSCONFIGDATA_NAME cargo:rerun-if-env-changed=PYO3_PYTHON cargo:rerun-if-env-changed=PYO3_PRINT_CONFIG --- stderr error: The `auto-initialize` feature is enabled, but your python installation only supports embedding the Python interpreter statically. If you are attempting to run tests, or a binary which is okay to link dynamically, install a Python distribution which ships with the Python shared library. Embedding the Python interpreter statically does not yet have first-class support in PyO3. If you are sure you intend to do this, disable the `auto-initialize` feature. For more information, see https://pyo3.rs/v0.15.1/building_and_distribution.html#embedding-python-in-rust warning: build failed, waiting for other jobs to finish... error: build failed make: *** [build] Error 101
I used the
PYO3_CROSS_LIB_DIR
to link it to the dir where libpython is present.For convenience, you can check the following repo, which includes my application:
https://github.com/tropxy/py2rust
Steps to Reproduce
make setup
)make build
)Backtrace
No response
Your operating system and version
Darwin Kernel Version 20.6.0 x86_64
Your Python version (
python --version
)python 3.9.9
Your Rust version (
rustc --version
)rustc 1.58.1 (db9d1b20b 2022-01-20)
Your PyO3 version
0.15.1
How did you install python? Did you use a virtualenv?
I have used Docker
Additional Info
No response
Beta Was this translation helpful? Give feedback.
All reactions