Source Repository:Repository:Gentoo Portage Tree

Summary: CCACHE is an application that caches compilation results and reuses it in future compilations in order to achieve faster compile times.



New Ports-2017 tree and Kits

Funtoo has a new ports-2017 tree, and introducing kits! (BETA)
2017-03-27 by Drobbins

Xorg and other Updates

Xorg and other Updates
2017-02-05 by Oleg

Kde4 to Plasma5 migration

Migration to Plasma 5
2017-02-02 by Oleg



We welcome improvements to this page. To edit this page, Create a Funtoo account. Then log in and then click here to edit this page. See our editing guidelines to becoming a wiki-editing pro.


CCACHE can cause build failures. If it does, please try to compile the application without CCACHE enabled. Bug reports reported with CCACHE enabled will be closed.

Installing CCACHE

To emerge Package:CCache, run the following:

# emerge ccache

Once it finishes emerging, enable it in portage. This is very easy. Just open up /etc/portage/make.conf with your favorite text editor and add the following:

/etc/portage/make.conf (bash source code)

That's it. If you want to check how much space the cache is taking up on your disk and other info about the cache, run the following command:

# CCACHE_DIR="/var/tmp/ccache" ccache -s
You must pass the CCACHE_DIR option since ccache normally defaults to the user's home directory, and portage uses /var/tmp/ccache.

Tweaking CCACHE

Disabling the CACHE limit

If you want to let the cache have the flexibility to grow to whatever size it needs to (unlimited size cache), just do the following:

# CCACHE_DIR="/var/tmp/ccache" ccache -M 0


Using CCACHE to compile your kernel faster

In order to use CCACHE to compule your kernel more quickly, you need to change a few variables. You probably only want to change these variables temporarily, but you could change them permanently if you want to. Since we just want to do this temporarily, make a new file called and put the following inside of it: (bash source code)
export CCACHE_DIR="/var/tmp/ccache"
export PATH="/usr/lib/ccache/bin:${PATH}"
cd /usr/src/linux
time make bzImage modules

Give the file execute permission:

$ chmod u+x

This will temporarily export the variables neccessary, then go into the /usr/src/linux folder (whatever you declared with 'eselect kernel') and then compile the kernel.