Boost logo

Boost-Build :

Subject: Re: [Boost-build] BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS causes build to fail
From: Steve M. Robbins (steve_at_[hidden])
Date: 2008-11-15 11:47:34


On Tue, Nov 11, 2008 at 08:49:44PM -0800, Steven Watanabe wrote:
> AMDG
>
> Steve M. Robbins wrote:
>>> Alternatively, since the test is used to suppress the long double
>>> version of the TR1 library, could I patch the build system to avoid
>>> building it when a certain parameter is given on the bjam command
>>> line? I can easily arrange for the parameter to be present on the
>>> affected architectures.
>>>
>>
>> OK, after a bit of poking around, I came up with the following hack.
>> I'm interested in ideas for improvement. Could something like this
>> make it into Boost itself (minus the ECHOS, of course)?

The initial hack is not sufficient. Below is the patch I ended up
using, for the record.

> Maybe this should be split up in Jamroot so that we can use:
> --without-math_tr1l --without-math_c99l?

Maybe. My case is that some architectures in Debian support long
double math and some don't. So I want either both built or neither
built.

What use case do you envision for separate options?

Cheers,
-Steve

Add option --disable-long-double to Boost build procedure.
Specifying this option essentially allows us to ignore
a build failure.

c.f. http://lists.boost.org/boost-build/2008/11/20683.php

--- boost1.36-1.36.0.orig/libs/math/build/Jamfile.v2
+++ boost1.36-1.36.0/libs/math/build/Jamfile.v2
@@ -51,7 +51,18 @@
 sph_neumann
 ;
 
-compile has_long_double_support.cpp ;
+if --disable-long-double in [ modules.peek : ARGV ]
+{
+ build-long-double = false ;
+}
+else
+{
+ build-long-double = true ;
+ compile has_long_double_support.cpp ;
+}
+
+ECHO "Build long double: " $(build-long-double) ;
+
 
 lib boost_math_tr1 : ../src/tr1/$(TR1_SOURCES).cpp
     :
@@ -63,11 +74,15 @@
               <link>shared:<define>BOOST_MATH_TR1_DYN_LINK=1
    ;
 
+if $(build-long-double) = true
+{
+echo "BUILDING MATH_TR1 LONG" ;
 lib boost_math_tr1l : ../src/tr1/$(TR1_SOURCES)l.cpp
     :
               <link>shared:<define>BOOST_MATH_TR1_DYN_LINK=1
               <dependency>has_long_double_support
    ;
+}
 
 lib boost_math_c99 : ../src/tr1/$(C99_SOURCES).cpp
     :
@@ -79,12 +94,20 @@
               <link>shared:<define>BOOST_MATH_TR1_DYN_LINK=1
    ;
 
+if $(build-long-double) = true
+{
+echo "BUILDING MATH_C99 LONG" ;
 lib boost_math_c99l : ../src/tr1/$(C99_SOURCES)l.cpp
     :
               <link>shared:<define>BOOST_MATH_TR1_DYN_LINK=1
               <dependency>has_long_double_support
    ;
+}
 
 
-boost-install boost_math_c99 boost_math_c99f boost_math_c99l boost_math_tr1 boost_math_tr1f boost_math_tr1l ;
+boost-install boost_math_c99 boost_math_c99f boost_math_tr1 boost_math_tr1f ;
 
+if $(build-long-double) = true
+{
+boost-install boost_math_c99l boost_math_tr1l ;
+}




Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk