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
1
vote
1 answer

Improving the ccache hit rate

I am working with distcc and ccache to speed up the compilation of my project. I noticed that I am not getting any hits when I am building the same code from different directories. I looked up online https://github.com/ccache/ccache/issues/212 and…
whacky_bruce
  • 99
  • 1
  • 6
1
vote
1 answer

Can I recover memory allocated to ccache (compiler cache)?

I have been building LineageOS and AOSP ROMs for over a year now. A build for me takes about eight hours on my PC and I know using ccache can speed things up for me. But I have read on LineageOS's website and XDA that you cannot recover the space…
1
vote
0 answers

ccache ignores CCACHE_DIR

I have two identical projects with the same file /Users/Steve/Desktop/foo/a.cpp /Users/Steve/Desktop/bar/a.cpp I use ccache to speedup the compilation across directory boundaries, so I defined CCACHE_BASEDIR export…
Daniel Stephens
  • 2,371
  • 8
  • 34
  • 86
1
vote
1 answer

Does ccache totally excel the means of gcc's precompiled headers?

To speed up the gcc's compilation time, we have two options: ccache gcc's precompiled headers However, I don't know which is better under what circumstances. I have googled this question, and get some vague impression that ccache is totally excel…
xmllmx
  • 39,765
  • 26
  • 162
  • 323
1
vote
1 answer

Which cache algorithm is used in ccache?

I was trying to find any information about cache algorithm that are used in ccache, but didn't find anything. So, does anyone know how ccache evict elements when max_size is reached? LRU? MRU? "Ring buffer"?
Jimilian
  • 3,859
  • 30
  • 33
1
vote
1 answer

Error while creating ccache for Android Rom on OSX

I am trying to use ccache to build the rom faster. the link at http://source.android.com/source/building.html gives the following code: $ export USE_CCACHE=1 $ export CCACHE_DIR=//.ccache $…
user5057356
1
vote
1 answer

Ccache doesn't work with gcc -M flag?

I'm trying to use ccache to speed up my rebuilds and I noticed this in the log: [2015-04-17T10:41:45.845545 27682] Compiler option -M is unsupported [2015-04-17T10:41:45.845584 27682] Failed; falling back to running the real compiler In my…
Joseph Garvin
  • 20,727
  • 18
  • 94
  • 165
1
vote
1 answer

What happens if compiling AOSP/CM is interrupted

I have two guesses: It compiled from the start, but uses CCACHE to go much quicker It continues, by detecting which modules have been compiled What would happen if I clear the CCACHE but not the OUT directory? Would it continue or restart?
Hamzah Malik
  • 2,540
  • 3
  • 28
  • 46
1
vote
2 answers

Detect if a compiler is using ccache

ccache does not support some compiler options (e.g. --coverage). If there is an unsupported compiler options it compiles but the cache is not used. There are more than one ways how to enable ccache (modifying PATH, using CC/CXX environment…
arved
  • 4,401
  • 4
  • 30
  • 53
1
vote
2 answers

What is a difference between ccache preprocessor and direct modes?

AFAIK, the preprocessor mode is simple: you give a preprocessed source to ccache, it hashes the source and command-line args, then stores all corresponding info, like stderr, object file, etc. But what is a direct mode and why is it much faster?…
abyss.7
  • 13,882
  • 11
  • 56
  • 100
1
vote
2 answers

CMake wants to use ccache instead of gcc

I am trying to use CMake to compile a C++ project on Ubuntu, but I get this error: CMake Error: your C compiler: "/usr/lib64/ccache/bin/gcc" was not found. Please set CMAKE_C_COMPILER to a valid compiler path or name. CMake Error: your CXX…
Tom Macdonald
  • 6,433
  • 7
  • 39
  • 59
0
votes
1 answer

How to override the way CLCompile processes the source files in MSBuild?

I try to use ccache with VS2017 using the steps described here: https://github.com/ccache/ccache/wiki/MS-Visual-Studio Turned out, it only works for ninja and nmake projects which is unacceptable for our working environment. Also the…
Robert
  • 53
  • 1
  • 6
0
votes
0 answers

How to simplify matrix key for usage with ccache?

Currently I have a job on linux with a fairly complex matrix. jobs: linux: runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: os: [ubuntu-22.04, ...] compiler: [{cc: gcc, cxx: g++}, {cc:clang,…
jpr42
  • 718
  • 3
  • 14
0
votes
1 answer

Building LLVM with direct mode distcc and ccache

I'm trying to build LLVM with both distcc (in direct mode, i.e. non-pump mode) and with a ccache on the initiating machine. Tools in isolation I've managed to get both of these systems to work with the LLVM build system in isolation, but not…
Edd Barrett
  • 3,425
  • 2
  • 29
  • 48
0
votes
1 answer

Visual Studio 2019 project generated with CMake ignores CMAKE_CXX_COMPILER

I'm trying to configure CMake 3.24.2 to generate a Visual Studio 2019 project that uses ccache to cache the output of previous builds. For that, I'm following alternative #1 from ccache's docs, where I'm trying to configure CMake to point the…
RAM
  • 2,257
  • 2
  • 19
  • 41