Distcc+pump安装配置手册(方法2)
服务器端(计算机名为:zhimingubtpc.local):
$ sudo useradd distcc
$ sudo apt-get install python-dev
$ sudo tar zxfv distcc-3.2rc1.tar.gz
$ cd distcc—3.2rc1
$ sh ./autogen.sh
$ ./configure –prefix=/usr/local/distcc
$ make
$ sudo make install
$ sudo mkdir /usr/local/distcc/log
$ sudo touch/usr/local/distcc/log/distcc.log
$ sudo chown –R distcc:adm/usr/local/distcc/log
$ echo "aliasdistccd='/usr/local/distcc/bin/distccd --daemon --allow 10.0.1.0/24--log-file=/usr/local/distcc/log/distcc.log'" >> ~/.bashrc
$ source ~/.bashrc
开启distcc:
$ sudo distccd
关闭distcc:
$ sudo killall distccd
客户端:
$ sudo useradd distcc
$ $ sudo apt-get install python-dev
$ sudo tar zxfv distcc-3.2rc1.tar.gz
$ cd distcc—3.2rc1
$ sh ./autogen.sh
$ ./configure –prefix=/usr/local/distcc
$ make
$ sudo make install
$ sudo ln –s /usr/local/distcc/bin/distcc/usr/local/distcc/bin/cc
$ sudo ln –s /usr/local/distcc/bin/distcc/usr/local/distcc/bin/gcc
$ sudo ln –s /usr/local/distcc/bin/distcc/usr/local/distcc/bin/g++
$ sudo mkdir /usr/local/distcc/log
$ sudo touch/usr/local/distcc/log/distcc.log
$ sudo chown –R distcc:adm/usr/local/distcc/log
$ echo "aliasdistccd='/usr/local/distcc/bin/distccd --daemon --allow 10.0.1.0/24--log-file=/usr/local/distcc/log/distcc.log'" >> ~/.bashrc
$ source ~/.bashrc
开启distcc:
$ sudo distccd
关闭distcc:
$ sudo killall distccd
$ vi ~/.bashrc (在最后添加)
按a或i进入编辑模式
exportDISTCC_HOSTS='localhost,cpp,lzo zhimingubtpc.local,cpp,lzo'
export PATH=/usr/local/distcc/bin:/usr/bin:/bin
按Esc键退出编辑模式
:wq (保存并退出)
$ source ~/.bashrc
在make前添加pump即可
查看下gcc路径:
$ which gcc (如果显示/usr/lib/distcc/gcc则是说明环境变量生效了)
转载于:https://blog.51cto.com/yangzhiming/1354741