Ever wish you could harness the power of many boxen to compile those large projects like KDE, or the LInux kernel? Well, you can, with distcc. We grabbed version 1.5, and compiled it on srv-33 and srv-34, two machines with P133 processors:
# cd /usr/local/src # tar -xzf distcc*.gz # cd dist* distcc-0.15]# ./configure && make && make install checking build system type... . . . |
We need to run the daemon on both machines:
[u-1@srv-34 u-1]$ distccd [u-1@srv-33 u-1]$ distccd |
The entry in srv-34’s system log:
Jan 27 13:34:20 srv-34 distccd[2606]: distccd (version 0.15, built Jan 27 2003 13:22:46) listening on port 3632 Jan 27 13:34:20 srv-34 distccd[2607]: (dcc_parent_loop) waiting to accept connection |
Notice that we are *not* running distccd as root.
Next we are going to extract a source tarball for fdutils-5.4, run .configure, export the DISTCC_HOSTS variable on srv-33, and compile with both machines:
$ export DISTCC_HOSTS='srv-34 srv-33' $ make CC='distcc' -j4 |
That is all there is to it. Instead of running make like you usually would, use the last line instead. The j option is supposed to be twice the number of CPUs.
For our simple test with fdutils, a compile on a single machine took 2 Min. 35 Sec. With distcc, and two machines in the above example, it took 1 Min. 30 Sec. If we made the entire compile take place on a remote P4 1.7 Ghz box, it took 1 Min. 5 Sec. Note that srv-34 and srv-33 are on a 10 Mbps LAN, so network speed is a factor.