在GNU/Linux上启用ccache的文档很少。以下是来自launchpad.net的响应
目前,我认为启用ccache的最佳方法是在路径前面添加"/usr/lib/ccache“。如果默认情况下要为所有用户启用路径变量,请在/etc/环境中更改路径变量。
有人能给我更多关于启用ccache的信息吗?
发布于 2016-01-06 15:53:31
下载最新版本的卡巴奇以获得更好的性能。
下载后,按照下面提到的步骤执行:
A)使用以下命令锁定文件:
$tar -xvf ccache-3.2.4.tar.bz2
Note : I'm using ccache 3.2.4 Version.You can download the latest one.B)进入ccache-3.2.4文件夹并运行以下命令:
$./configure
$./make
$ sudo make installC)转到.bashrc并插入以下内容:
export CCACHE_DIR=/home/user_name/.ccache
export CCACHE_TEMPDIR=/home/user_name/.ccache
Note : Fill user_name with your User NameD)保存Bashrc并将其来源于
$ source ~/.bashrc( E)检查ccache是否工作类型:
ccache -M 10G : To Set the ccache Size to 10GB( F)检查ccache是否工作类型:
ccache -s : To check ccache statistics 发布于 2013-01-27 16:54:36
发布于 2013-01-27 17:06:24
至少有两种方法:
我要覆盖CC,CXX,.标记在Makefile中。在R框架内,读取系统和可选用户配置文件,我只需设置
VER=4.7
CC=ccache gcc-$(VER)
CXX=ccache g++-$(VER)
SHLIB_CXXLD=g++-$(VER)
FC=ccache gfortran
F77=ccache gfortran这也允许我在gcc版本之间来回切换。现在,所有涉及R的编译都使用ccache。
(2)对于其他用途,我部署了一个事实,即/usr/local/bin/是在/usr/bin之前检查的。所以我们可以做
root@max:/usr/local/bin# ls -l gcc
lrwxrwxrwx 1 root root 15 Jan 27 11:04 gcc -> /usr/bin/ccache
root@max:/usr/local/bin# ./gcc --version
gcc (Ubuntu/Linaro 4.7.2-2ubuntu1) 4.7.2
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
root@max:/usr/local/bin# 现在,gcc通过ccache调用。
edd@max:/tmp$ cp -vax ~/src/progs/C/benfordsLaw.c .
`/home/edd/src/progs/C/benfordsLaw.c' -> `./benfordsLaw.c'
edd@max:/tmp$ time /usr/local/bin/gcc -c benfordsLaw.c
real 0m0.292s
user 0m0.052s
sys 0m0.012s
edd@max:/tmp$ time /usr/local/bin/gcc -c benfordsLaw.c
real 0m0.026s
user 0m0.004s
sys 0m0.000s
edd@max:/tmp$ https://stackoverflow.com/questions/13929514
复制相似问题