Building pkgsrcs with distcc ============================ iMil From devel/distcc/DESCR : --8<-- distcc is a program to distribute compilation of C or C++ code across several machines on a network. distcc should always generate the same results as a local compile, is simple to install and use, and is often two or more times faster than a local compile. -->8-- pkgsrc infrastructure permits the use of distcc to build a package, and thus speed up your building time. Here is what to install and how to use /etc/mk.conf so you can take benefit of distcc. 1. Install distcc ----------------- From the pkgsrc tree, install distcc : # cd /usr/pkgsrc/devel/distcc # make install clean Ensure it will startup at boot time by setting : distccd=YES PAY ATTENTION TO THIS: I had some bad experiences with distccd rejecting connection from any other host than localhost when running official rc.d script, so instead of the standard way, I added : /usr/pkg/bin/distccd --daemon --user nobody --listen my-host to my /etc/rc.local 2. Setting up /etc/mk.conf -------------------------- Add the following to /etc/mk.conf # define distcc as the main package compiler PKGSRC_COMPILER=distcc gcc # list distccd usable hosts DISTCC_HOSTS=my-host my-host1 my-host2 localhost # I discovered this one by reading bsd.pkg.mk # this is the way to use -j only when building # set to the number of distccd hosts BUILD_MAKE_FLAGS=-j 4 3. Compile ! ------------ Now try compiling some packages and run on another console : $ distccmon-text 0.5 to see how the work is dispatched.