I am trying to cross-compile Python 3.6 for my Raspberry Pi based on the instructions on this post, which boil down to setup then env vars so we use the linaro toolchain:
export CC=arm-bcm2708hardfp-linux-gnueabi-gcc export LD=arm-bcm2708hardfp-linux-gnueabi-ld export CXX=arm-bcm2708hardfp-linux-gnueabi-g++ export CPP="arm-bcm2708hardfp-linux-gnueabi-g++ -E" export READELF=arm-bcm2708hardfp-linux-gnueabi-readelf export RANLIB=arm-bcm2708hardfp-linux-gnueabi-ranlib export AR=arm-bcm2708hardfp-linux-gnueabi-ar
echo ac_cv_file__dev_ptmx=no > ./config.site
echo ac_cv_file__dev_ptc=no >> ./config.site
CONFIG_SITE=config.site ./configure --prefix=/home/user/Downloads/Python-3.6.1 --enable-ipv6 --build=arm-unknown-linux-gnueabihf --host=arm-unknown-linux-gnueabihf
make -j4
make install
However, I am stuck at the configure
command which exits with an error that says:
checking whether we are cross compiling... configure: error: in `/home/user/Downloads/Python-3.6.1':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details
What am I doing wrong? My host machine is Fedora 25 x86_64 and my Raspberry PI is a model 3 B.
python36
package already available in Fedora 24 and newer?sudo dnf install python36