- 论坛徽章:
- 84
|
有一段时间 gcc 默认就是 ccache 的符号链接,刚看了一下 fedora 23 发现又变回去了. 需要自己设置一下
官网地址:
https://ccache.samba.org/
Features
Keeps statistics on hits/misses.
Automatic cache size management.
Can cache compilations that generate warnings.
Easy installation.
Low overhead.
Optionally uses hard links where possible to avoid copies.
Limitations
Only knows how to cache the compilation of a single C/C++/Objective-C/Objective-C++ file. Other types of compilations (multi-file compilation, linking, etc) will silently fall back to running the real compiler.
Only works with GCC and compilers that behave similar enough.
Some compiler flags are not supported. If such a flag is detected, ccache will silently fall back to running the real compiler.
Why bother?
If you ever run make clean; make, you can probably benefit from ccache. It is common for developers to do a clean build of a project for a whole host of reasons, and this throws away all the information from your previous compilations. By using ccache, recompilation goes much faster.
Another reason to use ccache is that the same cache is used for builds in different directories. If you have several versions or branches of a software stored in different directories, many of the object files in a build directory can probably be taken from the cache even if they were compiled for another version or branch.
A third scenario is using ccache to speed up clean builds performed by servers or build farms that regularly check that the code is buildable.
You can also share the cache between users, which can be very useful on shared compilation servers.
*Is it safe?*
Yes. The most important aspect of a compiler cache is to always produce exactly the same output that the real compiler would produce. This includes providing exactly the same object files and exactly the same compiler warnings that would be produced if you use the real compiler. The only way you should be able to tell that you are using ccache is the speed.
ccache has been coded very carefully to try to provide these guarantees. However, if you experience any bugs, please report them. |
|