CCache

Revision as of 13:15, June 24, 2014 by Duncan.britton (Talk | contribs)

dev-util/ccache


Source 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.


News

Drobbins

RSS/Atom Support

You can now follow this news feed at http://www.funtoo.org/news/atom.xml .
10 February 2015 by Drobbins
Drobbins

Creating a Friendly Funtoo Culture

This news item details some recent steps that have been taken to help ensure that Funtoo is a friendly and welcoming place for our users.
2 February 2015 by Drobbins
Mgorny

CPU FLAGS X86

CPU_FLAGS_X86 are being introduced to group together USE flags managing CPU instruction sets.
31 January 2015 by Mgorny
View More News...

CCache

Tip

This is a wiki page. To edit it, 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.

Note
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 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:

FEATURES="ccache"

That's it. If you want to check how much the cache is taking up on your disk and other info, you can 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

This will let the cache grow to whatever size it needs to grow to over time.

Tricks

Using CCACHE to compile your kernel faster

In order to do this 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 for this example, make a new file called build.sh and put the following inside of it:

#!/bin/bash

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 build.sh

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.