09-23-2020, 09:16 PM
(This post was last modified: 09-23-2020, 09:25 PM by elijahr.
Edit Reason: Formatting
)
Hey all, I created some Docker images to make cross-compiling for Linux arm64 easy. I've successfully used my Macbook Pro to compile software for my Pinebook Pro, and it was quite a bit faster than compiling on the PBP itself. Thought others might find the project useful, but I'm also looking for testers.
The following instructions assume you have a PBP and a non-PBP running on the same LAN, and that the non-PBP has docker installed.
If compiling for Manjaro, run this on your non-PBP:
If compiling for Debian, run this on your non-PBP:
On your PBP, install distcc via pacman or apt and update your PATH so that the distcc wrappers for gcc, g++, etc are found first.
Run this on your Manjaro PBP (assuming you use bash):
Or run this on your Debian PBP:
Confirm that the executable found by running which gcc on your PBP is in /usr/lib/distcc:
Now any C / C++ compilation on the PBP will be transparently offloaded to the non-PBP. You can verify this by observing the distccd output on the non-PBP.
If the non-PBP can't be reached (for instance, if you are away from your LAN, or the docker isn't running), compilation will be performed locally.
Please let me know if you run into any issues.
Source code and documentation for the docker images: https://github.com/elijahr/distcc-cross-compiler
Cheers!
The following instructions assume you have a PBP and a non-PBP running on the same LAN, and that the non-PBP has docker installed.
If compiling for Manjaro, run this on your non-PBP:
Code:
docker run -p 3708:3708 elijahru/distcc-cross-compiler-host-archlinux:latest-amd64
If compiling for Debian, run this on your non-PBP:
Code:
docker run -p 3608:3608 elijahru/distcc-cross-compiler-host-debian-buster:latest-amd64
On your PBP, install distcc via pacman or apt and update your PATH so that the distcc wrappers for gcc, g++, etc are found first.
Run this on your Manjaro PBP (assuming you use bash):
Code:
sudo pacman -S distcc
echo 'export PATH=/usr/lib/distcc/bin:$PATH' >> ~/.bash_profile
# Replace X.Y.Z with the LAN IP address or hostname of your non-PBP
echo 'export DISTCC_HOSTS=X.Y.Z:3708' >> ~/.bash_profile
source ~/.bash_profile
Or run this on your Debian PBP:
Code:
sudo apt-get install distcc
echo 'export PATH=/usr/lib/distcc:$PATH' >> ~/.bash_profile
# Replace X.Y.Z with the LAN IP address or hostname of your non-PBP
echo 'export DISTCC_HOSTS=X.Y.Z:3608' >> ~/.bash_profile
source ~/.bash_profile
Confirm that the executable found by running which gcc on your PBP is in /usr/lib/distcc:
Now any C / C++ compilation on the PBP will be transparently offloaded to the non-PBP. You can verify this by observing the distccd output on the non-PBP.
If the non-PBP can't be reached (for instance, if you are away from your LAN, or the docker isn't running), compilation will be performed locally.
Please let me know if you run into any issues.
Source code and documentation for the docker images: https://github.com/elijahr/distcc-cross-compiler
Cheers!