ccache


ccache is a compiler cache. It acts as a caching pre-processor to C/C++ compilers, using the -E compiler switch and a hash to detect when a compilation can be satisfied from cache. This often results in a 5 to 10 times speedup in common compilations.

Latest release

The latest release is ccache 2.4_ec-0.5.

It works with the following C/C++ compilers:

It is a modified version of the 2.4 release of the Andrew Tridgell program: http://ccache.samba.org/ See the manual page for details on the new options.

NOTE! This release changes the hash input slighly, so you will probably find that you will not get any hits against your existing cache when you upgrade.

Why bother?

Why bother with a compiler cache? If you ever run "make clean; make" then you can probably benefit from ccache. It is very common for developers to do a clean build of a project for a whole host of reasons, and this throws away all the information from your previous compiles.

By using ccache you can get exactly the same effect as "make clean; make" but much faster.

Is it safe?

Yes. The most important aspect of a compiler cache is to always produce exactly the same output that the real compiler would produce. The includes providing exactly the same object files and exactly the same compiler warnings that would be produced if you use the real compiler. The only way you should be able to tell that you are using ccache is the speed.

Features

Documentation

See the manual page

How to use it

You can use ccache in two ways. The first is just to prefix your compile commands with "ccache". For example, you could change the "CC=gcc" line in your Makefile to be "CC=ccache gcc".

Alternatively, you can create symbolic links from your compilers name to ccache. This allows you to use ccache without any changes to your build system.

Download

You can download the latest release from this archive.
Last page modification: 2016-07-21

Édouard Canot web page
Mail: