Ccache

From miki
Revision as of 20:00, 29 November 2017 by Mip (talk | contribs) (→‎Reference)
Jump to navigation Jump to search

According to the manpage, ccache is a fast C/C++ compiler cache. It works with the gcc and clang compilers (or alike).

Reference

Install

On Debian / Ubuntu, ccache is available as a standard package:

sudo apt install ccache

To use ccache for compiling, just create a few symlinks. For instance, to use ccache with gcc and clang-3.6:

sudo ln -sf /usr/bin/ccache /usr/local/bin/gcc
sudo ln -sf /usr/bin/ccache /usr/local/bin/clang-3.6

This will work as long as the directory with symlinks comes before the path to the compiler (which is usually in /usr/bin).

Usage

  • Collect ccache usage statistics:
ccache -s
  • Set cache size:
ccache -M 2G