fixing the compilation of the math lib on HPUX

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

Can anybody more experienced with the aCC tell me if such a change would be a good idea?
No idea, my suspicion is that HP aCC defines these functions inline in it's header?
Would you accept a patch?
Sure. Can you try running bjam test_tr1 test_tr1_long_double aCC from within libs/math/test to check that the patch works OK? Thanks, John.

Hi John, the test cases pass: hamilton:~/boost/hpux/boost_1_42_0/bin.v2/libs/math/test/> cat test_tr1.test/acc/debug/test_tr1.output Running 1 test case... Testing type float Testing type double *** No errors detected EXIT STATUS: 0 hamilton:~/boost/hpux/boost_1_42_0/bin.v2/libs/math/test/> cat test_tr1/acc/debug/test_tr1.output test_tr1.test/ test_tr1_long_double.test/ hamilton:~/boost/hpux/boost_1_42_0/bin.v2/libs/math/test/> cat test_tr1_long_double.test/acc/debug/test_tr1_long_double.output Running 1 test case... Testing type long double *** No errors detected EXIT STATUS: 0 I have attached a patch to this mail. Frank On Mon, Apr 26, 2010 at 8:42 PM, John Maddock <boost.regex@virgin.net> wrote:
Can anybody more experienced with the aCC tell me if such a change would be a good idea?
No idea, my suspicion is that HP aCC defines these functions inline in it's header?
Would you accept a patch?
Sure. Can you try running
bjam test_tr1 test_tr1_long_double aCC
from within libs/math/test to check that the patch works OK?
Thanks, John. _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
participants (2)
-
Frank Meerkötter
-
John Maddock