Page 1 of 1

CCache fortwährend Kompilierungsfehler!

Posted: 2015-02-24 22:38
by Proteus
Also irgendwie bekomme ich`s wieder nicht hin! Ich wollte mal ccache testen und es heißt es könnte das kompilieren um einiges beschleunigen. Ich bekomme komischerweise wenn ich ein Programm aus den Port per "make" installieren will Abbrüche noch und nöcher.

Ich installiere so:

Code: Select all

cd /usr/ports/devel/ccache && make install clean

cat >> /root/.cshrc << "EOF"
setenv PATH %%PREFIX%%/%%CCLINKDIR%%:$PATH
setenv CCACHE_PATH /usr/bin:%%LOCALBASE%%/bin
setenv CCACHE_DIR /tmp/ccache
setenv CCACHE_LOGFILE /var/log/ccache.log
if ( -x /usr/local/bin/ccache ) then
	/usr/local/bin/ccache -M 1024m > /dev/null
endif
"EOF"

cat >> /etc/make.conf << "EOF"
.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
Laufen tuts:

Code: Select all

[root@f329:~] # ccache -s
cache directory                     /tmp/ccache
primary config                      /tmp/ccache/ccache.conf
secondary config      (readonly)    /usr/local/etc/ccache.conf
cache hit (direct)                     0
cache hit (preprocessed)               0
cache miss                             0
files in cache                         0
cache size                           0.0 kB
max cache size                       1.0 GB
Und entleeren lässt sich das ganze mit -c -C auch.

Re: CCache fortwährend Kompilierungsfehler!

Posted: 2015-02-24 22:39
by Proteus
Okay ich denke ich habe es hinbekommen.

Code: Select all

vi /etc/make.conf

.if (!empty(.CURDIR:M/usr/src*) || !empty(.CURDIR:M/usr/obj*))
	.if !defined(NOCCACHE)
		CC:=${CC:C,^cc,%%PREFIX%%/%%CCLINKDIR%%/world/cc,1}
		CXX:=${CXX:C,^c\+\+,%%PREFIX%%/%%CCLINKDIR%%/world/c++,1}
	.endif
.endif

vi /root/.cshrc

setenv PATH %%PREFIX%%/%%CCLINKDIR%%:$PATH
setenv CCACHE_PATH /usr/bin:%%LOCALBASE%%/bin
setenv CCACHE_DIR /tmp/ccache
setenv CCACHE_LOGFILE /var/log/ccache.log
if ( -x /usr/local/bin/ccache ) then
	/usr/local/bin/ccache -M 1024M > /dev/null
endif
Nun huscht er durch, ohne Fehler.