Provide a way to distribute and speed up compilations.
Do not use native or generic with either -march or -mtune as you'll end up with a bad compile on distcc! This is because each distributed job from the sending node will tell the others to use native or generic and this will make each computer use it's own cpu and arch settings. This is only ever safe if all the nodes run the same cpu and arch. I would advise against it at all costs.
This is how I setup distcc and ccache, I will make it more general in time. How to configure distcc and ccache.
It is recommended to build in a ram file system to aid in faster compiles, instructions are here.
Enable the contrib repository if not already done, then run this command.
prt-get depinst --install-scripts ccache distcc
Edit the following lines:
Edit /etc/rc.conf and add these lines:
Add these lines in /etc/pkgmk.conf:
export DISTCC_HOSTS='localhost/4 foo/4 bar/2'
export MAKEFLAGS='-j10' export SCONSFLAGS="$MAKEFLAGS"
To set this dynamically use
export MAKEFLAGS="/usr/bin/distcc -j 2> /dev/null"
Edit /etc/rc.conf and add the pkgmk user if you are using fakeroot.
Edit /etc/rc.conf and add this line seting the level of verbose messages to the system log. Default is notice, other levels are critical, error, warning, info, or debug.