Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I enable _GLIBCXX_USE_C99 on Solaris 8 SPARC?

I've built gcc 4.6.1 for Solaris 8 sparc. I'm compiling some code that uses boost::lexical_cast (boost 1.48) and I get this error:

boost/math/special_functions/sign.hpp: In function 'int boost::math::detail::signbit_impl(T, const boost::math::detail::native_tag&)'
      error: 'signbit' is not a member of 'std'

(Also similar errors for fpclassify, isfinite, isnormal, isinf, isnan)

I looked at the cmath header and it defines std::signbit conditionally depending on whether _GLIBCXX_USE_C99_MATH is defined. I ran cpp -dM and I see that _GLIBCXX_USE_C99_MATH is not defined. Is there a way to enable the C99 support? Do I have to rebuild libc or is this platform just too old? I'm out of my element so any guidance on getting this working would be great.

like image 750
Skrymsli Avatar asked Nov 05 '22 00:11

Skrymsli


1 Answers

Your platform C library is likely too old to support the C99 FP library additions.

From the Sun Studio 12 User's Guide:

Note - Though the compiler defaults to supporting the features of C99 listed below, standard headers provided by the Solaris software in /usr/include do not yet conform with the 1999 ISO/IEC C standard. If error messages are encountered, try using -xc99=none to obtain the 1990 ISO/IEC C standard behavior for these headers.

like image 52
LThode Avatar answered Nov 09 '22 08:11

LThode