c/c++编译加速器-ccache
2010-11-08 09:00:22 阿炯

ccache(“compiler cache”的缩写)是一个编译器缓存,该工具会高速缓存编译生成的信息,并在编译的特定部分使用高速缓存的信息, 比如头文件,这样就节省了通常使用 cpp 解析这些信息所需要的时间。

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++.

ccache is free software, released under the GNU General Public License version 3 or later.

Features
* Keeps statistics on hits/misses.
* Automatic cache size management.
* Can cache compilations that generate warnings.
* Easy installation.
* Low overhead.

如果你经常一遍一遍地编译相同的程序——比如,尝试不同的kernel补丁,或者测试你自己开发的程序——那么,对你来说,ccache就太完美了。它将在第一遍编译时多花几秒钟,但接下来就会快得多得多。很明显,它不是适合每个人的。在安装好之后,可以用其加速编译C代码,使用"ccache gcc"或"ccache g++"代替"gcc"或"g++" 你也可以配置makepkg使用ccache,只需在你的/etc/makepkg.conf中加入下面几行:
export CC="ccache gcc"
export CPP="ccache cpp"
export CXX="ccache g++"

最新版本:3.2
1. 可正确处理非常规的头文件引入
2. 对文件进行压缩和解压缩时进行 CRC 校验错误甄别
3. 修复了 NFS 下潜在的可能导致对象文件遭到破坏的问题
4. 更新了文档
5. 修复了配置监测的bug

官方主页:http://ccache.samba.org/