How to cross compile cython code correctly by setup.py? #3581
atptour2017
started this conversation in
General
Replies: 1 comment
-
Hello, I would like to inquire why I specified CC. During the compilation phase, it is indeed possible to cross compile and jump to the native gcc with just one link? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have done lots of cross compile works for my arm platform. Usually the codes are open source code in github such as apache beam. There are many cython code in it. I assign $CC to be my arm compiler and then I perform python setup.py build to cross compile it. Usually it's successful. Then its c lib was built out such as stream.cpython-38-x86_64-linux-gnu.so.
But the problem is that it's name was always wrong. The file name always has "x86_64" in it. When I transfer this lib to run in arm server, its name must be changed to "aarch64" inside.
I think this is the problem of setuptools. When I run setup.py, it generate the folder name with "x86_64" automatically. The setuptools did not know I were doing cross compile. It always take the building host's arch to the folder name. For example, build/lib.linux-x86_64-cpython-38 is the folder generated in apache-beam-2.27.0 source code. How can I assign the CPU/arch type name for the build folder and cython? Are there any parameter to set that for setuptools?
Beta Was this translation helpful? Give feedback.
All reactions