# GCC Stack: Colorgcc, CCache, Distcc

For prettifying and speeding up the compilation of your C++ on Linux with GCC it’s relatively common practice to use colorgcc, ccache, and distcc. This page describes the quick couple steps it takes to set up a “gcc stack” that does all the prettifying and speeding up for you. You don’t need to make any changes to the makefile. Just running the old gcc command will also run ccache and colorgcc and distcc if you wish.

Below are the commands from that page. If you need explanation, actually go there.

Create directory “~/bin/”, and in it run:

ln -s /usr/bin/colorgcc gcc
ln -s /usr/bin/colorgcc g++

export PATH=~/bin/:\$PATH

gcc: ccache /usr/bin/gcc
g++: ccache /usr/bin/g++

Also, as I do, you can take advantage of having multiple processors by running gcc with the –jobs=# flag where # is the number of processors you have (or number of processors plus one, or more if you’re using distcc). How many processors do you have? Run:

grep -c '^processor' /proc/cpuinfo

You can add that to your script or makefile to automatically determine the value passed to the –jobs flag.