Distributed compilation using distcc ccache

  • Install distcc and ccache in all computers
sudo apt-get install distcc ccache
  • Put the following in your .bashrc:
export CCACHE_PREFIX=distcc
export DISTCC_HOSTS='username@computer1/5:/usr/bin/distccd username@computer2/5:/usr/bin/distccd'
export ROS_PARALLEL_JOBS="-j10"
export PATH=${HOME}/local/bin:${PATH}
  • Create some files in a ccache program in your xstow directory (~/local/DIR/ccache):
cd ~/local/DIR
mkdir -p ccache/bin
cd ccache/bin
ln -s /usr/bin/ccache cc
ln -s /usr/bin/ccache c++
ln -s /usr/bin/ccache gcc
ln -s /usr/bin/ccache g++
cd ../../
xstow ccache
  • Activate connection caching. Edit ~/.ssh/config with:
Host *
  ControlMaster auto
  ControlPath ~/.ssh_tmp/master-%r@%h:%p
  • Create temp dir:
mkdir ~/.ssh_tmp
  • Make sure you can log in without password
  • Try to compile something!
  • If something doesn't work try: export DISTCC_VERBOSE=1
  • To compile PCL with distcc you have to disable the CMAKE flag -march=native in cmake/pcl_find_sse.cmake

Refs: http://toychest.in.tum.de/wiki/robots:rosie_distcc


Enter your comment. Wiki syntax is allowed:
Creating directory /var/lib/dokuwiki/data/tmp/captcha/2021-01-19 failed
If you can't read the letters on the image, download this .wav file to get them read to you.
  • tutorials/distributed_compilation.txt
  • Last modified: 2016/02/26 11:52
  • by amora