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:

Open “~/.bashrc” and add:

Open “~/.colorgccrc” and add:

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:

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

Leave a Reply

Your email address will not be published. Required fields are marked *