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
8
votes
3 answers

Avoid superfluous warnings when compiling Qt code with ccache / clang

I am having the same problem as this guy. Compiling with clang and ccache I get this warning everytime it encounters a Q_OBJECT: warning: explicitly assigning value of variable of type 'int' to itself [-Wself-assign] This only happens when using…
ValarDohaeris
  • 6,064
  • 5
  • 31
  • 43
8
votes
1 answer

ccache with same code base and multiple toolchains

Our system supports being built with three different toolchains (gcc, icc, diab). I am not sure if using ccache is safe in this case. My concern is the following: if I build with gcc, and then rebuild with diab, will I get a ccache hit in the case…
Ben
  • 297
  • 1
  • 11
8
votes
1 answer

Why isn't ccache used with gcc more often?

I've been wondering... Are there some limitations with ccache? If the difference in later compile times are so large, why aren't more Linux developers using ccache more often?
Hakkar
  • 2,391
  • 4
  • 23
  • 33
7
votes
2 answers

How to get ccache to not pass the full path to the compiler to distcc

(This is different to the question ccache and absolute path as I want only the command path to not be expanded on the ccache host machine) When using ccache and distcc together ccache is expanding the compiler to an absolute path, and then distcc…
David Gardner
  • 6,952
  • 4
  • 35
  • 37
7
votes
0 answers

How can I get the full benefit of precompiled headers while using ccache?

My project sometimes benefits from ccache, so I have long been using ccache. I'm now adding precompiled headers. Some sources suggest that the two are incompatible and that one must choose between them. But I find in ccache's documentation that…
mjwach
  • 1,174
  • 2
  • 9
  • 25
7
votes
2 answers

What does ccache mean by "called for link"

What is meant by the ccache statistic "called for link". I thought ccache only wrapped the compiler, not the linker? [Brian@localhost ~]$ ccache -s cache directory /home/Brian/.ccache cache hit (direct) …
6
votes
3 answers

disadvantages of ccache

I am using ccache for experiments, but I am not quite sure that I should use this. Can anyone explain the situation when ccache can result in wrong behavior. Or should we always use ccache ? Anyone who got that ccache is producing wrong object files…
peeyush
  • 2,841
  • 3
  • 24
  • 43
6
votes
2 answers

How do I make ccache cache compilation when using absolute paths to the compiled files in different directories?

I use CMake to create a makefiles. CMake creates GCC line containing absolute paths. To speed up compilation I use ccache. Building same code from different locations (e.g. several developers compile the same code, each under its home directory)…
dimba
  • 26,717
  • 34
  • 141
  • 196
6
votes
2 answers

Using ccache with Xcode 4

Is there any way to use ccache with Xcode 4, to improve C++ build time? Using environment variables I've set CC and CXX to ccache, but the build fails since ccache does not recognise some of the parameters that Xcode 4 outputs.
amfcosta
  • 1,049
  • 10
  • 21
6
votes
2 answers

Setting up ccache with Qt Creator on Windows

I'm trying to set up ccache in Qt Creator on Windows. Unfortunatelly I couldn't find any good instruction. How to make it working? I have ccache installed with Cygwin. edit: I've tried adding QMAKE_CXX+="ccache g++" as additional parameter in…
krzych
  • 2,126
  • 7
  • 31
  • 50
5
votes
1 answer

Ccache hit rate 0.00 % in GitHub Actions CI

In our C++ project, we managed to setup GitHub Actions building our sources using ccache. It works very well on Linux where, thanks to ccache, the build succeeds in less than 5 minutes. Unfortunately, when trying to build on macOS, ccache doesn't…
Francesco Borzi
  • 56,083
  • 47
  • 179
  • 252
5
votes
1 answer

Kernel Build Caching/Nondeterminism

I run a CI server which I use to build a custom linux kernel. The CI server is not powerful and has a time limit of 3h per build. To work within this limit, I had the idea to cache kernel builds using ccache. My hope was that I could create a cache…
Max Ehrlich
  • 2,479
  • 1
  • 32
  • 44
5
votes
1 answer

Using ccache with clang 5 causes different results from just clang5

So with this contrived bit of code - compiling with clang works just fine, but when ccache is used extra warnings/errors appear - I thought ccache is supposed to transparently pass these through. This is ccache 3.1.6 on CentOS 6 from epel repo -…
Adrian Cornish
  • 23,227
  • 13
  • 61
  • 77
5
votes
1 answer

Xcode Address Sanitizer with ccache

I'm trying to use the Address Sanitizer in Xcode, but I'm also using ccache to accelerate my builds. To do this, I've set the CC flag at the Xcode-project-level to point to a script I'm storing at ~/projects/support/cmake/ccache-clang. The script…
yano
  • 4,095
  • 3
  • 35
  • 68
5
votes
2 answers

Using ccache when cross-compiling with autotools

I know the standard way of cross compiling an autoconf-based project: $ ./configure --host=i686-w64-mingw32 However, what if I want to use ccache? I know I can override the CC and CXX variables (e.g CC="ccache i686-w64-mingw32-gcc" ./configure…
Ace17
  • 81
  • 2
  • 6