From bc770b9f37fdb99e62e88aaf9ffff66ef6e5c13a Mon Sep 17 00:00:00 2001 From: Matt Pelland Date: Wed, 23 Jan 2019 23:10:37 -0500 Subject: [PATCH] add documentation on cross compiling --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index 70a61c63..ee7cb8fa 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,18 @@ E.g. if you are on Ubuntu18.04, please run sudo apt install python3-dev python-dev ``` +### Cross Compiling + +Cross compiling Pyo3 modules requires setting the following environment +variables: + +- `PYO3_XC`: This variable must be set to indicate a cross compilation + environment. The value does not matter. +- `PYO3_XC_PYTHON_INCLUDE_DIR`: This variable must be set to the directory + containing the headers for the target's python interpreter. +- `PYO3_XC_PYTHON_LIB_DIR`: This variable must be set to the directory + containing the target's libpython DSO. + ## Using rust from python Pyo3 can be used to generate a native python module.