Distcc

From OpenCog
Jump to: navigation, search

THIS PAGE IS OBSOLETE. SEE HERE INSTEAD

Instructions for distcc compile node setup on PCs at the OpenCog Lab at PolyU.

Make your workstation a distcc node

1. Install Docker

   sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
   echo deb https://get.docker.io/ubuntu docker main | sudo tee /etc/apt/sources.list.d/docker.list
   sudo apt-get update
   sudo apt-get install lxc-docker

Log out from desktop environment, then log back in

2. Run distcc container

   docker run -d -p 3632:3632 opencog/opencog-distcc

Use distcc

Step 1: Install distcc and tools

   sudo apt-get install distcc distccmon-gnome

Step 2: Set environment variables & run distcc monitor

From within an empty opencog/build directory:

   export DISTCC_HOSTS="158.132.58.91/8 158.132.58.86/8 158.132.58.92/8 158.132.58.89/4 158.132.58.94/4"
   export CC="distcc gcc"
   export CXX="distcc g++"
   distccmon-gnome &

Note, for persistence across shells, logins, and IDEs, the export statements should be added to .profile or .bashrc and the running session logged out of and back into.

Step 3: Run test compile

   cmake ..
   time make -j3

If gcc and other processes appear in the monitor attached to host 158.132.58.91 or others in the list, the process has succeeded and make can be told to use more processors:

   time make -j32

It is safe to ignore any warnings about distcc-pump or similar to 'failed to get includes from include server, preprocessing locally'.