Boost logo

Boost :

Subject: [boost] fixing the compilation of the math lib on HPUX
From: Frank Meerkötter (meerkoetter_at_[hidden])
Date: 2010-04-26 14:17:35


Hello,

I am currently trying to build boost with the HP aCC (aCC: HP C/aC++
B3910B A.06.12 [Nov 03 2006]). The build fails for the tr1 math lib.

[...]
acc.compile.c++ bin.v2/libs/math/build/acc/release/threading-multi/copysign.o
"libs/math/build/../src/tr1/copysign.cpp", line 16: error #2247:
function "copysign(double, double) C" has already been defined
  extern "C" double BOOST_MATH_TR1_DECL copysign
BOOST_PREVENT_MACRO_SUBSTITUTION(double x, double y)
                                        ^
1 error detected in the compilation of
"libs/math/build/../src/tr1/copysign.cpp".
[...]
acc.compile.c++ bin.v2/libs/math/build/acc/release/threading-multi/copysignf.o
"libs/math/build/../src/tr1/copysignf.cpp", line 16: error #2247:
function "copysignf" has already been defined
  extern "C" float BOOST_MATH_TR1_DECL copysignf
BOOST_PREVENT_MACRO_SUBSTITUTION(float x, float y)

1 error detected in the compilation of
"libs/math/build/../src/tr1/copysignf.cpp".
[...]
"libs/math/build/../src/tr1/fmaxf.cpp", line 16: error #2247: function
"fmaxf" has already been defined
  extern "C" float BOOST_MATH_TR1_DECL fmaxf
BOOST_PREVENT_MACRO_SUBSTITUTION(float x, float y)
                                       ^
1 error detected in the compilation of "libs/math/build/../src/tr1/fmaxf.cpp".

acc.compile.c++ bin.v2/libs/math/build/acc/release/threading-multi/fminf.o
"libs/math/build/../src/tr1/fminf.cpp", line 16: error #2247: function
"fminf" has already been defined
  extern "C" float BOOST_MATH_TR1_DECL fminf
BOOST_PREVENT_MACRO_SUBSTITUTION(float x, float y)
                                       ^
1 error detected in the compilation of "libs/math/build/../src/tr1/fminf.cpp".

In all cases the code causing the problems looks somewhat like this:

#if !(defined(__HP_aCC) && (__HP_aCC >= 61400))

extern "C" float BOOST_MATH_TR1_DECL fminf
BOOST_PREVENT_MACRO_SUBSTITUTION(float x, float y)

#endif

[...]

So it looks like someone already took some precautions against this
problem. My compiler is slightly older (61200 vs. 61400).
When i replace the 61400 at these four places with a 61000 my build
completes just fine.

./libs/math/src/tr1/copysign.cpp:#if !(defined(__HP_aCC) && (__HP_aCC >= 61400))
./libs/math/src/tr1/copysignf.cpp:#if !(defined(__HP_aCC) && (__HP_aCC
>= 61400))
./libs/math/src/tr1/fmaxf.cpp:#if !(defined(__HP_aCC) && (__HP_aCC >= 61400))
./libs/math/src/tr1/fminf.cpp:#if !(defined(__HP_aCC) && (__HP_aCC >= 61400))

Can anybody more experienced with the aCC tell me if such a change
would be a good idea? Would you accept a patch?

Frank


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk