0

I have to compile python code into an executable file. To do that on my RPi3 b+ running Debian stretch. I use cython to convert .py into .c code and then using gcc to create an executable file. The compiling process is very slow but it works.
I would like to cross-compile from another machine. I have an Ubuntu Virtual machine and I followed this tutorial:

Come fare Cross Compile per Raspberry Pi con Ubuntu X86

The compiling process success when compiling pure .c code (such the classical hello world), however, it fails when to have to include python libraries. When I execute arm-linux-gnueabi-gcc -o test test.c it fails and reports Python.h not found.
Including the python path (which was already installed such as python-dev and python3-dev) with:

$ arm-linux-gnueabi-gcc -I/usr/include/python3.5 -o test test.c it fails 

and reports:

pyconfig.h: No such file or directory error

Could someone help me? I accept also additional solutions of cross-compiling such as how to directly cross-compile python code to executable without converting it into .c code.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.