distcc 是linux分布式编译工具,可以大大提高编译速度。
下面就是在两台机子上进行的distcc的配置,一台是gentoo,另一台是ubuntu
Section 1 - Setting up Distcc on gentoo.
a) Install distcc and distcc-config
Code:
emerge distcc
emerge distcc-config
*If distcc-config is masked then
Code:
echo "sys-devel/distcc-config ~x86" >> /etc/portage/package.keywords
b) Configure distcc
Code:
vi /etc/conf.d/distccd
DISTCCD_OPTS="${DISTCCD_OPTS} --allow 192.168.0.0/24"
Modify the above line to suite your subnet. I assume your doing this on a lan.
Code:
distcc-config --set-hosts "192.168.0.77 192.168.0.36 192.168.0.10"
Modify the above line to include the distcc helper ip addresses.
c) Configure gentoo
Code:
vi /etc/make.conf
FEATURES="distcc"
d) Start distcc
Code:
/etc/init.d/distccd start
e) Finally, check which version of gcc your gentoo is running.
Section 2 - Configure the helpers
a) Install distcc
Code:
sudo apt-get install distcc
b) Configure distcc
Code:
vi /etc/defaults/distcc
STARTDISTCC="false"
ALLOWEDNETS="192.168.0.0/24"
Change the STARTDISTCC="false"
to
STARTDISTCC="true"
Change the allowednets network id to correspond with your local lan.
c) Check which version of gcc you are running
gcc -v
If you have the same version of gcc as your gentoo install, then you can simply run:
Code:
/etc/init.d/distcc start
If you do not, then follow on with the next step
d) Install required gcc and g++
Example, to install gcc 3.3
Code:
sudo apt-get install gcc-3.3 g++-3.3
e) Create a distcc binary directory with links
From here on in, the version will be refered to $version, please substitute this with your version number of gcc
Code:
mkdir -p /usr/lib/distcc/$version <-------Make this ther version
cd /usr/lib/distcc/$version
ln -s /usr/bin/gcc-$version gcc
ln -s /usr/bin/g++-$version g++
ln -s /usr/bin/cc cc
ln -s /usr/bin/c++ c++
d) Set and export your new distcc path
Code:
PATH="/usr/lib/distcc/$version:$PATH"
export PATH
e) Crank up distcc
Code:
/etc/init.d/distcc start
And emerge merily away