Changes between Version 1 and Version 2 of howto/ccache


Ignore:
Timestamp:
Feb 16, 2008, 2:57:04 AM (16 years ago)
Author:
raimue (Rainer Müller)
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • howto/ccache

    v1 v2  
    88This HOWTO covers how to enable building with [http://ccache.samba.org ccache]. It is a compiler cache. It uses the gcc -E switch and a hash to detect when a compilation can be satisfied from cache. The effect is that packages frequently compile 5-10 times faster than they would otherwise.
    99
    10 == Installation and Configuration ==
     10== Installation ==
    1111
    12   1. '''Install ccache'''
     12=== Step 1: '''Install ccache''' ===
    1313   
    14     {{{
     14{{{
    1515$ sudo port install ccache
    16     }}}
     16}}}
    1717
    18   1. '''Edit macports.conf'''
     18=== Step 2: '''Edit macports.conf''' ===
    1919 
    20   Open `/opt/local/etc/macports/macports.conf` in your favorite editor. Find the line
    21    {{{
     20Open `/opt/local/etc/macports/macports.conf` in your favorite editor. Find the line
     21{{{
    2222configureccache     no
    23     }}}
    24   and change it to
    25     {{{
     23}}}
     24and change it to
     25{{{
    2626configureccache     yes
    27     }}}
     27}}}
    2828
    2929And you are done. From now on, MacPorts will use ccache for building.
    3030
     31== Configuration ==
     32
    3133Please note that cache files are stored in .ccache in your home directory. To see some statistics how useful ccache is for you and how many disk space it takes, use
    3234{{{
    33 ccache -s
     35$ ccache -s
    3436}}}
    3537
    3638If you believe ccache takes up to much disk space for you, there is the possibility to set a maximum by using something like
    3739{{{
    38 ccache -M 2G
     40$ ccache -M 2G
    3941}}}
    4042This makes ccache occupy a maximum of 2 GiB disk space to store cached files.
    4143
    42 If you want to free some space, do a cleanup
     44If you want to free some space, do a cleanup with
    4345{{{
    44 ccache -c
     46$ ccache -c
    4547}}}
    4648
    4749== Optional Parts ==
    48   * '''Use ccache outside MacPorts'''
    49     To use ccache also outside MacPorts you have to edit your PATH which is set in your `.profile` or `.bash_profile`.
    50     First, locate the file you are using. If there is a ''.bash_profile'' edit this file, if there is only ''.profile'' you want to edit this.
     50
     51=== '''Use ccache outside MacPorts''' ===
     52
     53To use ccache also outside MacPorts you have to edit your PATH which is set in your `.profile` or `.bash_profile`.
     54
     55First, locate the file you are using. If there is a `.bash_profile` edit this file, if there is only `.profile` you want to edit this.
    5156   
    52   There will be this line in there:
    53     {{{
     57There will be this line in there:
     58{{{
    5459export PATH=/opt/local/bin:/opt/local/sbin:$PATH
    55     }}}
    56   Now add the ccache binary path `/opt/local/ccache/bin` in front of already existing paths:
    57     {{{
     60}}}
     61
     62Now add the ccache binary path `/opt/local/ccache/bin` in front of already existing paths:
     63{{{
    5864export PATH=/opt/local/ccache/bin:/opt/local/bin:/opt/local/sbin:$PATH
    59     }}}
    60   '''Important:''' Reopen your Terminal.
    61   [[BR]]
    62   If you now use commands like ''gcc'' they automatically go through ccache.
     65}}}
     66
     67'''Important:''' Reopen your Terminal afterwards.
     68
     69If you now use commands like ''gcc'' they automatically go through ccache.