If you're always compiling the same programs over and over again — such as trying out several kernel patches, or testing your own development — then Template:Codeline is perfect. While it may take a few seconds longer to compile a program the first time with Template:Codeline, subsequent compiles will be much, much faster.
Template:Codeline is available as a package in the extra repository. In order to install it, run
# pacman -S ccache
Enable ccache for makepkg
BUILDENV=(fakeroot !distcc color ccache !xdelta)
Note: If you are compiling for example KDE you have to disable export CPP and export CXX — it prevents from some errors.
Enable for command line
If you're compiling your code from the command line, and not building packages, then you'll still want to use Template:Codeline to help speed things up.
You may want to add this line to your Template:Filename file for regular usage.
Enable with colorgcc
Since colorgcc is also a compiler wrapper, some care needs to be taken to ensure each wrapper is called in the correct sequence.
export PATH="/usr/lib/colorgcc/bin/:$PATH" # As per usual colorgcc installation, leave unchanged (don't add ccache) export CCACHE_PATH="/usr/bin" # Tell ccache to only use compilers here
You can use the command line utility ccache to...
Show statistics summary:
$ ccache -s
Clear the cache completely:
$ ccache -C
Enjoy faster compiling!