Ccache: Difference between revisions

From miki
Jump to navigation Jump to search
(Created page with "According to the manpage, ccache is a fast C/C++ compiler cache. It works with the gcc and clang compilers (or alike). == Reference == * [https://ccache.samba.org/manual....")
 
Line 2: Line 2:


== Reference ==
== Reference ==
* [https://github.com/ccache/ccache ccache on GitHub]
* [https://ccache.samba.org/manual.html ccache manual].
* [https://ccache.samba.org/manual.html ccache manual].
* https://software.intel.com/en-us/articles/accelerating-compilation-part-1-ccache
* https://software.intel.com/en-us/articles/accelerating-compilation-part-1-ccache

Revision as of 20:00, 29 November 2017

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