Easy cross-compiling
#1
Smile 
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:

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!


Messages In This Thread
Easy cross-compiling - by elijahr - 09-23-2020, 09:16 PM
RE: Easy cross-compiling - by e-minguez - 09-25-2020, 10:25 AM
RE: Easy cross-compiling - by Paulie420 - 09-25-2020, 11:03 AM
RE: Easy cross-compiling - by elijahr - 09-25-2020, 11:52 AM
RE: Easy cross-compiling - by Paulie420 - 09-25-2020, 12:27 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  compiling (large) programs on pbp pine76 8 7,317 09-25-2020, 10:24 AM
Last Post: e-minguez
  Make it easy? wdt 0 1,693 09-10-2020, 10:05 PM
Last Post: wdt
  Frequent segfaults etc. while compiling mfritsche 13 14,779 07-15-2020, 04:12 PM
Last Post: mfritsche
  Hate Manjaro - Easy Ubuntu Install? PaulMcGuinness 8 9,538 06-07-2020, 04:40 AM
Last Post: flyingscorpio
  Compiling WireGuard (and other things requiring linux-headers) on Debian+Mate Dendrocalamus64 1 3,579 04-02-2020, 07:07 PM
Last Post: Dendrocalamus64

Forum Jump:


Users browsing this thread: 1 Guest(s)