HiveBrain v1.2.0
Get Started
← Back to all entries
snippetbashTip

ccache — C/C++ compiler cache. Note: Packages usually provide symlinks for compilers in `/usr/lib/ccache/bin`

Submitted by: @import:tldr-pages··
0
Viewed 0 times
usuallycommandnotecachecliccachecompilerpackages

Problem

How to use the ccache command: C/C++ compiler cache. Note: Packages usually provide symlinks for compilers in /usr/lib/ccache/bin. Prepend this directory to $PATH to automatically use ccache for them. More information: <https://ccache.dev/manual/latest.html>.

Solution

ccache — C/C++ compiler cache. Note: Packages usually provide symlinks for compilers in /usr/lib/ccache/bin. Prepend this directory to $PATH to automatically use ccache for them. More information: <https://ccache.dev/manual/latest.html>.

Show current cache statistics:
ccache {{[-s|--show-stats]}}


Clear all cache:
ccache {{[-C|--clear]}}


Reset statistics (but not cache itself):
ccache {{[-z|--zero-stats]}}


Compile C code and cache compiled output (to use ccache on all gcc invocations, see the note above):
ccache gcc {{path/to/file.c}}

Code Snippets

Show current cache statistics

ccache {{[-s|--show-stats]}}

Clear all cache

ccache {{[-C|--clear]}}

Reset statistics (but not cache itself)

ccache {{[-z|--zero-stats]}}

Compile C code and cache compiled output (to use `ccache` on all `gcc` invocations, see the note above)

ccache gcc {{path/to/file.c}}

Context

tldr-pages: common/ccache

Revisions (0)

No revisions yet.