LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1541|回复: 13

如何用ccache,大家谁有体验过?

[复制链接]
发表于 2006-1-14 01:50:47 | 显示全部楼层 |阅读模式
m听说能节省编译时间,不知哪位大虾用过?
告诉我怎么用。
效果如何?
我的机器是dell latitude c400。半个月了。我还没安装成功。
不知道是不是我太笨!(^-^)
我的要求是:能进入gnome,加xmms(能放mp3+wma),xpdf,最好来个英汉字典。
谢谢了!哪位高手指点一下USE该怎么改
dell latitude c400
pIII-866-m
256M SDRAM
20G HDD
i830MG 显卡
PCMCIA
发表于 2006-1-14 03:21:55 | 显示全部楼层
ccache还可以配合distcc一起使用的

http://www-900.ibm.com/developerworks/cn/linux/l-ccache.shtml
回复 支持 反对

使用道具 举报

发表于 2006-1-14 04:11:45 | 显示全部楼层
首先安裝ccache
# emerge ccache
然後加入/etc/make.conf的features裡:
...
FEATURES="ccache"
並按自己的情況設好ccache大小
CCACHE_SIZE="2G"
就這麼簡單!
回复 支持 反对

使用道具 举报

发表于 2006-1-14 05:42:39 | 显示全部楼层
说实话,这个东西没什么大用,弄不好反而会降低编译速度。

我觉得ccache是给开发者用的,它把编译的结果保存起来,如果下次编译同一个文件,会比较快。但是通常我们只需要编译一次,所以也没什么效果,反而要花时间去保存和比较编译结果。
回复 支持 反对

使用道具 举报

发表于 2006-1-14 07:28:44 | 显示全部楼层
有道理,多找几台机器用distcc更好
回复 支持 反对

使用道具 举报

发表于 2006-1-14 07:32:10 | 显示全部楼层
我按照这个来的,也没有成功。。。。
       INSTALLATION
       There  are  two  ways to use ccache. You can either prefix your compile
       commands with "ccache" or you can create a symbolic link between ccache
       and the names of your compilers. The first method is most convenient if
       you just want to try out ccache or wish to use  it  for  some  specific
projects.  The  second  method  is most useful for when you wish to use
       ccache for all your compiles.

       To install for usage by the first method just copy ccache to  somewhere
       in your path.

       To install for the second method do something like this:



         cp ccache /usr/local/bin/
         ln -s /usr/local/bin/ccache /usr/local/bin/gcc
         ln -s /usr/local/bin/ccache /usr/local/bin/g++
         ln -s /usr/local/bin/ccache /usr/local/bin/cc



       This  will  work as long as /usr/local/bin comes before the path to gcc
       (which is usually in /usr/bin). After installing you may  wish  to  run
       "which gcc" to make sure that the correct link is being used.

       Note!  Do  not  use  a  hard link, use a symbolic link. A hardlink will
       cause "interesting" problems.
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-1-14 10:07:25 | 显示全部楼层
关于distcc,我能找到的都是windows的(可以进入liveCD,不知道windows下可有distccd可用)硬盘不可以格式化,也许能mount -t vfat,比我笔记本先进一代以上。这样也可以吗?我先去看看文档。

关于USE,哪位大侠帮一把吧?小弟真的小菜一个。
gnome,加xmms(能放mp3+wma),xpdf,firefox,紫光拼音
回复 支持 反对

使用道具 举报

发表于 2006-1-14 10:46:59 | 显示全部楼层
Then you may consider to download a distcc LiveCD which is available from its website.
回复 支持 反对

使用道具 举报

发表于 2006-1-14 12:34:31 | 显示全部楼层
Post by d00m3d
有道理,多找几台机器用distcc更好


这是distcc截图。。

ccache一定有要硬盘速度足够快,缓存够大,才能体现出优势。否则ccache就变编译的瓶颈。

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x
回复 支持 反对

使用道具 举报

发表于 2006-1-14 14:33:24 | 显示全部楼层
Post by Amorous
我按照这个来的,也没有成功。。。。
       INSTALLATION

       cause "interesting" problems.

有官方文档啊,还是中文的。
http://www.gentoo.org/doc/zh_tw/ ... l?part=2&chap=3
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表