• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright Daryle Walker, Hubert Holin, John Maddock 2006 - 2007
2# copyright Paul A. Bristow 2006 - 2010
3# Distributed under the Boost Software License, Version 1.0.
4# (See accompanying file LICENSE_1_0.txt or copy at
5# http://www.boost.org/LICENSE_1_0.txt.
6# \math_toolkit\libs\math\test\jamfile.v2
7# Runs all math toolkit tests, functions & distributions,
8# and build math examples.
9
10# bring in the rules for testing
11import testing ;
12import modules ;
13import path ;
14import pch ;
15import ../../../config/checks/config : requires ;
16using quickbook ;
17using auto-index ;
18
19import ../../../predef/check/predef
20    : check require
21    : predef-check predef-require ;
22
23project
24    : requirements
25      <include>../../include_private
26    ;
27
28if $(is_unix)
29{
30	local osname = [ SHELL uname ] ;
31
32	switch $(osname)
33	{
34		case "Sun*" : OTHERFLAGS = "-lpthread -lrt" ;
35		case "*BSD*" : OTHERFLAGS = "-lpthread" ;
36	}
37}
38
39#
40# Configuration first:
41#
42lib gsl ;
43lib gslcblas ;
44lib Rmath ;
45obj has_libstdcxx_tr1 : ../accuracy/has_libstdcxx_tr1.cpp ;
46explicit has_libstdcxx_tr1 ;
47obj has_c99_cmath : has_c99_cmath.cpp ;
48explicit has_c99_cmath ;
49exe has_gsl : has_gsl.cpp gsl gslcblas ;
50explicit has_gsl ;
51exe has_rmath : has_rmath.cpp Rmath ;
52explicit has_rmath ;
53obj is_intel_win : is_intel_win.cpp ;
54explicit is_intel_win ;
55
56CEPHES_SOURCE = acosh.c airy.c asin.c asinh.c atan.c atanh.c bdtr.c beta.c
57btdtr.c cbrt.c chbevl.c chdtr.c clog.c cmplx.c const.c
58cosh.c dawsn.c drand.c ei.c ellie.c ellik.c ellpe.c ellpj.c ellpk.c
59exp.c exp10.c exp2.c expn.c expx2.c fabs.c fac.c fdtr.c
60fresnl.c gamma.c gdtr.c hyp2f1.c hyperg.c i0.c i1.c igami.c incbet.c
61incbi.c igam.c isnan.c iv.c j0.c j1.c jn.c jv.c k0.c k1.c kn.c kolmogorov.c
62log.c log2.c log10.c lrand.c nbdtr.c ndtr.c ndtri.c pdtr.c planck.c
63polevl.c polmisc.c polylog.c polyn.c pow.c powi.c psi.c rgamma.c round.c
64shichi.c sici.c sin.c sindg.c sinh.c spence.c stdtr.c struve.c
65tan.c tandg.c tanh.c unity.c yn.c zeta.c zetac.c
66sqrt.c floor.c setprec.c mtherr.c ;
67
68DCDFLIB_SOURCE = dcdflib.c ipmpar.c ;
69
70path-constant here : . ;
71make $(here)/third_party/cephes_double/acosh.c : : @check_exists ;
72make $(here)/third_party/dcdflib/dcdflib.c : : @check_exists ;
73actions check_exists
74{
75    stat $(<)
76}
77explicit $(here)/third_party/cephes_double/acosh.c ;
78explicit $(here)/third_party/dcdflib/dcdflib.c ;
79
80lib cephes_double : $(here)/third_party/cephes_double/$(CEPHES_SOURCE)
81    :
82        release
83        <link>static
84        [ check-target-builds $(here)/third_party/cephes_double/acosh.c : : <build>no ]
85   ;
86
87explicit cephes_double ;
88
89lib dcdflib : $(here)/third_party/dcdflib/$(DCDFLIB_SOURCE)
90    :
91        release
92        <link>static
93        [ check-target-builds $(here)/third_party/dcdflib/dcdflib.c : : <build>no ]
94   ;
95
96explicit dcdflib ;
97
98obj table_helper : table_helper.cpp ;
99
100rule all-tests {
101     local result ;
102     for local source in [ glob test*.cpp ]
103     {
104        result += [ run $(source) /boost/regex//boost_regex /boost/system /boost/chrono /boost/filesystem table_helper
105        : : : release <include>../../test
106        [ check-target-builds ../accuracy//has_c99_cmath : <define>TEST_C99 ]
107        [ check-target-builds has_libstdcxx_tr1 : <define>TEST_LIBSTDCXX ]
108        [ check-target-builds ../accuracy//has_gsl : <define>TEST_GSL <source>gsl <source>gslcblas ]
109        [ check-target-builds ../accuracy//has_rmath : <define>TEST_RMATH <source>Rmath ]
110       # [ check-target-builds is_intel_win : <build>no : ]
111        [ check-target-builds $(here)/third_party/dcdflib/dcdflib.c : <define>TEST_DCDFLIB <source>dcdflib ]
112        <target-os>linux:<linkflags>-lpthread <target-os>linux:<linkflags>-lrt
113        #<toolset>msvc:<address-model>64
114        ] ;
115     }
116     return $(result) ;
117}
118
119#
120# Special cases to test different compiler options,
121# cbrt first as an example of a trivial function:
122#
123run test_cbrt.cpp /boost/regex//boost_regex /boost/system /boost/chrono /boost/filesystem table_helper
124     : : : debug <define>COMPILER_COMPARISON_TABLES [ predef-require "BOOST_COMP_MSVC" ] <address-model>32 : test_cbrt_msvc_debug ;
125run test_cbrt.cpp /boost/regex//boost_regex /boost/system /boost/chrono /boost/filesystem table_helper
126     : : : release <define>COMPILER_COMPARISON_TABLES [ predef-require "BOOST_COMP_MSVC" ] <cxxflags>-Ox <address-model>32 : test_cbrt_msvc_release_32 ;
127run test_cbrt.cpp /boost/regex//boost_regex /boost/system /boost/chrono /boost/filesystem table_helper
128     : : : release <define>COMPILER_COMPARISON_TABLES [ predef-require "BOOST_COMP_MSVC" ] <cxxflags>-Ox <address-model>64 : test_cbrt_msvc_release_64 ;
129run test_cbrt.cpp /boost/regex//boost_regex /boost/system /boost/chrono /boost/filesystem table_helper
130     : : : release <define>COMPILER_COMPARISON_TABLES [ check-target-builds is_intel_win : : <build>no ] <toolset>intel:<cxxflags>-Ox <address-model>64 : test_cbrt_intel_release ;
131#
132# Now jn as a little more complex:
133#
134run test_jn.cpp /boost/regex//boost_regex /boost/system /boost/chrono /boost/filesystem table_helper
135   : : : debug <define>COMPILER_COMPARISON_TABLES <include>../../test [ predef-require "BOOST_COMP_MSVC" ] <address-model>32 : test_jn_msvc_debug ;
136run test_jn.cpp /boost/regex//boost_regex /boost/system /boost/chrono /boost/filesystem table_helper
137   : : : release <define>COMPILER_COMPARISON_TABLES <include>../../test [ predef-require "BOOST_COMP_MSVC" ] <cxxflags>-Ox <address-model>32 : test_jn_msvc_release_32 ;
138run test_jn.cpp /boost/regex//boost_regex /boost/system /boost/chrono /boost/filesystem table_helper
139   : : : release <define>COMPILER_COMPARISON_TABLES <include>../../test [ predef-require "BOOST_COMP_MSVC" ] <cxxflags>-Ox <address-model>64 : test_jn_msvc_release_64 ;
140run test_jn.cpp /boost/regex//boost_regex /boost/system /boost/chrono /boost/filesystem table_helper
141   : : : release <define>COMPILER_COMPARISON_TABLES <include>../../test [ check-target-builds is_intel_win : : <build>no ] <address-model>64 : test_jn_intel_release ;
142#
143# Then something really expensive, like the inverse-incomplete-beta:
144#
145run test_ibeta_inv.cpp /boost/regex//boost_regex /boost/system /boost/chrono /boost/filesystem table_helper
146   : : : debug <define>COMPILER_COMPARISON_TABLES <include>../../test [ predef-require "BOOST_COMP_MSVC" ] <address-model>32 : test_ibeta_inv_msvc_debug ;
147run test_ibeta_inv.cpp /boost/regex//boost_regex /boost/system /boost/chrono /boost/filesystem table_helper
148   : : : release <define>COMPILER_COMPARISON_TABLES <include>../../test [ predef-require "BOOST_COMP_MSVC" ] <cxxflags>-Ox <address-model>32 : test_ibeta_inv_msvc_release_32 ;
149run test_ibeta_inv.cpp /boost/regex//boost_regex /boost/system /boost/chrono /boost/filesystem table_helper
150   : : : release <define>COMPILER_COMPARISON_TABLES <include>../../test [ predef-require "BOOST_COMP_MSVC" ] <cxxflags>-Ox <address-model>64 : test_ibeta_inv_msvc_release_64 ;
151run test_ibeta_inv.cpp /boost/regex//boost_regex /boost/system /boost/chrono /boost/filesystem table_helper
152   : : : release <define>COMPILER_COMPARISON_TABLES <include>../../test [ check-target-builds is_intel_win : : <build>no ] <toolset>intel:<cxxflags>-Ox <address-model>64 : test_ibeta_inv_intel_release ;
153
154test-suite report_gen : [ all-tests ] test_cbrt_msvc_debug test_cbrt_msvc_release_32 test_cbrt_msvc_release_64 test_cbrt_intel_release
155   test_jn_msvc_debug test_jn_msvc_release_32 test_jn_msvc_release_64 test_jn_intel_release test_ibeta_inv_msvc_debug
156   test_ibeta_inv_msvc_release_32 test_ibeta_inv_msvc_release_64 test_ibeta_inv_intel_release ;
157
158path-constant images_location : html ;
159path-constant here : . ;
160
161xml report : doc/report.qbk : <dependency>report_gen ;
162boostbook standalone
163    :
164        report
165    :
166        # Path for links to Boost:
167        <xsl:param>boost.root=../../../../..
168
169        # Some general style settings:
170        <xsl:param>table.footnote.number.format=1
171        <xsl:param>footnote.number.format=1
172        <xsl:param>html.stylesheet=boostbook.css
173
174        # HTML options first:
175        # Use graphics not text for navigation:
176        <xsl:param>navig.graphics=1
177        # How far down we chunk nested sections, basically all of them:
178        <xsl:param>chunk.section.depth=0
179        # Don't put the first section on the same page as the TOC:
180        <xsl:param>chunk.first.sections=0
181        # How far down sections get TOC's
182        <xsl:param>toc.section.depth=2
183        # Max depth in each TOC:
184        <xsl:param>toc.max.depth=4
185        # How far down we go with TOC's
186        <xsl:param>generate.section.toc.level=10
187    ;
188
189