Bug 7659 - building nel from the ryzom project on x86_64 with ccache results in preprocessor errors
Summary: building nel from the ryzom project on x86_64 with ccache results in preproce...
Status: CLOSED FIXED
Alias: None
Product: ccache
Classification: Unclassified
Component: ccache (show other bugs)
Version: 3.0.1
Hardware: Other Linux
: P3 normal
Target Milestone: 3.1
Assignee: Joel Rosdahl
QA Contact: Joel Rosdahl
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-02 05:47 UTC by Rudolf Kastl
Modified: 2010-09-16 12:42 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rudolf Kastl 2010-09-02 05:47:53 UTC
building nel from the ryzom project on x86_64 with ccache results in lots of  preprocessor errors.
you can checkout the sourcecode here:
http://dev.ryzom.com/wiki/ryzom/Getting_Source

the testbuild was done on fedora15/rawhide.
Comment 1 Joel Rosdahl 2010-09-06 12:12:09 UTC
Thanks for the bug report!

You get preprocessor errors because precompiled headers are being used, and ccache 3.0.1 doesn't support that (see "preprocessor error" on http://ccache.samba.org/manual.html#_performance). However, support for precompiled headers has been implemented in the development version of ccache and will be part of ccache 3.1. If you're interested, you are very welcome to try it out! Download instructions are here: http://ccache.samba.org/repo.html. Note that you will have to set CCACHE_SLOPPINESS=time_macros (or even better: time_macros,include_file_mtime) to make ccache work properly with PCH; this is described in the manual.

By the way, here are some results from building nel with/without PCH and with/without ccache (current dev version) on my machine (serial build):

With PCH, without ccache: 641 seconds
With PCH, with ccache, first time: 700 seconds
With PCH, with ccache, second time: 68 seconds

Without PCH, without ccache: 817 seconds
Without PCH, with ccache, first time: 851 seconds
Without PCH, with ccache, second time: 23 seconds

(All figures are with a warm disk cache.)

As you see, there's a trade-off between having faster first-time compilations (enable PCH) or faster recompilations (don't enable PCH). The reason why "with ccache, second time" is slower with PCH than without is that ccache has to hash the .gch file (which typically is very large) for each compilation.