[SciPy-dev] ccache

eric jones eric at enthought.com
Sat Oct 12 19:05:32 CDT 2002

I just played with ccache (ccache.samba.org) after seeing a related
project (distcc) on Slashdot.  It's way cool.  The whole idea is for the
"compiler" to cache object files and only re-compile .c/.cpp files when
the compiler version, compile options, or file has changed.  As a
result, if you do a the following in the Python CVS

make        (2.33 minutes)
make clean
make        (0.33 minutes)

The second make will run really fast.  Or, in our case,

python setup.py build  (4.5 minutes)
rm -rf build
python setup.py build  (1.5 minutes)

That is *really* handy.  I had to edit a single line of the ccache.c to
get it to recognize Fortran files (at bottom of page).  The only thing
now that the caching mechanism doesn't handle is pyf files.  Ccache is
built to work explicitly with C/C++ compilers (gcc specifically I
think), and so my naïve attempt at adding an pyf extension (and replace
f2py with the ccache call) didn't work.  If we could get ccache to
handle f2py, secondary builds would probably drop to 15-30 seconds.
Even if we don't, this is worth knowing about -- at least I was happy to
find it!


---- edits to ccache.c ----

} extensions[] = {
	{"c", "i"},
	{"C", "ii"},
	{"m", "mi"},
	{"f", "i"},   /* I added this one */
	{"cc", "ii"},
	{"CC", "ii"},
	{"cpp", "ii"},
	{"CPP", "ii"},
	{"cxx", "ii"},
	{"CXX", "ii"},
	{"c++", "ii"},
	{"C++", "ii"},

eric jones                    515 Congress Ave
www.enthought.com             Suite 1614
512 536-1057                  Austin, Tx 78701 

More information about the Scipy-dev mailing list