Skip to content

Commit 41f07b0

Browse files
Add support for modular build structure. (#1160)
* Make the library modular usable. * Fix -Wundef warnings * Switch to library requirements instead of source. As source puts extra source in install targets. * Add missing NO_LIB usage requirements. * Remove boost-root relative include path. * Add missing import-search for cconfig/predef checks. * Add requires-b2 check to top-level build file. * Sync upstream. * Fix typo in test framework reference. * Bump B2 require to 5.2 * Update copyright dates. * Move inter-lib dependencies to a project variable and into the build targets. * Switch to /boost/test//included target for header only mode of Boost.Test. * Adjust doc build to avoid boost-root references. * Update build deps. * Fix project props not applying to the no_eh.obj compile. * Update build deps. * Add missing import-search. * Fix float128_type checks to actually disable tests. Problem was that build is a non-free feature. Which can't be acquired through a usage requirement. * GPU Batch 7 Fix igamma_large support on device Add GPU support to toms748 Add GPU support to igamma_inv Add GPU markers to gamma_inva Add GPU Markers to lgamma_small Remove STL usage from gamma Remove NVRTC workaround Fix fraction use of STL headers Mark gamma functions in fwd Disable declval on all GPU platforms Disable more unneeded code on device Add forward decl for NVRTC tgamma Disable unneeded items for all GPU Change workaround for missing overloads Rearrange definition location Add include path to cuda now that workaround is removed Fix NVRTC incompatibility with recursion and forward decls Add tgamma_ratio CUDA and NVRTC testing Fix NVRTC handling of gamma_p_derivative Add gamma_p_derivative CUDA and NVRTC testing Remove recursion from gamma_incomplete_imp Add SYCL testing of igamma, igamma_inv, and igamma_inva Ignore literal-range warnings Remove use of static const char* for function name Fix missing CUDA header Remove calls under NVRTC to fwd decl Add more nvrtc workarounds Use builtin erfc instead of header cycle Add CUDA and NVRTC testing of gamma_p_inv Adjust tolerances Add GPU support to chi squared dist Fix static local variable Add chi squared dist SYCL testing Add chi squared dist CUDA testing Add chi squared dist NVRTC testing Add GPU support to weibull dist Add weibull dist SYCL testing Add weibull dist CUDA testing Add weibull dist NVRTC testing * Fix policy macro definition for MSVC platforms * Don't add quadmath lib for has_128bit_floatmax_t check. It was accidentally copy+pasted. * Fix incorrect name for float128 type check that caused it to not apear. --------- Co-authored-by: Matt Borland <[email protected]>
1 parent ab57b20 commit 41f07b0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+832
-759
lines changed

build.jam

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Copyright René Ferdinand Rivera Morell 2023-2024
2+
# Distributed under the Boost Software License, Version 1.0.
3+
# (See accompanying file LICENSE_1_0.txt or copy at
4+
# http://www.boost.org/LICENSE_1_0.txt)
5+
6+
require-b2 5.2 ;
7+
8+
constant boost_dependencies :
9+
/boost/assert//boost_assert
10+
/boost/concept_check//boost_concept_check
11+
/boost/config//boost_config
12+
/boost/core//boost_core
13+
/boost/integer//boost_integer
14+
/boost/lexical_cast//boost_lexical_cast
15+
/boost/predef//boost_predef
16+
/boost/random//boost_random
17+
/boost/static_assert//boost_static_assert
18+
/boost/throw_exception//boost_throw_exception ;
19+
20+
project /boost/math
21+
: common-requirements
22+
<include>include
23+
;
24+
25+
explicit
26+
[ alias boost_math : : : : <library>$(boost_dependencies) ]
27+
[ alias boost_math_c99 : build//boost_math_c99 ]
28+
[ alias boost_math_c99f : build//boost_math_c99f ]
29+
[ alias boost_math_c99l : build//boost_math_c99l ]
30+
[ alias boost_math_tr1 : build//boost_math_tr1 ]
31+
[ alias boost_math_tr1f : build//boost_math_tr1f ]
32+
[ alias boost_math_tr1l : build//boost_math_tr1l ]
33+
[ alias all :
34+
boost_math
35+
boost_math_c99 boost_math_c99f boost_math_c99l
36+
boost_math_tr1 boost_math_tr1f boost_math_tr1l
37+
example test ]
38+
[ alias testing : : : :
39+
<include>test
40+
<include>include_private ]
41+
;
42+
43+
call-if : boost-library math
44+
: install boost_math
45+
boost_math_c99 boost_math_c99f boost_math_c99l
46+
boost_math_tr1 boost_math_tr1f boost_math_tr1l
47+
;
48+

build/Jamfile.v2

+20-18
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
# copyright John Maddock 2008
2-
# Distributed under the Boost Software License, Version 1.0.
3-
# (See accompanying file LICENSE_1_0.txt or copy at
2+
# Distributed under the Boost Software License, Version 1.0.
3+
# (See accompanying file LICENSE_1_0.txt or copy at
44
# http://www.boost.org/LICENSE_1_0.txt.
55

66
import testing ;
77
import pch ;
8-
import ../../config/checks/config : requires ;
8+
import-search /boost/config/checks ;
9+
import config : requires ;
910

10-
project
11-
: requirements
12-
<toolset>intel-win:<cxxflags>-nologo
13-
<toolset>intel-win:<linkflags>-nologo
11+
project
12+
: common-requirements <library>$(boost_dependencies)
13+
: requirements
14+
<toolset>intel-win:<cxxflags>-nologo
15+
<toolset>intel-win:<linkflags>-nologo
1416
#<toolset>intel-linux:<pch>off
1517
<toolset>intel-darwin:<pch>off
1618
<toolset>gcc,<target-os>windows:<pch>off
@@ -20,9 +22,11 @@ project
2022
[ check-target-builds ../config//has_gcc_visibility "gcc visibility" : <toolset>gcc:<cxxflags>-fvisibility=hidden : ]
2123
[ requires cxx11_noexcept cxx11_rvalue_references sfinae_expr cxx11_auto_declarations cxx11_lambdas cxx11_unified_initialization_syntax cxx11_hdr_tuple cxx11_hdr_initializer_list cxx11_hdr_chrono cxx11_thread_local cxx11_constexpr cxx11_nullptr cxx11_numeric_limits cxx11_decltype cxx11_hdr_array cxx11_hdr_atomic cxx11_hdr_type_traits cxx11_allocator cxx11_explicit_conversion_operators ]
2224
[ requires cxx14_decltype_auto cxx14_generic_lambdas cxx14_return_type_deduction cxx14_variable_templates cxx14_decltype_auto cxx14_generic_lambdas cxx14_return_type_deduction ]
25+
: usage-requirements
26+
<define>BOOST_MATH_TR1_NO_LIB=1
2327
;
2428

25-
cpp-pch pch : ../src/tr1/pch.hpp : <include>../src/tr1 <link>shared:<define>BOOST_MATH_TR1_DYN_LINK=1 ;
29+
cpp-pch pch : ../src/tr1/pch.hpp : <include>../src/tr1 <link>shared:<define>BOOST_MATH_TR1_DYN_LINK=1 ;
2630

2731
C99_SOURCES = acosh
2832
asinh
@@ -46,7 +50,7 @@ round
4650
tgamma
4751
trunc ;
4852

49-
TR1_SOURCES =
53+
TR1_SOURCES =
5054
assoc_laguerre
5155
assoc_legendre
5256
beta
@@ -80,46 +84,44 @@ import targets ;
8084

8185
obj long_double_check : ../config/has_long_double_support.cpp ;
8286
explicit long_double_check ;
83-
87+
8488
# Library targets
8589
lib boost_math_tr1 : ../src/tr1/$(TR1_SOURCES).cpp pch
86-
:
90+
:
8791
<link>shared:<define>BOOST_MATH_TR1_DYN_LINK=1
8892
<include>../src/tr1
8993
;
9094

9195
lib boost_math_tr1f : ../src/tr1/$(TR1_SOURCES)f.cpp pch
92-
:
96+
:
9397
<link>shared:<define>BOOST_MATH_TR1_DYN_LINK=1
9498
<include>../src/tr1
9599
;
96100

97101
lib boost_math_tr1l : ../src/tr1/$(TR1_SOURCES)l.cpp pch
98-
:
102+
:
99103
<link>shared:<define>BOOST_MATH_TR1_DYN_LINK=1
100104
<dependency>../config//has_long_double_support
101105
<include>../src/tr1
102106
[ check-target-builds ../config//has_long_double_support "long double support" : : <build>no ]
103107
;
104108

105109
lib boost_math_c99 : ../src/tr1/$(C99_SOURCES).cpp pch
106-
:
110+
:
107111
<link>shared:<define>BOOST_MATH_TR1_DYN_LINK=1
108112
<include>../src/tr1
109113
;
110114

111115
lib boost_math_c99f : ../src/tr1/$(C99_SOURCES)f.cpp pch
112-
:
116+
:
113117
<link>shared:<define>BOOST_MATH_TR1_DYN_LINK=1
114118
<include>../src/tr1
115119
;
116120

117121
lib boost_math_c99l : ../src/tr1/$(C99_SOURCES)l.cpp pch
118-
:
122+
:
119123
<link>shared:<define>BOOST_MATH_TR1_DYN_LINK=1
120124
<dependency>../config//has_long_double_support
121125
<include>../src/tr1
122126
[ check-target-builds ../config//has_long_double_support "long double support" : : <build>no ]
123127
;
124-
125-
boost-install boost_math_c99 boost_math_c99f boost_math_c99l boost_math_tr1 boost_math_tr1f boost_math_tr1l ;

config/Jamfile.v2

+5-5
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ import path ;
99
local ntl-path = [ modules.peek : NTL_PATH ] ;
1010
local gmp_path = [ modules.peek : GMP_PATH ] ;
1111

12-
lib quadmath ;
13-
lib fftw3 ;
14-
lib fftw3f ;
15-
lib fftw3l ;
16-
lib fftw3q ;
12+
searched-lib quadmath ;
13+
searched-lib fftw3 ;
14+
searched-lib fftw3f ;
15+
searched-lib fftw3l ;
16+
searched-lib fftw3q ;
1717

1818
obj has_long_double_support : has_long_double_support.cpp ;
1919
obj has_mpfr_class : has_mpfr_class.cpp :

doc/Jamfile.v2

+7-7
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ path-constant here : . ;
1313
constant here-url : [ regex.replace $(here) "\\\\" "/" ] ;
1414

1515
xml math : math.qbk :
16-
<quickbook-define>enable_index
16+
<quickbook-define>enable_index
1717
<quickbook-define>__base_path__=$(here-url)
1818
<format>pdf:<quickbook-define>__build_pdf
1919
<format>html:<quickbook-define>__build_html
@@ -25,7 +25,7 @@ boostbook standalone
2525
# Path for links to Boost:
2626
<xsl:param>boost.root=../../../..
2727
<xsl:param>html.stylesheet=math.css
28-
28+
2929
# Some general style settings:
3030
<xsl:param>table.footnote.number.format=1
3131
<xsl:param>footnote.number.format=1
@@ -46,11 +46,11 @@ boostbook standalone
4646
# Index on type:
4747
<xsl:param>index.on.type=1
4848
<xsl:param>boost.noexpand.chapter.toc=1
49-
49+
5050
#<xsl:param>root.filename="sf_dist_and_tools"
5151
#<xsl:param>graphicsize.extension=1
5252
#<xsl:param>use.extensions=1
53-
53+
5454
# PDF Options:
5555
# TOC Generation: this is needed for FOP-0.9 and later:
5656
<xsl:param>fop1.extensions=0
@@ -74,23 +74,23 @@ boostbook standalone
7474
# better use SVG's instead:
7575
<format>pdf:<xsl:param>admon.graphics.extension=".svg"
7676
<format>pdf:<xsl:param>admon.graphics.path=$(here)/../../../doc/src/images/
77-
<format>pdf:<xsl:param>use.role.for.mediaobject=1
77+
<format>pdf:<xsl:param>use.role.for.mediaobject=1
7878
<format>pdf:<xsl:param>preferred.mediaobject.role=print
7979
<format>pdf:<xsl:param>img.src.path=$(images_location)/
8080
<format>pdf:<xsl:param>draft.mode="no"
8181
<format>pdf:<xsl:param>boost.url.prefix=http\://www.boost.org/doc/libs/release/libs/math/doc/html
8282
<auto-index>on <format>pdf:<auto-index-internal>off
8383
<format>html:<auto-index-internal>on
8484
<auto-index-script>$(here)/index.idx
85-
<auto-index-prefix>$(here)/../../..
85+
<auto-index-prefix>$(here)/../include
8686
#<auto-index-verbose>on
8787
<format>pdf:<xsl:param>index.on.type=1
8888
;
8989

9090
install pdfinstall : standalone/<format>pdf : <location>. <install-type>PDF <name>math.pdf ;
9191
explicit pdfinstall ; # b2 pdf pdfinstall to do this pdf file copy.
9292

93-
install css_install : math.css : <location>$(here)/html ;
93+
install css_install : math.css : <location>$(here)/html ;
9494

9595
###############################################################################
9696
alias boostdoc ;

example/Jamfile.v2

+8-6
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,13 @@
77

88
# bring in the rules for testing
99
import testing ;
10-
import ../../config/checks/config : requires ;
10+
import-search /boost/config/checks ;
11+
import config : requires ;
1112

1213
project
1314
: requirements
15+
<library>/boost/math//boost_math
16+
<library>/boost/multiprecision//boost_multiprecision
1417
<toolset>gcc:<cxxflags>-Wno-missing-braces
1518
<toolset>darwin:<cxxflags>-Wno-missing-braces
1619
<toolset>acc:<cxxflags>+W2068,2461,2236,4070
@@ -36,7 +39,6 @@ project
3639
<toolset>clang:<cxxflags>-Wno-unknown-pragmas
3740
<toolset>clang:<cxxflags>-Wno-language-extension-token
3841

39-
<include>../../..
4042
<include>../include_private
4143
<exception-handling>off:<source>../test//no_eh
4244
[ requires cxx11_noexcept cxx11_rvalue_references sfinae_expr cxx11_auto_declarations cxx11_lambdas cxx11_unified_initialization_syntax cxx11_hdr_tuple cxx11_hdr_initializer_list cxx11_hdr_chrono cxx11_thread_local cxx11_constexpr cxx11_nullptr cxx11_numeric_limits cxx11_decltype cxx11_hdr_array cxx11_hdr_atomic cxx11_hdr_type_traits cxx11_allocator cxx11_explicit_conversion_operators ]
@@ -53,7 +55,7 @@ test-suite examples :
5355
[ run binomial_example_nag.cpp ]
5456
[ run binomial_quiz_example.cpp : : : <exception-handling>off:<build>no ]
5557
[ run binomial_sample_sizes.cpp ]
56-
[ run brent_minimise_example.cpp : : : [ requires cxx11_hdr_tuple ] ]
58+
[ run brent_minimise_example.cpp /boost/test//included : : : [ requires cxx11_hdr_tuple ] ]
5759

5860
[ run c_error_policy_example.cpp ]
5961
[ run chi_square_std_dev_test.cpp : : : <exception-handling>off:<build>no ]
@@ -93,11 +95,11 @@ test-suite examples :
9395

9496
[ run nonfinite_num_facet.cpp ]
9597
[ run nonfinite_facet_simple.cpp ]
96-
#[ run nonfinite_num_facet_serialization.cpp ../../serialization/build//boost_serialization : : : <exception-handling>off:<build>no <toolset>gcc-mingw:<link>static ]
98+
#[ run nonfinite_num_facet_serialization.cpp /boost/serialization//boost_serialization : : : <exception-handling>off:<build>no <toolset>gcc-mingw:<link>static ]
9799
#[ # run lexical_cast_native.cpp ] # Expected to fail on some (but not all) platforms.
98100
[ run lexical_cast_nonfinite_facets.cpp ]
99101
[ run nonfinite_loopback_ok.cpp ]
100-
#[ run nonfinite_serialization_archives.cpp ../../serialization/build//boost_serialization : : : <exception-handling>off:<build>no <toolset>gcc-mingw:<link>static ]
102+
#[ run nonfinite_serialization_archives.cpp /boost/serialization//boost_serialization : : : <exception-handling>off:<build>no <toolset>gcc-mingw:<link>static ]
101103
[ run nonfinite_facet_sstream.cpp ]
102104

103105
[ run constants_eg1.cpp ]
@@ -113,7 +115,7 @@ test-suite examples :
113115
[ run policy_eg_6.cpp ]
114116
[ run policy_eg_7.cpp ]
115117
[ run policy_eg_8.cpp ]
116-
[ run policy_eg_9.cpp ]
118+
[ run policy_eg_9.cpp /boost/format//boost_format ]
117119
[ run policy_ref_snip1.cpp : : : <exception-handling>off:<build>no ]
118120
[ run policy_ref_snip10.cpp ]
119121
[ run policy_ref_snip11.cpp ]

0 commit comments

Comments
 (0)