From ArchWiki
Revision as of 19:41, 23 July 2005 by Cactus (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

There's a wonderful tool for gcc called ccache. You can read about it at their home page.

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 ccache is perfect. While it may take a few seconds longer to compile a program the first time with ccache, subsequent compiles will be much, much faster. Obviously, this won't help everyone.

Anyway, there happens to be an Arch package for ccache in the Extra repository.

pacman -S ccache

Now, to speed up compiling C code, instead of running "gcc" or "g++" by itself, you run "ccache gcc" or "ccache g++". You can configure makepkg to use ccache by adding these lines to your /etc/makepkg.conf:

export CC="ccache gcc"
export CPP="ccache cpp"
export CXX="ccache g++"

Enjoy faster compiling!