Listing 3. ccache cache statistics.
清单3 .ccache高速缓存统计数据。
Ccache ACTS as a cache to the compiler.
ccache用作编译器的缓存。
You can use ccache with or without distcc.
使用ccache时,可以带有distcc,也可以不带。
Use ccache to further speed up compilation.
使用ccache进一步提高编译速度。
Note that ccache only needs to be installed on the local machine.
注意,只需在本地机器上安装ccache。
Instead of calling GCC, you call ccache with GCC as the first argument.
以gcc为第一个参数调用ccache,而不是调用gcc。
Installing ccache and using it is not as complicated as you might think.
安装和使用ccache并不像您可能想像的那样复杂。
To download the latest version (2.4) of ccache, see the Resources section.
要下载ccache的最新版本(2.4),请参考参考资料小节。
CCACHE_DIR — Specifies the folder where ccache stores the precompiled outputs.
CCACHE_DIR——指定ccache存储预编译输出的文件夹。
As mentioned above, ccache works by sitting between you and your normal compiler.
如上所述,ccache在您与您的普通编译器之间进行工作。
For example, it is invalid to specify ccache when requesting acceptor credentials.
例如,当请求acceptor凭证时指定ccache是无效的。
You can improve compile times even more when using ccache in combination with distcc.
组合使用ccache和distcc,您可以更进一步地改进编译时间。
As previously mentioned, the effects of ccache won't be felt on the first compilation.
如前所述,在第一次编译时,ccache的影响不会为人所察觉。
CCACHE_DISABLE — If set, tells ccache to invoke the compiler proper, bypassing the cache.
CCACHE_DISABLE——设置这个选项告诉ccache完全调用编译器,从而绕过缓存。
CCACHE_TEMPDIR — Specifies the folder where ccache puts temporary files that it generates.
CCACHE_TEMPDIR——指定放置ccache生成的临时文件的文件夹。
CCACHE_PREFIX — Adds a prefix to the command line that ccache USES to invoke the compiler proper.
ccache _ PREFIX——向ccache用于完全调用编译器的命令行添加一个前缀。
CCACHE_LOGFILE — If set, tells ccache to record the hit and miss statistics from the cache in this file.
CCACHE_LOGFILE——设置这个选项告诉ccache随机记录该文件在缓存中的统计信息。
We need something meaty to compile, because ccache works best when it has cached the parsed header files.
我们需要编译一个足够大的项目,因为ccache在高速缓存了解析过的头文件时运转效果最好。
Use the -s command line option with ccache to get statistics about the cache performance (see Listing 3).
在ccache中使用- s命令行选项来获得关于高速缓存性能的统计数据(见清单3)。
CCACHE_PREFIX defines a prefix to use when ccache calls the true compiler to compile the source (after preprocessing).
ccache _PREFIX定义了当c cache调用真实的编译器来编译源文件(预处理之后)时所使用的前缀。
This article has delved into the GNU make, distcc, and ccache tools, which can help you parallelize the build process.
本文探讨了GNU make、distcc和ccache,这些工具能够并行分布编译过程。
To use distcc and ccache in this way, configure distcc on your hosts and distcc and ccache on your main development machine.
要以这种方式来使用distcc和ccache,需要在主机上配置distcc,在主要的开发机器上配置distcc和ccache。
In this article, you've seen how much of a speed improvement you can obtain from a relatively straightforward and easy-to-use tool such as ccache.
在本文中,您已经了解了通过ccache等相当直观而且易用的工具可以获得怎样的速度上的提高。
CCACHE_RECACHE — If set, tells ccache to ignore the existing entries in the cache and calls the compiler; but for new entries, it caches the result.
CCACHE_RECACHE——设置这个选项告诉ccache忽略缓存中现有的条目并调用编译器;但对于新的条目,则缓存结果。
Ccache makes the first check to decide whether the copy in the local cache suffices; otherwise, it hands the baton to distcc for distributed compilation.
ccache进行第一次检查,确定副本是否存在本地缓存中;如果不存在,就由distcc进行分布式编译。
To install ccache, download the source directly from the Samba group or a local mirror (see Resources at end of this article). Unpack the contents of the file
要安装ccache,需要从Samba小组或者一个本地镜像(参阅本文最后的参考资料)直接下载源文件。
While recompiling, if ccache detects no changes in the preprocessed source and compiler options, it retrieves its cached copy of the previously compiled output.
在重新编译时,如果ccache未在预处理源代码和编译器选项中检测到任何更改,它就检索以前编译输出的缓存副本。
I've included The Times for building with plain GCC, ccache + GCC, and ccache + distcc + GCC in a four-node network with various values of concurrent distcc jobs.
其中包括使用普通gcc、ccache + gcc、ccache +distcc + gcc所需的编译时间,编译在一个四节点网络中进行并选用了不同的并发distcc作业数目值。
Therefore, it is generally more effective to configure ccache as a permanent replacement for your main compiler. To do this, set the value of the cc environment variable.
所以,配置ccache永久地取代主要编译器通常来说更为有效。
You shouldn't normally need to use this, as ccache updates the information during execution, but if you reuse a cache directory that has not been used for a file, you might want to try this option.
您通常不需要使用这个选项,因为ccache在执行过程中会更新信息,但是,如果您要重用一个没有为某个文件所使用的高速缓存目录,那么就应该尝试使用这个选项。
应用推荐