You are not logged in.

#1 2006-03-25 09:09:09

EAD
Member
Registered: 2006-03-11
Posts: 255

a question about ccache

Hii, I am using ccache and not sure its working right.
If i add a symbolic link from /bin/gcc to /usr/bin/ccache.
and then run gcc then it works?
I get the reguler gcc "gcc: no input files", but how do I know if ccache is on?
:?:

Offline

#2 2006-03-25 09:10:46

vacant
Member
From: downstairs
Registered: 2004-11-05
Posts: 816

Re: a question about ccache

compile something new and then look for newly created files in the cache?

Offline

#3 2006-03-25 09:46:02

_Gandalf_
Member
Registered: 2006-01-12
Posts: 735

Re: a question about ccache

You should NOT symlink ccache to gcc!! you should instead use envirement variable

export CC="ccache gcc"
export CPP="ccache cpp"
export CXX="ccache g++"

Offline

#4 2006-03-25 10:02:54

EAD
Member
Registered: 2006-03-11
Posts: 255

Re: a question about ccache

Why not doing a symbol link?
Can you please explain me?
in there site it is written like this

Offline

#5 2006-03-25 10:09:08

MAC!EK
Member
Registered: 2005-09-27
Posts: 267

Re: a question about ccache

But it's written in Wiki to set a variable smile

Offline

#6 2006-03-25 10:13:52

iphitus
Forum Fellow
From: Melbourne, Australia
Registered: 2004-10-09
Posts: 4,927

Re: a question about ccache

afaik, makepkg will automatically use it, whether or not you have those variables set.

iphitus

Offline

#7 2006-03-25 10:29:23

_Gandalf_
Member
Registered: 2006-01-12
Posts: 735

Re: a question about ccache

@iphitus no that's not true, to make makepkg use it, u must add those to /etc/makepkg.conf, this is confirmed because once i had troubles compiling a package (don't recall it) and ccache was the problem i just removed those lines and ran makepkg again

Offline

#8 2006-03-25 11:04:05

iphitus
Forum Fellow
From: Melbourne, Australia
Registered: 2004-10-09
Posts: 4,927

Re: a question about ccache

_Gandalf_; makepkg definitely uses ccache when it's installed.

theres no way under the sun my computer can compile an entire kernel in ~5 minutes. In the meantime too, ~/.ccache is filling up with files from all my makepkg's. At the same time, there is no reference to it in makepkg.conf.

in /usr/bin/makepkg:

if [ "$NOCCACHE" = "0" ]; then
    [ -d /usr/lib/ccache/bin ] && export PATH=/usr/lib/ccache/bin:$PATH
fi

and NOCCACHE=0 is the default. It isnt mentioned in makepkg.conf.

So yeah, makepkg is definitely using ccache.

iphitus

Offline

#9 2006-03-25 14:02:36

_Gandalf_
Member
Registered: 2006-01-12
Posts: 735

Re: a question about ccache

iphitus, hmmm that's odd, coz i can export manuall CC to gcc and i see "gcc etc...". and i can export "CC=ccahe gcc" and then i can see "ccache gcc etc..." while makepkg is compiling, what u said above is just adding ccache bin dir to PATH but it's not exporting CC envirement variables therefore ccache is not used.... I'm not sure if what am saying is true or false but i know for sure that sometimes compilation fails i just turn off ccache and it works..

P.S: http://wiki.archlinux.org/index.php/Fas … th_makepkg

Offline

#10 2006-03-25 15:04:22

iphitus
Forum Fellow
From: Melbourne, Australia
Registered: 2004-10-09
Posts: 4,927

Re: a question about ccache

that wiki page applies to compiling anything. when using makepkg, you dont need to do that.

ccache is DEFINITELY used by makepkg, when it is installed. ask tpowa or neotuli.

trust me, theres no other way tpowa and my kernel compile times went down from 30 minutes to ~5.

iphitus

Offline

#11 2006-07-04 08:30:20

user
Member
Registered: 2006-03-29
Posts: 465

Re: a question about ccache

Does this work?

in .bashrc

alias gcc='ccache gcc'
alias cpp='ccache cpp'
alias g++='ccache g++'

I removed my sig, cause i select the flag, the flag often the target of enemy.

SAR brain-tumor
[img]http://img91.imageshack.us/img91/460/cellphonethumb0ff.jpg[/img]

Offline

#12 2006-07-04 08:49:13

MAC!EK
Member
Registered: 2005-09-27
Posts: 267

Re: a question about ccache

not every Makefile uses GCC,CPP,G++ variables, so this unstandard Makefiles won't use ccache.

Offline

Board footer

Powered by FluxBB