Speed up the kernel compilation process using distCC

What is distcc?

Distcc is a program designed to distribute compiling tasks across a network to participating hosts. It is comprised of a server, distccd, and a client program, distcc.

Installing distcc

On gentoo machines there are a couple of options you should be aware of 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

On debian machines:

#apt-get install distcc

Start the distcc daemon on all the participating machines:

First you have to set the access options on compiling machines (in other linux distribution this file may be located in other directory):

# vi /etc/conf.d/distccd

and, at the DISTCCD_OPTS line (example):

DISTCCD_OPTS="${DISTCCD_OPTS} --allow --allow"

so you can add distccd to the default runlevel

# rc-update add distccd default

and start the distcc daemon

# /etc/init.d/distccd start

On client machine, you have to put the names of the servers in your enviroment:

# export DISTCC_HOSTS='localhost server1 server2'

Now, we are ready to build the kernel:

# cd /TFCproject/myKernel/

# make -jN CC=distcc

where N is the number of jobs running concurrently; usually N is set so that: N = #processors + 1 (you can increase this number if you want to try if the compilation speed up more).

Last modified 11 years ago Last modified on Oct 25, 2007, 10:03:49 AM