ccache help?

I read on Google about a package named ccache which is on ports and make compile faster. Use some kind of space (on disk I guess) and save compilation to do it faster next time? What exactly is that and how to setup it? Searching on forum, I read about some problems with ccache on and compiling / rebuilding world errors. Is dangerous? Try it?
 
add the following to /.cshrc:
Code:
Code:
# set ccache varibles
setenv PATH /usr/local/libexec/ccache:$PATH
setenv CCACHE_PATH /usr/bin:/usr/local/bin
setenv CCACHE_DIR /var/tmp/ccache
setenv CCACHE_LOGFILE /var/log/ccache.log

# set ccache temp size to 512MB (default 1GB)
if ( -x /usr/local/bin/ccache ) then
  /usr/local/bin/ccache -M 512m > /dev/null
endif
If I use bash?
 
Code:
# set ccache temp size to 4G (default 1GB)
if [ -x /usr/local/bin/ccache ]; then
  export PATH=/usr/local/libexec/ccache:$PATH
  export CCACHE_PATH=/usr/bin:/usr/local/bin
  export CCACHE_DIR=/var/ccache
  /usr/local/bin/ccache -M 4g > /dev/null
fi
 
My /etc/make.conf
Code:
.if !defined(NO_CCACHE)
  CC=/usr/local/libexec/ccache/world-cc
  CXX=/usr/local/libexec/ccache/world-c++
.endif

.if ${.CURDIR:M*/ports/devel/ccache}
  NO_CCACHE=yes
.endif

My .bashrc
Code:
# set ccache temp size to 4G (default 1GB)
if [ -x /usr/local/bin/ccache ]; then
  export PATH=/usr/local/libexec/ccache:$PATH
  export CCACHE_PATH=/usr/bin:/usr/local/bin
  export CCACHE_DIR=/var/ccache
  /usr/local/bin/ccache -M 5g > /dev/null
fi

but ccache -s
Code:
cache                 directory                     /var/ccache
cache hit (direct)                     0
cache hit (preprocessed)               0
cache miss                             0
files in cache                         0
cache size                             0 Kbytes
max cache size                       1.0 Gbytes
 
Learn how to use sudo(8) properly:

/usr/local/etc/sudoers
Code:
Defaults        env_keep += "PKG_PATH PKG_DBDIR PKG_TMPDIR TMPDIR PACKAGEROOT PACKAGESITE PKGDIR FTP_PASSIVE_MODE"
Defaults        env_keep += "PATH CCACHE_PATH CCACHE_DIR"

... or use it as root:
Code:
# su -
# source /home/YOU/.bashrc
# ccache -s
 
Back
Top