4

I'm trying to build with clang + icecc + ccache. But I can't get it to work. I successfully build with gcc + icecc + ccache on the same network.

Here are the softs versions :

Clang version  : Ubuntu clang version 3.2-9 (tags/RELEASE_32/final) (based on LLVM 3.2) 
ccache version : 3.1.7
icecc version  : ICECC 0.9.7

I have in /usr/lib/ccache the clang sym links :

$ ls -l /usr/lib/ccache/clang*
/usr/lib/ccache/clang -> ../../bin/ccache*
/usr/lib/ccache/clang++ -> ../../bin/ccache*

I have in /usr/lib/icecc/bin the clang sym links :

$ ls -l /usr/lib/icecc/bin/clang*
/usr/lib/icecc/bin/clang -> ../../../bin/icecc*
/usr/lib/icecc/bin/clang++ -> ../../../bin/icecc*

So here is what I have tried :

I've tried having ccache as first in my PATH env var :

export PATH=/usr/lib/ccache:/usr/lib/icecc/bin/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

but it just doesn't distribute the compilation.

I've tried having icecc as first :

export PATH=/usr/lib/icecc/bin/:/usr/lib/ccache:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

and it gives me this output:

ICECC[5240] 14:27:17: icecream seems to have invoked itself recursively!

according to this thread https://bugzilla.redhat.com/show_bug.cgi?id=377761 it's normal.

I've tried having icecc only :

export PATH=/usr/lib/icecc/bin/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

but it just doesn't distribute the compilation.

So I'm kind of stuck here, and I can't find anything saying it's impossible, so if anyone have a solution, or a replacement solution (something different than icecc).

Thanks.

b3nj1
  • 667
  • 1
  • 6
  • 17

1 Answers1

4

To use ccache together with another compiler wrapper, set CCACHE_PREFIX to the other wrapper. In your case:

export PATH=/usr/lib/ccache:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
export CCACHE_PREFIX=icecc

This is better for several reasons:

  • It actually works.
  • Compiler upgrades will be detected properly.
  • The cached results will be shared between compilations with and without the icecc.
  • ccache will not needlessly invoke icecc when running the preprocessor.

Read more in the Using ccache with other compiler wrappers section in the ccache manual.

Joel Rosdahl
  • 846
  • 9
  • 12
  • Are you saying that the path to `icecc` should *not* be in the PATH variable?! – piwi Jul 05 '13 at 06:31
  • `/usr/lib/icecc/bin` should not be in PATH. But `/usr/bin` (or wherever the real `icecc` binary is stored) should be in PATH so that `ccache` can find the `icecc` binary. – Joel Rosdahl Jul 18 '19 at 18:23