Include of wrong "math.h"

[ 4%] Building CXX object
lib/CMakeFiles/gnuradio-ra_blocks.dir/slicer_impl.cc.o
In file included from /usr/local/include/gnuradio/math.h:30:0,
from /usr/include/c++/4.6/cmath:46,
from /usr/include/c++/4.6/complex:46,
from /usr/local/include/gnuradio/gr_complex.h:26,
from /usr/local/include/gnuradio/gr_types.h:31,
from
/usr/local/include/gnuradio/gr_runtime_types.h:27,
from /usr/local/include/gnuradio/gr_io_signature.h:27,
from
/home/hugh/gr-ra_blocks/trunk/lib/slicer_impl.cc:25:
/usr/include/c++/4.6/cmath:99:11: error: ‘::acos’ has not been declared
/usr/include/c++/4.6/cmath:115:11: error: ‘::asin’ has not been declared
/usr/include/c++/4.6/cmath:131:11: error: ‘::atan’ has not been declared
/usr/include/c++/4.6/cmath:147:11: error: ‘::atan2’ has not been
declared
/usr/include/c++/4.6/cmath:166:11: error: ‘::ceil’ has not been declared
/usr/include/c++/4.6/cmath:182:11: error: ‘::cos’ has not been declared
/usr/include/c++/4.6/cmath:198:11: error: ‘::cosh’ has not been declared
/usr/include/c++/4.6/cmath:214:11: error: ‘::exp’ has not been declared
/usr/include/c++/4.6/cmath:230:11: error: ‘::fabs’ has not been declared
/usr/include/c++/4.6/cmath:246:11: error: ‘::floor’ has not been
declared
/usr/include/c++/4.6/cmath:262:11: error: ‘::fmod’ has not been declared
/usr/include/c++/4.6/cmath:272:11: error: ‘::frexp’ has not been
declared
/usr/include/c++/4.6/cmath:288:11: error: ‘::ldexp’ has not been
declared
/usr/include/c++/4.6/cmath:304:11: error: ‘::log’ has not been declared
/usr/include/c++/4.6/cmath:320:11: error: ‘::log10’ has not been
declared
/usr/include/c++/4.6/cmath:336:11: error: ‘::modf’ has not been declared
/usr/include/c++/4.6/cmath:346:11: error: ‘::pow’ has not been declared
/usr/include/c++/4.6/cmath:381:11: error: ‘::sin’ has not been declared
/usr/include/c++/4.6/cmath:397:11: error: ‘::sinh’ has not been declared
/usr/include/c++/4.6/cmath:413:11: error: ‘::sqrt’ has not been declared
/usr/include/c++/4.6/cmath:429:11: error: ‘::tan’ has not been declared
/usr/include/c++/4.6/cmath:445:11: error: ‘::tanh’ has not been declared
/usr/include/c++/4.6/cmath: In function ‘typename
__gnu_cxx::__enable_if<std::__is_arithmetic<_Tp>::__value, int>::__type
std::fpclassify(_Tp)’:
/usr/include/c++/4.6/cmath:737:35: error: ‘FP_NAN’ was not declared in
this scope
/usr/include/c++/4.6/cmath:737:43: error: ‘FP_INFINITE’ was not declared
in this scope
/usr/include/c++/4.6/cmath:737:56: error: ‘FP_NORMAL’ was not declared
in this scope
/usr/include/c++/4.6/cmath:738:7: error: ‘FP_SUBNORMAL’ was not declared
in this scope
/usr/include/c++/4.6/cmath:738:21: error: ‘FP_ZERO’ was not declared in
this scope
In file included from /usr/include/c++/4.6/cmath:46:0,
from /usr/include/c++/4.6/complex:46,
from /usr/local/include/gnuradio/gr_complex.h:26,
from /usr/local/include/gnuradio/gr_types.h:31,
from
/usr/local/include/gnuradio/gr_runtime_types.h:27,
from /usr/local/include/gnuradio/gr_io_signature.h:27,
from
/home/hugh/gr-ra_blocks/trunk/lib/slicer_impl.cc:25:
/usr/local/include/gnuradio/math.h: At global scope:
/usr/local/include/gnuradio/math.h:61:15: error: ‘gr::fast_atan2f’
declared as an ‘inline’ variable
/usr/local/include/gnuradio/math.h:61:15: error: ‘float gr::fast_atan2f’
redeclared as different kind of symbol
/usr/local/include/gnuradio/math.h:58:24: error: previous declaration of
‘float gr::fast_atan2f(float, float)’
/usr/local/include/gnuradio/math.h:61:15: error: ‘gr_complex’ was not
declared in this scope
/usr/local/include/gnuradio/math.h: In function ‘float
gr::branchless_clip(float, float)’:
/usr/local/include/gnuradio/math.h:70:28: error: ‘fabsf’ was not
declared in this scope
/usr/local/include/gnuradio/math.h: In function ‘unsigned int
gr::quad_0deg_slicer(float, float)’:
/usr/local/include/gnuradio/math.h:116:15: error: ‘fabsf’ was not
declared in this scope
/usr/local/include/gnuradio/math.h: At global scope:
/usr/local/include/gnuradio/math.h:133:21: error:
‘gr::quad_45deg_slicer’ declared as an ‘inline’ variable
/usr/local/include/gnuradio/math.h:133:21: error: ‘unsigned int
gr::quad_45deg_slicer’ redeclared as different kind of symbol
/usr/local/include/gnuradio/math.h:98:3: error: previous declaration of
‘unsigned int gr::quad_45deg_slicer(float, float)’
/usr/local/include/gnuradio/math.h:133:21: error: ‘gr_complex’ was not
declared in this scope
/usr/local/include/gnuradio/math.h:139:20: error: ‘gr::quad_0deg_slicer’
declared as an ‘inline’ variable
/usr/local/include/gnuradio/math.h:139:20: error: ‘unsigned int
gr::quad_0deg_slicer’ redeclared as different kind of symbol
/usr/local/include/gnuradio/math.h:113:3: error: previous declaration of
‘unsigned int gr::quad_0deg_slicer(float, float)’
/usr/local/include/gnuradio/math.h:139:20: error: ‘gr_complex’ was not
declared in this scope
/usr/local/include/gnuradio/math.h: In function ‘unsigned int
gr::branchless_quad_0deg_slicer(float, float)’:
/usr/local/include/gnuradio/math.h:155:20: error: ‘fabsf’ was not
declared in this scope
/usr/local/include/gnuradio/math.h: At global scope:
/usr/local/include/gnuradio/math.h:162:31: error:
‘gr::branchless_quad_0deg_slicer’ declared as an ‘inline’ variable
/usr/local/include/gnuradio/math.h:162:31: error: ‘unsigned int
gr::branchless_quad_0deg_slicer’ redeclared as different kind of symbol
/usr/local/include/gnuradio/math.h:152:3: error: previous declaration of
‘unsigned int gr::branchless_quad_0deg_slicer(float, float)’
/usr/local/include/gnuradio/math.h:162:31: error: ‘gr_complex’ was not
declared in this scope
/usr/local/include/gnuradio/math.h:176:32: error:
‘gr::branchless_quad_45deg_slicer’ declared as an ‘inline’ variable
/usr/local/include/gnuradio/math.h:176:32: error: ‘unsigned int
gr::branchless_quad_45deg_slicer’ redeclared as different kind of symbol
/usr/local/include/gnuradio/math.h:168:3: error: previous declaration of
‘unsigned int gr::branchless_quad_45deg_slicer(float, float)’
/usr/local/include/gnuradio/math.h:176:32: error: ‘gr_complex’ was not
declared in this scope
make[2]: *** [lib/CMakeFiles/gnuradio-ra_blocks.dir/slicer_impl.cc.o]
Error 1
make[1]: *** [lib/CMakeFiles/gnuradio-ra_blocks.dir/all] Error 2
make: *** [all] Error 2

My buddy just tried to compile a OOT module against the latest “maint”
of Gnu Radio, and got treated to the above explosion. It looks like
the C compiler is confusing the version of math.h in the Gnu Radio
codebase with the libc version, and then things go all explody.

He’s running on an x86_64 Ubuntu 12.04 system.

The OOT module was produced using “gr-modtool” just a couple of weeks
ago.


Marcus L.
Principal Investigator
Shirleys Bay Radio Astronomy Consortium

On 07/01/2013 02:08 PM, Marcus D. Leech wrote:

My buddy just tried to compile a OOT module against the latest “maint”
of Gnu Radio, and got treated to the above explosion. It looks like
the C compiler is confusing the version of math.h in the Gnu Radio
codebase with the libc version, and then things go all explody.

So, two things are happening here. One is, that we just unofficially
released 3.7.0, but haven’t announced it (still compiling the release
notes), so the repository ‘maint’ branch is now 3.7.0-based.

Secondly, with, 3.7.0, $PREFIX/include/gnuradio should not be in the
include search path, like it needed to be in 3.6.5. So I’m guessing
that the OOT module was either not written for 3.7.0, or should actually
be compiling against the stable 3.6.5.1 version. You can checkout tag
v3.6.5.1 to get that.

include search path, like it needed to be in 3.6.5. So I’m guessing
that the OOT module was either not written for 3.7.0, or should actually
be compiling against the stable 3.6.5.1 version. You can checkout tag
v3.6.5.1 to get that.

Yeah, I just figured out that was what was happening.

I’ll try the

v3.6.5.1

Tag, and then update build-gnuradio to match.


Marcus L.
Principal Investigator
Shirleys Bay Radio Astronomy Consortium