Questions tagged [ccache]

ccache is a compiler cache. It speeds up recompilation by caching previous compilations and detecting when the same compilation is being done again. Supported languages are C, C++, Objective-C and Objective-C++.

The source code is hosted on GitHub:

The home page for the project (with links to documentation and downloads) is:

105 questions
122
votes
10 answers

How to Use CCache with CMake?

I would like to do the following: If CCache is present in PATH, use "ccache g++" for compilation, else use g++. I tried writing a small my-cmake script containing CC="ccache gcc" CXX="ccache g++" cmake $* but it does not seem to work (running…
amit kumar
  • 20,438
  • 23
  • 90
  • 126
40
votes
5 answers

Is there a 'ccache' for Visual Studio?

I am aware that scons implements the functionality of ccache, but I am stuck with another build system. I also know there is a gocache project on SourceForge that aims to implement ccache-like functionality for other compilers, but it seems not…
amit kumar
  • 20,438
  • 23
  • 90
  • 126
28
votes
5 answers

Is it possible to accelerate clang-tidy using ccache or similar?

Since employing ccache on our CI server, we find that the bottleneck in terms of build time is now our static analysis pass, that uses clang-tidy, among other tools. Does anyone know of a way to accelerate clang-tidy in a similar way to how ccache…
Tim Angus
  • 983
  • 11
  • 26
26
votes
4 answers

How to use ccache selectively?

I have to compile multiple versions of an app written in C++ and I think to use ccache for speeding up the process. ccache howtos have examples which suggest to create symlinks named gcc, g++ etc and make sure they appear in PATH before the original…
Anonymous
23
votes
7 answers

g++, colorgcc and ccache

Trying to combine ccache and colorgcc. Following link text: my g++ is soft link to colorgcc ~/.colorgccrc contains line: "g++: ccache /usr/bin/g++" When running g++ --version receive: Can't exec "ccache /usr/bin/gcc": No such file or directory…
dimba
  • 26,717
  • 34
  • 141
  • 196
21
votes
2 answers

Using ccache when building inside of docker

I am working on moving the build for a C++ project into a docker image. The image will be built and pushed by a Jenkins job. Prior to docker, I made heavy use of ccache to speed up my builds on Jenkins, especially in the case of builds where very…
Viper Bailey
  • 11,518
  • 5
  • 22
  • 33
13
votes
1 answer

ccache cache miss slow down compilation a lot

Just started using ccache based on this tutorial and so far I like it. However, caches miss are being extremely slow. Here are my results : Regular clean build without ccache : 1m40s First build with ccache : 4m36s Second build with ccache :…
gcamp
  • 14,622
  • 4
  • 54
  • 85
11
votes
2 answers

when is the case to use ccache?

As far as I know, ccache speed up compilation by catching previous compilations and detecting when the same compilation is being done again. however, makefile do the same thing. so why should we need ccache? when is the case we use it? thanks!
chicklet
  • 111
  • 4
10
votes
2 answers

How to get Bazel, ccache, and sandboxing to work together (ccache read only filesystem)

I'm attempting to build a C++ application on Fedora 28 using Bazel 0.16.1 installed via copr and ccache 3.4.2 installed via DNF. I'm using the default cc_binary and cc_library rules. When I run the bazel build command, ccache errors out…
Matt W
  • 101
  • 1
  • 4
10
votes
1 answer

"Source file is more recent than executable" except it isn't

GDB is complaining that my source file is more recent than the executable, and it appears the debugging information is indeed related to an older version of the source file, because gdb is stopping on a blank line: Program received signal SIGSEGV,…
Matthew Mitchell
  • 5,293
  • 14
  • 70
  • 122
10
votes
5 answers

How to enable ccache on Linux

There is very little documentation on enabling ccache on GNU/Linux. Here is a response from launchpad.net: At the moment, I think the best way to enable ccache is to add "/usr/lib/ccache" to the front of your path. If you want to enable it for…
Arky
  • 380
  • 1
  • 4
  • 15
9
votes
3 answers

How to use ccache with Make?

I have a source directory which uses makefile to compile the code. This makefile/configure file is not written for ccache compatibility. So I thought to use ccache. I created alias in .bashrc as alias gcc='ccache gcc', but Makefile is still not…
peeyush
  • 2,841
  • 3
  • 24
  • 43
9
votes
2 answers

Check if a ccache call was a cache hit

As part of my build process, I'd like to get statistics on the build time and whether ccache found the item in the cache. I know about ccache -s where I can compare the previous and current cache hit counts. However, if I have hundreds of…
mrks
  • 8,033
  • 1
  • 33
  • 62
8
votes
1 answer

How to use ccache > 4.6.1 on Windows MSVC with cmake?

As of version 4.6.1, ccache supports compilation with msvc. On my Windows environment, I have ccache installed and available via the command line. I try to integrate ccache to my cmake project in the following way: Root…
Elad Maimoni
  • 3,703
  • 3
  • 20
  • 37
8
votes
1 answer

GCC_COLORS in combination with ccache

I am using gcc 4.9.2 with ccache 3.1.10. My shell environment contains GCC_COLORS=auto (from here; tried yes and always too). As a minimal test I compile this main.c file int main() { int a; return 0; } with gcc -c main.c -Wall -o main.o…
pseyfert
  • 3,263
  • 3
  • 21
  • 47
1
2 3 4 5 6 7