Distcc is a program designed to distribute compiling tasks across a network to
participating hosts. It is comprised of a server,
If you are planning on using distcc to help you bootstrap a Gentoo installation,
make sure you read the part on
To start off with, to use Distcc all of the computers on your network need to have the same GCC versions. Mixing 3.3.x (where the x varies) is okay, but mixing 3.3.x and 3.2.x is not: your programs will have errors in it.
There are a couple of options you should know about before you start installing distcc.
Distcc ships with a graphical monitor to monitor tasks that your computer is sending away for compilation. If you use Gnome then put 'gnome' in your USE flags. However, if you don't use Gnome and would still like to have the monitor then you should put 'gtk' in your USE flags.
# emerge distcc
Setting up distcc is easy to do with Portage. Execute the following steps on each system that should participate in the distributed compiling:
# emerge distcc # nano -w /etc/make.conf(Set N to a suitable number for your particular setup) (A common heuristic strategy is twice the number of total CPUs + 1) MAKEOPTS="-jN"(Add distcc to your FEATURES variable) FEATURES="distcc"
Next you have to specify what hosts you want to use. Use the
192.168.0.1 192.168.0.2 192.168.0.3 192.168.0.1/2 192.168.0.2 192.168.0.3/10 192.168.0.1:4000/2 192.168.0.2/1 192.168.0.3:3632/4 @192.168.0.1 @192.168.0.2:/usr/bin/distccd 192.168.0.3(There are also several other methods of setting up hosts. See the distcc manpage for more details.)
It may all look complicated, but in most cases a variant of line 1 or 2 will work.
Since most people won't be using lines 3 or 4, I'll
For instance, to set the first line in the previous example:
# /usr/bin/distcc-config --set-hosts "192.168.0.1 192.168.0.2 192.168.0.3"
Edit
Now start the distcc daemon on all the participating computers:
(Add distccd to the default runlevel) # rc-update add distccd default(Start the distcc daemon) # /etc/init.d/distccd start
This is in some cases easier than the Portage setup. What you have to do is
update your
# export PATH="/usr/lib/ccache/bin:/usr/lib/distcc/bin:${PATH}"
Then, as you would normally type
Cross-compiling is using one architecture to build programs for another architecture. This can be as simple as using an Athlon (i686) to build a program for a K6-2 (i586), or using a Sparc to build a program for a ppc.
If you want to give Cross-compiling a try you can to follow
Boot your new box with a Gentoo Linux LiveCD and follow the
# nano -w /etc/make.conf(Add distcc to the FEATURES variable) FEATURES="distcc"(Modify MAKEOPTS to include -jN with N an appropriate integer) MAKEOPTS="-jN"
# export PATH="/usr/lib/ccache/bin:/usr/lib/distcc/bin:${PATH}"
Before the installation of distcc, a user called distcc must be added to the
# echo "distcc:x:240:2:distccd:/dev/null:/bin/false" >> /etc/passwd
Install distcc:
# USE='-*' emerge --nodeps sys-devel/distcc
Run
(Substitute host1, host2, ... with the IP number(s) of the participating hosts) # /usr/bin/distcc-config --set-hosts "localhost host1 host2 host3 ..."An example: /usr/bin/distcc-config --set-hosts "localhost 192.168.0.4 192.168.0.6"
distcc is now set up to bootstrap! Continue the official installation
instructions and
As you emerge various packages, you'll notice that some of them aren't being distributed (and aren't being built in parallel). This is because the developers of the Mozilla and Xfree ebuilds intentionally disable parallel building because it is known to cause problems.
Sometimes distcc might cause a package to fail to compile. If this happens
for you, please
With such a long title any explanation here is almost irrelevent. However, if
you plan to use distcc across hosts that have the
The solution requires a little foresight on your part; you have to run
If you have different GCC versions on your hosts, there will likely be very weird problems. The solution is to make certain all hosts have the same GCC version.
Recent Portage updates have made Portage use
Distcc ships with two monitors. The text-based one is always built and is
called
The other monitor is only turned on if you enabled
# distccmon-text N(Or) # distccmon-gnomeTo monitor Portage's distcc usage you can use: # DISTCC_DIR=`portageq envvar DISTCC_DIR` distccmon-text N(Or) # DISTCC_DIR=`portageq envvar DISTCC_DIR` distccmon-gnome