NSLU2-Linux
view · edit · print · history

Optware.Distcc History

Hide minor edits - Show changes to markup

May 15, 2007, at 09:35 PM by BrianZhou -- renamed openslug to slugosbe
Changed lines 42-43 from:

On my PC, with openslug toolchain built, I did the following:

to:

On my PC, with slugosbe toolchain built (see SlugosbeDevel), I did the following:

Changed lines 55-56 from:

On my openslug, I can then do

to:

On my slugosbe slug, I can then do

March 30, 2007, at 05:47 AM by BrianZhou -- openslug -> slugosbe
Changed line 45 from:

$ cd ~/slug/openslug/tmp/cross/armeb-linux/bin && ln -s gcc cc

to:

$ cd ~/slug/slugosbe/tmp/cross/armeb-linux/bin && ln -s gcc cc

Changed line 49 from:

PATH=~/slug/openslug/tmp/cross/armeb-linux/bin:$PATH \

to:

PATH=~/slug/slugosbe/tmp/cross/armeb-linux/bin:$PATH \

March 30, 2007, at 05:43 AM by BrianZhou -- small correction
Changed line 34 from:

$ ./distccd

to:

$ ./distccd.sh

Changed line 52 from:

$ ./distccd

to:

$ ./distccd.sh

January 16, 2007, at 04:24 PM by BrianZhou --
Changed lines 49-51 from:

SLUG_TOP=$HOME/slug PATH=$SLUG_TOP/openslug/tmp/cross/armeb-linux/bin:$PATH distccd --daemon -p 3633 --allow 192.168.1.0/24 --log-file=$SLUG_TOP/optware/slugosbe/distcc/distccd.log$ chmod +x distccd.sh

to:

PATH=~/slug/openslug/tmp/cross/armeb-linux/bin:$PATH distccd --daemon -p 3633 --allow 192.168.1.0/24 --log-file=~/slug/optware/slugosbe/distcc/distccd.log $ chmod +x distccd.sh

January 16, 2007, at 06:23 AM by BrianZhou -- added distcc usage for optware/slugosbe
Changed lines 39-57 from:

$ DISTCC_HOSTS=pc-ip-address make HOSTCC=distcc TARGET_CC=distcc TARGET_CXX='"distcc g++"' target

to:

$ DISTCC_HOSTS=pc-ip-address make HOSTCC=distcc TARGET_CC=distcc TARGET_CXX='"distcc g++"' target


On my PC, with openslug toolchain built, I did the following:

$ cd ~/slug/openslug/tmp/cross/armeb-linux/bin && ln -s gcc cc
$ cd ~/slug/optware/slugosbe
$ mkdir -p distcc && cd distcc
$ vi distccd.sh
SLUG_TOP=$HOME/slug
PATH=$SLUG_TOP/openslug/tmp/cross/armeb-linux/bin:$PATH \
    distccd --daemon -p 3633 --allow 192.168.1.0/24 --log-file=$SLUG_TOP/optware/slugosbe/distcc/distccd.log$ chmod +x distccd.sh
$ ./distccd

On my openslug, I can then do

$ DISTCC_HOSTS=pc-ip-address:3633 make HOSTCC=distcc TARGET_CC=distcc TARGET_CXX='"distcc g++"' target

January 16, 2007, at 05:57 AM by BrianZhou -- added HOSTCC and TARGET_CXX options
Changed line 39 from:

$ DISTCC_HOSTS=pc-ip-address make TARGET_CC=distcc TARGET_CXX=distcc target

to:

$ DISTCC_HOSTS=pc-ip-address make HOSTCC=distcc TARGET_CC=distcc TARGET_CXX='"distcc g++"' target

September 18, 2006, at 05:00 PM by BrianZhou -- added TARGET_CXX
Changed lines 25-26 from:

$ cd $HOME/slug/optware/nslu2/toolchain/armv5b-softfloat-linux/gcc-3.3.5-glibc-2.2.5/armv5b-softfloat-linux/bin

to:

$ cd ~/slug/optware/nslu2/toolchain/armv5b-softfloat-linux/gcc-3.3.5-glibc-2.2.5/armv5b-softfloat-linux/bin $ ln -s gcc cc

Changed line 39 from:

$ DISTCC_HOSTS=pc-ip-address make TARGET_CC=distcc target

to:

$ DISTCC_HOSTS=pc-ip-address make TARGET_CC=distcc TARGET_CXX=distcc target

September 02, 2006, at 04:36 AM by bzhou --
Added line 21:

August 31, 2006, at 05:25 AM by bzhou --
Changed line 37 from:

@@$ DISTCC_HOSTS=pc-ip-address make TARGET_CC=distcc target

to:

$ DISTCC_HOSTS=pc-ip-address make TARGET_CC=distcc target

August 31, 2006, at 05:24 AM by bzhou -- added my example
Changed lines 19-37 from:

That should be it! As always, correct with wiki if you find any tricks or pitfalls to this process.

to:

That should be it! As always, correct with wiki if you find any tricks or pitfalls to this process.

On my PC, with optware/nslu2/toolchain built, I did the following:

$ cd $HOME/slug/optware/nslu2/toolchain/armv5b-softfloat-linux/gcc-3.3.5-glibc-2.2.5/armv5b-softfloat-linux/bin
$ cd ~/slug/optware/nslu2
$ mkdir distcc && cd distcc
$ vi distccd.sh
NSLU2_HOME=$HOME/slug/optware/nslu2
PATH=$NSLU2_HOME/toolchain/armv5b-softfloat-linux/gcc-3.3.5-glibc-2.2.5/armv5b-softfloat-linux/bin:$PATH \
    distccd --daemon --allow 192.168.1.0/24 --log-file=$NSLU2_HOME/distcc/distccd.log
$ chmod +x distccd.sh
$ ./distccd

On my slug, I can then do

@@$ DISTCC_HOSTS=pc-ip-address make TARGET_CC=distcc target

December 16, 2004, at 04:17 PM by jeremyeglen --
Changed lines 1-19 from:

Describe {{Distcc}} here.

to:

From the homepage at http://distcc.samba.org/, "distcc is a program to distribute builds of C, C++, Objective C or Objective C++ code across several machines on a network. distcc should always generate the same results as a local build, is simple to install and use, and is usually much faster than a local compile."

In theory, distcc should allow you to speed up native builds on the slug dramatically by using other machines on your network. In practice, its use is a bit finicky unless it's set up just right.

  1. CompileCrossTool on all machines you intend to distribute builds to using distcc (I'll call these the servers)
  2. Ensure the cross compiler is in your path on the servers
  3. Download and install distcc (http://distcc.samba.org/binaries.html) on the servers
  4. Build the NativeNSLU2Toolchain on the slug -- this will take a while
  5. Download the make, m4, patch, and distcc ipks (ipkg install make;ipkg install m4;ipkg install patch;ipkg install distcc) to the slug
  6. On the slug, make sure you've got a symlink from gcc to cc in your path (e.g. ln -s /opt/usr/bin/gcc /opt/usr/bin/cc)
  7. Start distcc on each of the servers and the slug (distccd --daemon --allow 192.168.1.0/24 will restrict compilation to the 192.168.1 network)
  8. On the servers and the slug, export DISTCC_HOSTS='localhost red green blue' where red, green, and blue are the names of the servers. The order in which you place the host names is the order in which distcc will attempt to distribute the load. I would recommend putting the fastest machine first in the list.

In order to make using distcc, you need to feed the -j <#> and CC=distcc options to make. The -j switch takes the number of processes to spawn. If you have four machines as in the above example, -j 4 should work just fine. For example, if you've got a Makefile in /src, you can

  • cd /src
  • make -j 4 CC=distcc

That should be it! As always, correct with wiki if you find any tricks or pitfalls to this process.

view · edit · print · history · Last edited by BrianZhou.
Based on work by BrianZhou and bzhou.
Originally by jeremyeglen.
Page last modified on May 15, 2007, at 09:35 PM