Android分布式编译学习(二)使用ccache 提高编译效率 —— Ubuntu12.04上部署distcc分布式编译

时间:2022-08-31 08:55:10

http://blog.csdn.net/eqiang8271/article/details/17144411

上接 Android分布式编译学习(一)—— Ubuntu12.04上部署distcc分布式编译,我们已经部署了distcc 3台PC进行编译。


二,   介绍 Setting up ccache

google 有介绍:

http://source.android.com/source/initializing.html#setting-up-ccache 

You can optionally tell the build to use the ccache compilation tool.Ccache acts as a compiler cache that can be used to speed-up rebuilds.This works very well if you do "make clean" often, or if you frequentlyswitch between different build products.

Put the following in your .bashrc or equivalent.

export USE_CCACHE=1

By default the cache will be stored in ~/.ccache.If your home directory is on NFS or some other non-local filesystem,you will want to specify the directory in your .bashrc as well.

export CCACHE_DIR=<path-to-your-cache-directory>

The suggested cache size is 50-100GB.You will need to run the following command once you have downloadedthe source code:

prebuilts/misc/linux-x86/ccache/ccache -M 50G


When building Ice Cream Sandwich (4.0.x) or older, ccache is ina different location:

prebuilt/linux-x86/ccache/ccache -M 50G


This setting is stored in the CCACHE_DIR and is persistent.

设置完,接口进行build 来比较了,看看效率提高了多少。