ccache in CI
#21
I tested switching from clang to gcc with ccache. That seemed to fix the issue I was having, and now compilations are ~3x faster for a regular build and ~5x faster for a straight rebuild.

I'm going to test with just the linux x86 and 64 build on ccache for now, to see if any problems come up. If they don't then I'll roll it out to all of the other builds also.
Reply
Thanks given by:
#22
You could try using the symlink method to fix the clang issue. It is described in the manual. The idea is to masquadate ccache as the compiler binary using symlinks. In Debian the symlinks are prepared in advance and this it's as simple as running `export PATH=/usr/lib/ccache/:$PATH` before running cmake.
Reply
Thanks given by:
#23
Only problem: /usr/lib/ccache/clang doesn't exist, so that method couldn't work.
Reply
Thanks given by:
#24
(02-07-2016, 02:56 AM)bearbin Wrote: Only problem: /usr/lib/ccache/clang doesn't exist, so that method couldn't work.

Just symlink to clang.

cd /usr/lib/ccache/ && ln -s /usr/bin/clang .
Reply
Thanks given by:
#25
How would that help? It's not a "magic directory", so what would that command actually do?
Reply
Thanks given by:
#26
(02-07-2016, 07:49 PM)bearbin Wrote: How would that help? It's not a "magic directory", so what would that command actually do?

It makes ccache masquerade as the compiler. So now when cmake calls "clang", it actually just calls a symlink to ccache. ccache then detects that it's being invoked via a symlink called "clang", so it passes all compilation arguments that it receives to /bin/clang.

Yes, /usr/lib/ccache is not magic, you could have done this with any directory. It happens to be the default masqueradation directory in Debian.

See the first run mode in the manual for more info.
Reply
Thanks given by:
#27
I think you may have mistyped your command. Did you mean:

cd /usr/lib/ccache/ && ln -s /usr/bin/ccache clang
Reply
Thanks given by:
#28
(02-08-2016, 03:05 AM)bearbin Wrote: I think you may have mistyped your command. Did you mean:

cd /usr/lib/ccache/ && ln -s /usr/bin/ccache clang

Yes. Sorry.
Reply
Thanks given by:
#29
Using the symlink method allows clang to operate well.

The builds appear to be stable, and I'm going to try to roll out ccache to the other ones if I can.
Reply
Thanks given by:
#30
Great!
Consider enabling the hard_link (CCACHE_HARDLINK) option, it will save some disk writing,

"If true, ccache will attempt to use hard links from the cache directory when creating the compiler output rather than using a file copy. Using hard links may be slightly faster in some situations, but can confuse programs like “make” that rely on modification times. Another thing to keep in mind is that if the resulting object file is modified in any way, this corrupts the cached object file as well. Hard links are never made for compressed cache files. This means that you should not enable compression if you want to use hard links. The default is false. "
Reply
Thanks given by:




Users browsing this thread: 15 Guest(s)