LinuxSir.cn,穿越时空的Linuxsir!

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

How to speed up make world on FreeBSD

[复制链接]
发表于 2004-7-6 07:59:52 | 显示全部楼层 |阅读模式
发表于 2004-7-6 09:23:44 | 显示全部楼层
我给贴过来吧, 免得大家跑来跑去的 :p


Submitted by Landon C. Evans (Serberus)
May 14, 2001

Speeding up `make world`

Seeing that /usr/src is ~ 280 MB its safe to assume you need at least that much RAM as well to have a functional MFS.

Step 1.
After grabbing your new source via cvsup you can drop down into single user mode.

Step 2.
# fsck -p
# mount -u /
# mount -a -t -ufs
# swapon -a

Step 3.
# mount_mfs -s 614400 /dev/ad0s1b /usr/obj

This command is doing the following:
mount_mfs is the program to essentially mount a MFS to a path. The -s flag is is for the size of your MFS. I usually use this simple math equation to caculate my size: (amount of memory you want to use) * 1024*2 (614400 == 300mb). Then you want to specify what swap device you want to use, in my case its /dev/ad0s1b. Then set your mount point which will be /usr/obj.

Step 4.
# cd /usr/src
# time make world

Watch this baby fly now. To give you a idea how fast it really is, I have a PIII 733mhz with 512mb pc133 SDRAM with a 7200RPM UTA66 Seagate, and I would usually have make worlds run at least 1 hr 30 minutes. Now under a MFS, it runs at a flat 30 minutes. A MFS is also good for other things other than speeding up make world. You can setup a MFS for /tmp so things like X can access them quickly, and when you reboot, it's all gone so you have a clean /tmp directory.

AGAIN, use at your own risk.

Submitted By BSDVault member Serberus
发表于 2004-7-6 09:24:28 | 显示全部楼层
感谢 qing 兄给大家找来了不少好东西. :thank
发表于 2004-7-6 17:25:04 | 显示全部楼层
要300M+的内存支持啊,也就是服务器可以这样了。不过服务器有整天没事make world的吗
发表于 2004-8-4 08:40:29 | 显示全部楼层
ccache 可以为编译提供缓存,可以减少重复代码编译次数,加快编译时间

su
cd /usr/ports/devel/ccache/
make install clean
cd /usr/
mkdir ccache
cd /usr/sbin
ln -s /usr/local/bin/ccache gcc
ln -s /usr/local/bin/ccache cc
ln -s /usr/local/bin/ccache c++
ln -s /usr/local/bin/ccache g++
ln -s /usr/local/bin/ccache cpp
echo "setenv CCACHE_DIR /usr/ccache" >> /root/.cshrc
rehash
exit
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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