ITK/Release 4/Wrapping/ccache

From KitwarePublic
Jump to navigationJump to search

Using CCache for WrapITK

Using CCache[1] to build WrapITK can improve the build times considerably. For all unix systems (including MacOS X), ccache is enabled by creating symbolic links to the g++/gcc compiler:

ln -s /usr/bin/ccache /usr/local/bin/g++
ln -s /usr/bin/ccache /usr/local/bin/gcc

Alternatively, on MacOS X, Install ccache with Macports. The Macports installation would automatically create the symbolic links to g++/gcc compilers and put them in the directory /opt/local/libexec/ccache. The only remaining thing then is to add this directory to the PATH variable (alternatively you can add it to the .bash_profile or .profile in home directory)

$ sudo port install ccache
$ export PATH= /opt/local/libexec/ccache:$PATH

All the subsequent builds of WrapITK would use ccache and we can see a speedup of as much as 40 minutes for repeated invocations.