I do a lot of compiling at work on a Raspberry Pi. I'm looking into speeding this up with the use of distcc.
I followed this article: https://www.kvaser.com/developer-blog/building-raspberry-pi-using-distcc/
This allowed me to configure an Arch Linux VM as a cross-compiler Host, and my Raspberry Pi as the client.
The setup appears to work, as far as networking. I can use tcpdump on Arch to confirm that when running make on the Pi, the server's distcc port (3632) gets a ton of requests.
The setup appears to also work in terms of using the crosscompiler. My Arch Linux doesn't have native c++, cc, cpp, g++, or gcc binaries installed. Without setting PATH to point to the cross compiler, the Pi complains that it can't find the gcc binary, as expected.
The problem I'm seeing is that when I try to compile Python 3.7.11, I get this almost immediately after running make:
gcc -pthread -c -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Wno-cast-function-type -Werror=implicit-function-declaration -I. -I./Include -DPy_BUILD_CORE -o Parser/tokenizer.o Parser/tokenizer.c
distcc[31743] ERROR: compile Parser/tokenizer.c on 192.168.1.23 failed
In file included from ./Include/Python.h:34:0,
from Parser/tokenizer.c:4:
/usr/include/stdlib.h:140:8: error: unknown type name '_Float32'
/usr/include/stdlib.h:146:8: error: unknown type name '_Float64'
In file included from ./Include/Python.h:34:0,
from Parser/tokenizer.c:4:
/usr/include/stdlib.h:158:8: error: unknown type name '_Float32x'
In file included from ./Include/Python.h:34:0,
from Parser/tokenizer.c:4:
/usr/include/stdlib.h:233:10: error: unknown type name '_Float32'
/usr/include/stdlib.h:239:10: error: unknown type name '_Float64'
In file included from ./Include/Python.h:34:0,
from Parser/tokenizer.c:4:
/usr/include/stdlib.h:251:4: error: unknown type name '_Float32x'
In file included from ./Include/Python.h:34:0,
from Parser/tokenizer.c:4:
/usr/include/stdlib.h:316:8: error: unknown type name '_Float32'
/usr/include/stdlib.h:323:8: error: unknown type name '_Float64'
In file included from ./Include/Python.h:34:0,
from Parser/tokenizer.c:4:
/usr/include/stdlib.h:337:8: error: unknown type name '_Float32x'
In file included from /usr/include/math.h:389:0,
from ./Include/pyport.h:191,
from ./Include/Python.h:63,
from Parser/tokenizer.c:4:
/usr/include/arm-linux-gnueabihf/bits/mathcalls.h:53:8: error: unknown type name '_Float32'
/usr/include/arm-linux-gnueabihf/bits/mathcalls.h:53:26: error: unknown type name '_Float32'
/usr/include/arm-linux-gnueabihf/bits/mathcalls.h:53:89: error: unknown type name '_Float32'
...
Truncated to adhere to stackoverflow's 30,000 character post limit
...
/usr/include/arm-linux-gnueabihf/bits/mathcalls.h:388:31: error: unknown type name '_Float32x'
/usr/include/arm-linux-gnueabihf/bits/mathcalls.h:388:47: error: unknown type name '_Float32x'
In file included from /usr/include/math.h:616:0,
from ./Include/pyport.h:191,
from ./Include/Python.h:63,
from Parser/tokenizer.c:4:
/usr/include/arm-linux-gnueabihf/bits/mathcalls-narrow.h:24:8: error: unknown type name '_Float32'
/usr/include/arm-linux-gnueabihf/bits/mathcalls-narrow.h:24:29: error: unknown type name '_Float32x'
/usr/include/arm-linux-gnueabihf/bits/mathcalls-narrow.h:24:44: error: unknown type name '_Float32x'
/usr/include/arm-linux-gnueabihf/bits/mathcalls-narrow.h:27:8: error: unknown type name '_Float32'
/usr/include/arm-linux-gnueabihf/bits/mathcalls-narrow.h:27:29: error: unknown type name '_Float32x'
/usr/include/arm-linux-gnueabihf/bits/mathcalls-narrow.h:27:44: error: unknown type name '_Float32x'
/usr/include/arm-linux-gnueabihf/bits/mathcalls-narrow.h:30:8: error: unknown type name '_Float32'
/usr/include/arm-linux-gnueabihf/bits/mathcalls-narrow.h:30:29: error: unknown type name '_Float32x'
/usr/include/arm-linux-gnueabihf/bits/mathcalls-narrow.h:30:44: error: unknown type name '_Float32x'
/usr/include/arm-linux-gnueabihf/bits/mathcalls-narrow.h:33:8: error: unknown type name '_Float32'
/usr/include/arm-linux-gnueabihf/bits/mathcalls-narrow.h:33:29: error: unknown type name '_Float32x'
/usr/include/arm-linux-gnueabihf/bits/mathcalls-narrow.h:33:44: error: unknown type name '_Float32x'
In file included from /usr/include/math.h:626:0,
from ./Include/pyport.h:191,
from ./Include/Python.h:63,
from Parser/tokenizer.c:4:
/usr/include/arm-linux-gnueabihf/bits/mathcalls-narrow.h:24:8: error: unknown type name '_Float32'
/usr/include/arm-linux-gnueabihf/bits/mathcalls-narrow.h:24:28: error: unknown type name '_Float64'
/usr/include/arm-linux-gnueabihf/bits/mathcalls-narrow.h:24:42: error: unknown type name '_Float64'
/usr/include/arm-linux-gnueabihf/bits/mathcalls-narrow.h:27:8: error: unknown type name '_Float32'
/usr/include/arm-linux-gnueabihf/bits/mathcalls-narrow.h:27:28: error: unknown type name '_Float64'
/usr/include/arm-linux-gnueabihf/bits/mathcalls-narrow.h:27:42: error: unknown type name '_Float64'
/usr/include/arm-linux-gnueabihf/bits/mathcalls-narrow.h:30:8: error: unknown type name '_Float32'
/usr/include/arm-linux-gnueabihf/bits/mathcalls-narrow.h:30:28: error: unknown type name '_Float64'
/usr/include/arm-linux-gnueabihf/bits/mathcalls-narrow.h:30:42: error: unknown type name '_Float64'
/usr/include/arm-linux-gnueabihf/bits/mathcalls-narrow.h:33:8: error: unknown type name '_Float32'
/usr/include/arm-linux-gnueabihf/bits/mathcalls-narrow.h:33:28: error: unknown type name '_Float64'
/usr/include/arm-linux-gnueabihf/bits/mathcalls-narrow.h:33:42: error: unknown type name '_Float64'
In file included from /usr/include/math.h:666:0,
from ./Include/pyport.h:191,
from ./Include/Python.h:63,
from Parser/tokenizer.c:4:
/usr/include/arm-linux-gnueabihf/bits/mathcalls-narrow.h:24:8: error: unknown type name '_Float32x'
/usr/include/arm-linux-gnueabihf/bits/mathcalls-narrow.h:24:30: error: unknown type name '_Float64'
/usr/include/arm-linux-gnueabihf/bits/mathcalls-narrow.h:24:44: error: unknown type name '_Float64'
/usr/include/arm-linux-gnueabihf/bits/mathcalls-narrow.h:27:8: error: unknown type name '_Float32x'
/usr/include/arm-linux-gnueabihf/bits/mathcalls-narrow.h:27:30: error: unknown type name '_Float64'
/usr/include/arm-linux-gnueabihf/bits/mathcalls-narrow.h:27:44: error: unknown type name '_Float64'
/usr/include/arm-linux-gnueabihf/bits/mathcalls-narrow.h:30:8: error: unknown type name '_Float32x'
/usr/include/arm-linux-gnueabihf/bits/mathcalls-narrow.h:30:30: error: unknown type name '_Float64'
/usr/include/arm-linux-gnueabihf/bits/mathcalls-narrow.h:30:44: error: unknown type name '_Float64'
/usr/include/arm-linux-gnueabihf/bits/mathcalls-narrow.h:33:8: error: unknown type name '_Float32x'
/usr/include/arm-linux-gnueabihf/bits/mathcalls-narrow.h:33:30: error: unknown type name '_Float64'
/usr/include/arm-linux-gnueabihf/bits/mathcalls-narrow.h:33:44: error: unknown type name '_Float64'
In file included from ./Include/unicodeobject.h:107:0,
from ./Include/Python.h:99,
from Parser/tokenizer.c:4:
/usr/include/wchar.h:396:8: error: unknown type name '_Float32'
/usr/include/wchar.h:401:8: error: unknown type name '_Float64'
In file included from ./Include/unicodeobject.h:107:0,
from ./Include/Python.h:99,
from Parser/tokenizer.c:4:
/usr/include/wchar.h:411:8: error: unknown type name '_Float32x'
In file included from ./Include/unicodeobject.h:107:0,
from ./Include/Python.h:99,
from Parser/tokenizer.c:4:
/usr/include/wchar.h:511:8: error: unknown type name '_Float32'
/usr/include/wchar.h:517:8: error: unknown type name '_Float64'
In file included from ./Include/unicodeobject.h:107:0,
from ./Include/Python.h:99,
from Parser/tokenizer.c:4:
/usr/include/wchar.h:529:8: error: unknown type name '_Float32x'
cc1: warning: unrecognized command line option "-Wno-cast-function-type"
make: *** [Makefile:1652: Parser/tokenizer.o] Error 1
Without distcc, Python compiles fine on the Pi - it just takes forever.
Is the Host (Arch Linux) missing some libraries that are required for compiling Python? I was under the impression it didn't need any.
Is the problem perhaps the fact that my Raspberry Pi is using kernel 5.4.51-v7+, while the toolchain at https://github.com/raspberrypi/tools.git appears to only have support for arm-rpi-4.9.3-linux-gnueabihf?
I'm pretty lost here. Any help would be appreciated.
Update: It seems like distcc is working, but the compile is failing. Maybe this explains it:
In Debian Buster the gcc compiler and glibc was updated to version 8.3. The toolchain in git://github.com/raspberrypi/tools.git is still based on the older gcc 6 version. This means that using git://github.com/raspberrypi/tools.git will lead to many compile errors.
Will need to look into this further.