CMBEASY and gcc-3.4: compiler can't find Spline::operator()(double)

Use of Healpix, camb, CLASS, cosmomc, compilers, etc.
Post Reply
Alex Conley
Posts: 11
Joined: February 08 2005

CMBEASY and gcc-3.4: compiler can''t find Spline::operator()

Post by Alex Conley » June 29 2005

There is a bug in gcc which prevents CMBEASY from compiling correctly
using gcc-3.4. It is related to the unit-at-a-time optimization which was
added in this version of gcc. This appears to have been fixed in some later
versions of gcc. This optimization is turned on whenever -O2 or -O3
are set -- which is done by the default Makefile.

The symptom of the problem is that the compiler can't find inlined
functions, so you get error messages which complain about not
being able to find (for example) Spline::operator()(double).

The simplest solution is to modify the line
OPTIMIZE = -O2
in the Makefile to read
OPTIMIZE = -O2 -fno-unit-at-a-time
and then these problems go away.

Post Reply