How can I use python distutils to cross compile an extension module to a different architecture?
问题 I'm using Cython to generate compiled .so files for a couple of python modules I have. As outlined in the Cython documentation, you can create a setup.py file as follows: from distutils.core import setup from Cython.Build import cythonize setup( ext_modules = cythonize([ 'MyModule1.py', 'MyModule2.py', 'MyModule3.py' ]) ) and then build the modules using the command python3 setup.py build_ext --inplace . This works fine, however it creates binaries that match the architecture of the host