From 926e34c55ce12923e78d13762e5194bab3f7c47f Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Thu, 12 May 2022 19:42:24 +0100 Subject: [PATCH 01/17] Set BOOST_NO_EXCEPTIONS and BOOST_NO_RTTI for GCC and math in standalone mode. Disable everything not needed in error_handling.hpp when no exceptions are available. --- .../boost/math/policies/error_handling.hpp | 51 +++++++++++++++++-- include/boost/math/tools/config.hpp | 19 +++++++ 2 files changed, 67 insertions(+), 3 deletions(-) diff --git a/include/boost/math/policies/error_handling.hpp b/include/boost/math/policies/error_handling.hpp index 4ee6877e27..3af1f976b5 100644 --- a/include/boost/math/policies/error_handling.hpp +++ b/include/boost/math/policies/error_handling.hpp @@ -8,19 +8,23 @@ #ifndef BOOST_MATH_POLICY_ERROR_HANDLING_HPP #define BOOST_MATH_POLICY_ERROR_HANDLING_HPP +#include #include #include #include +#ifndef BOOST_NO_RTTI #include +#endif #include #include #include #include -#include -#include #include #include +#ifndef BOOST_NO_EXCEPTIONS +#include #include +#endif #ifdef _MSC_VER # pragma warning(push) // Quiet warnings in boost/format.hpp @@ -36,6 +40,8 @@ namespace boost{ namespace math{ +#ifndef BOOST_NO_EXCEPTIONS + class evaluation_error : public std::runtime_error { public: @@ -48,6 +54,8 @@ class rounding_error : public std::runtime_error rounding_error(const std::string& s) : std::runtime_error(s){} }; +#endif + namespace policies{ // // Forward declarations of user error handlers, @@ -120,6 +128,7 @@ inline const char* name_of() } #endif +#ifndef BOOST_NO_EXCEPTIONS template void raise_error(const char* pfunction, const char* message) { @@ -169,6 +178,7 @@ void raise_error(const char* pfunction, const char* pmessage, const T& val) E e(msg); BOOST_MATH_THROW_EXCEPTION(e) } +#endif template inline T raise_domain_error( @@ -177,9 +187,13 @@ inline T raise_domain_error( const T& val, const ::boost::math::policies::domain_error< ::boost::math::policies::throw_on_error>&) { +#ifdef BOOST_NO_EXCEPTIONS + static_assert(sizeof(T) == 0, "Error handler called with throw_on_error and BOOST_NO_EXCEPTIONS set."); +#else raise_error(function, message, val); // we never get here: return std::numeric_limits::quiet_NaN(); +#endif } template @@ -224,7 +238,11 @@ inline T raise_pole_error( const T& val, const ::boost::math::policies::pole_error< ::boost::math::policies::throw_on_error>&) { +#ifdef BOOST_NO_EXCEPTIONS + static_assert(sizeof(T) == 0, "Error handler called with throw_on_error and BOOST_NO_EXCEPTIONS set."); +#else return boost::math::policies::detail::raise_domain_error(function, message, val, ::boost::math::policies::domain_error< ::boost::math::policies::throw_on_error>()); +#endif } template @@ -257,16 +275,19 @@ inline T raise_pole_error( return user_pole_error(function, message, val); } - template inline T raise_overflow_error( const char* function, const char* message, const ::boost::math::policies::overflow_error< ::boost::math::policies::throw_on_error>&) { +#ifdef BOOST_NO_EXCEPTIONS + static_assert(sizeof(T) == 0, "Error handler called with throw_on_error and BOOST_NO_EXCEPTIONS set."); +#else raise_error(function, message ? message : "numeric overflow"); // We should never get here: return std::numeric_limits::has_infinity ? std::numeric_limits::infinity() : boost::math::tools::max_value(); +#endif } template @@ -276,9 +297,13 @@ inline T raise_overflow_error( const T& val, const ::boost::math::policies::overflow_error< ::boost::math::policies::throw_on_error>&) { +#ifdef BOOST_NO_EXCEPTIONS + static_assert(sizeof(T) == 0, "Error handler called with throw_on_error and BOOST_NO_EXCEPTIONS set."); +#else raise_error(function, message ? message : "numeric overflow", val); // We should never get here: return std::numeric_limits::has_infinity ? std::numeric_limits::infinity() : boost::math::tools::max_value(); +#endif } template @@ -358,9 +383,13 @@ inline T raise_underflow_error( const char* message, const ::boost::math::policies::underflow_error< ::boost::math::policies::throw_on_error>&) { +#ifdef BOOST_NO_EXCEPTIONS + static_assert(sizeof(T) == 0, "Error handler called with throw_on_error and BOOST_NO_EXCEPTIONS set."); +#else raise_error(function, message ? message : "numeric underflow"); // We should never get here: return 0; +#endif } template @@ -402,9 +431,13 @@ inline T raise_denorm_error( const T& /* val */, const ::boost::math::policies::denorm_error< ::boost::math::policies::throw_on_error>&) { +#ifdef BOOST_NO_EXCEPTIONS + static_assert(sizeof(T) == 0, "Error handler called with throw_on_error and BOOST_NO_EXCEPTIONS set."); +#else raise_error(function, message ? message : "denormalised result"); // we never get here: return T(0); +#endif } template @@ -449,9 +482,13 @@ inline T raise_evaluation_error( const T& val, const ::boost::math::policies::evaluation_error< ::boost::math::policies::throw_on_error>&) { +#ifdef BOOST_NO_EXCEPTIONS + static_assert(sizeof(T) == 0, "Error handler called with throw_on_error and BOOST_NO_EXCEPTIONS set."); +#else raise_error(function, message, val); // we never get here: return T(0); +#endif } template @@ -497,9 +534,13 @@ inline TargetType raise_rounding_error( const TargetType&, const ::boost::math::policies::rounding_error< ::boost::math::policies::throw_on_error>&) { +#ifdef BOOST_NO_EXCEPTIONS + static_assert(sizeof(T) == 0, "Error handler called with throw_on_error and BOOST_NO_EXCEPTIONS set."); +#else raise_error(function, message, val); // we never get here: return TargetType(0); +#endif } template @@ -564,9 +605,13 @@ inline T raise_indeterminate_result_error( const R& , const ::boost::math::policies::indeterminate_result_error< ::boost::math::policies::throw_on_error>&) { +#ifdef BOOST_NO_EXCEPTIONS + static_assert(sizeof(T) == 0, "Error handler called with throw_on_error and BOOST_NO_EXCEPTIONS set."); +#else raise_error(function, message, val); // we never get here: return std::numeric_limits::quiet_NaN(); +#endif } template diff --git a/include/boost/math/tools/config.hpp b/include/boost/math/tools/config.hpp index 2a054fc261..b766ec4ff8 100644 --- a/include/boost/math/tools/config.hpp +++ b/include/boost/math/tools/config.hpp @@ -77,6 +77,25 @@ # define BOOST_NO_CXX11_THREAD_LOCAL #endif // BOOST_DISABLE_THREADS +#ifdef __GNUC__ +# if !defined(__EXCEPTIONS) && !defined(BOOST_NO_EXCEPTIONS) +# define BOOST_NO_EXCEPTIONS +# endif + // + // Make sure we have some std lib headers included so we can detect __GXX_RTTI: + // +# include // for min and max +# include +# ifndef __GXX_RTTI +# ifndef BOOST_NO_TYPEID +# define BOOST_NO_TYPEID +# endif +# ifndef BOOST_NO_RTTI +# define BOOST_NO_RTTI +# endif +# endif +#endif + #endif // BOOST_MATH_STANDALONE #include // for min and max From a6db2d19b7e96f802af751b039090d184343b3b5 Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Fri, 13 May 2022 19:03:42 +0100 Subject: [PATCH 02/17] Change bernoulli error handling to always go through the policies. --- .../detail/bernoulli_details.hpp | 41 ++++++++++++++----- 1 file changed, 30 insertions(+), 11 deletions(-) diff --git a/include/boost/math/special_functions/detail/bernoulli_details.hpp b/include/boost/math/special_functions/detail/bernoulli_details.hpp index 91f1747c01..58015fec14 100644 --- a/include/boost/math/special_functions/detail/bernoulli_details.hpp +++ b/include/boost/math/special_functions/detail/bernoulli_details.hpp @@ -184,17 +184,22 @@ struct fixed_vector : private std::allocator const T& operator[](unsigned n)const { BOOST_MATH_ASSERT(n < m_used); return m_data[n]; } unsigned size()const { return m_used; } unsigned size() { return m_used; } - void resize(unsigned n, const T& val) + bool resize(unsigned n, const T& val) { if(n > m_capacity) { +#ifndef BOOST_NO_EXCEPTIONS BOOST_MATH_THROW_EXCEPTION(std::runtime_error("Exhausted storage for Bernoulli numbers.")); +#else + return false; +#endif } for(unsigned i = m_used; i < n; ++i) new (m_data + i) T(val); m_used = n; + return true; } - void resize(unsigned n) { resize(n, T()); } + bool resize(unsigned n) { return resize(n, T()); } T* begin() { return m_data; } T* end() { return m_data + m_used; } T* begin()const { return m_data; } @@ -217,10 +222,14 @@ class bernoulli_numbers_cache typedef fixed_vector container_type; - void tangent(std::size_t m) + bool tangent(std::size_t m) { static const std::size_t min_overflow_index = b2n_overflow_limit() - 1; - tn.resize(static_cast(m), T(0U)); + + if (!tn.resize(static_cast(m), T(0U))) + { + return false; + } BOOST_MATH_INSTRUMENT_VARIABLE(min_overflow_index); @@ -268,17 +277,20 @@ class bernoulli_numbers_cache BOOST_MATH_INSTRUMENT_VARIABLE(i); BOOST_MATH_INSTRUMENT_VARIABLE(tn[static_cast(i)]); } + return true; } - void tangent_numbers_series(const std::size_t m) + bool tangent_numbers_series(const std::size_t m) { BOOST_MATH_STD_USING static const std::size_t min_overflow_index = b2n_overflow_limit() - 1; typename container_type::size_type old_size = bn.size(); - tangent(m); - bn.resize(static_cast(m)); + if (!tangent(m)) + return false; + if (!bn.resize(static_cast(m))) + return false; if(!old_size) { @@ -321,6 +333,7 @@ class bernoulli_numbers_cache bn[static_cast(i)] = ((!b_neg) ? b : T(-b)); } + return true; } template @@ -379,7 +392,10 @@ class bernoulli_numbers_cache if(start + n >= bn.size()) { std::size_t new_size = (std::min)((std::max)((std::max)(std::size_t(start + n), std::size_t(bn.size() + 20)), std::size_t(50)), std::size_t(bn.capacity())); - tangent_numbers_series(new_size); + if (!tangent_numbers_series(new_size)) + { + return std::fill_n(out, n, policies::raise_evaluation_error("boost::math::bernoulli_b2n<%1%>(std::size_t)", "Unable to allocate Bernoulli numbers cache for %1% values", T(start + n), pol)); + } } for(std::size_t i = (std::max)(std::size_t(max_bernoulli_b2n::value + 1), start); i < start + n; ++i) @@ -413,7 +429,8 @@ class bernoulli_numbers_cache if(start + n >= bn.size()) { std::size_t new_size = (std::min)((std::max)((std::max)(std::size_t(start + n), std::size_t(bn.size() + 20)), std::size_t(50)), std::size_t(bn.capacity())); - tangent_numbers_series(new_size); + if (!tangent_numbers_series(new_size)) + return std::fill_n(out, n, policies::raise_evaluation_error("boost::math::bernoulli_b2n<%1%>(std::size_t)", "Unable to allocate Bernoulli numbers cache for %1% values", T(new_size), pol)); } m_counter.store(static_cast(bn.size()), std::memory_order_release); } @@ -483,7 +500,8 @@ class bernoulli_numbers_cache if(start + n >= bn.size()) { std::size_t new_size = (std::min)((std::max)((std::max)(start + n, std::size_t(bn.size() + 20)), std::size_t(50)), std::size_t(bn.capacity())); - tangent_numbers_series(new_size); + if (!tangent_numbers_series(new_size)) + return std::fill_n(out, n, policies::raise_evaluation_error("boost::math::bernoulli_b2n<%1%>(std::size_t)", "Unable to allocate Bernoulli numbers cache for %1% values", T(start + n), pol)); } for(std::size_t i = start; i < start + n; ++i) @@ -527,7 +545,8 @@ class bernoulli_numbers_cache if(start + n >= bn.size()) { std::size_t new_size = (std::min)((std::max)((std::max)(start + n, std::size_t(bn.size() + 20)), std::size_t(50)), std::size_t(bn.capacity())); - tangent_numbers_series(new_size); + if (!tangent_numbers_series(new_size)) + return std::fill_n(out, n, policies::raise_evaluation_error("boost::math::bernoulli_b2n<%1%>(std::size_t)", "Unable to allocate Bernoulli numbers cache for %1% values", T(start + n), pol)); } m_counter.store(static_cast(bn.size()), std::memory_order_release); } From bf3b0258e88516266b2a28fb1a186c712981dd70 Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Fri, 13 May 2022 19:25:18 +0100 Subject: [PATCH 03/17] Correct error handling in owens_t. --- include/boost/math/special_functions/owens_t.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/math/special_functions/owens_t.hpp b/include/boost/math/special_functions/owens_t.hpp index f96d6648e5..152b5cbdda 100644 --- a/include/boost/math/special_functions/owens_t.hpp +++ b/include/boost/math/special_functions/owens_t.hpp @@ -829,7 +829,7 @@ namespace boost val = owens_t_T6(h,a, pol); break; default: - BOOST_MATH_THROW_EXCEPTION(std::logic_error("selection routine in Owen's T function failed")); + val = policies::raise_evaluation_error("boost::math::owens_t", "selection routine in Owen's T function failed with h = %1%", h, pol); } return val; } From 6240f57892e14215df87a9b9f42e3db1fb4122db Mon Sep 17 00:00:00 2001 From: Christopher Kormanyos Date: Sat, 14 May 2022 09:52:44 +0200 Subject: [PATCH 04/17] Enclose a try/catch block within (no)-exceptions --- include/boost/math/special_functions/gamma.hpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/include/boost/math/special_functions/gamma.hpp b/include/boost/math/special_functions/gamma.hpp index b94dcbbc32..a3f6cfc4a5 100644 --- a/include/boost/math/special_functions/gamma.hpp +++ b/include/boost/math/special_functions/gamma.hpp @@ -1465,7 +1465,15 @@ T gamma_incomplete_imp(T a, T x, bool normalised, bool invert, result = pow(x, a) / (a); else { - try + #ifdef BOOST_NO_EXCEPTIONS + result = pow(x, a) / boost::math::tgamma(a + 1, pol); + using std::isfinite; + if(!(isfinite)(result)) + { + result = 0; + } + #else + try { result = pow(x, a) / boost::math::tgamma(a + 1, pol); } @@ -1473,6 +1481,7 @@ T gamma_incomplete_imp(T a, T x, bool normalised, bool invert, { result = 0; } + #endif } result *= 1 - a * x / (a + 1); if (p_derivative) From 7c5228a07bd911599d4f5e03f71fb220f1f0d963 Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Sun, 15 May 2022 17:35:11 +0100 Subject: [PATCH 05/17] Add no-exception handling tests. Add Ubuntu-22 plus gcc-12 and clang-14 CI tests. Fix a couple headers which still had noeh-unfriendly code. --- .github/workflows/ci.yml | 127 ++++++++++++++++++ .../detail/ibeta_inverse.hpp | 4 + .../boost/math/special_functions/gamma.hpp | 4 + test/Jamfile.v2 | 122 +++++++++++++++++ 4 files changed, 257 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2c8b047f14..46022f33e7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,6 +13,70 @@ on: release: types: [published, created, edited] jobs: + ubuntu-jammy: + runs-on: ubuntu-22.04 + strategy: + fail-fast: false + matrix: + compiler: [ g++-12, clang++-14 ] + standard: [ c++11, c++14, c++17, c++20 ] + suite: [ float128_tests, special_fun, distribution_tests, misc, quadrature, mp, interpolators, autodiff, ../example//examples, ../tools ] + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: '0' + - uses: mstachniuk/ci-skip@v1 + with: + commit-filter: '[skip ci];[ci skip];[CI SKIP];[SKIP CI];***CI SKIP***;***SKIP CI***;[windows];[Windows];[WINDOWS];[apple];[Apple];[APPLE];[standalone];[STANDALONE];[cygwin];[CYGWIN]' + commit-filter-separator: ';' + fail-fast: true + - name: Set TOOLSET + run: echo ${{ matrix.compiler }} | awk '/^g/ { print "TOOLSET=gcc" } /^clang/ { print "TOOLSET=clang" }' >> $GITHUB_ENV + - name: Add repository + continue-on-error: true + id: addrepo + run: sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test" + - name: Retry Add Repo + continue-on-error: true + id: retry1 + if: steps.addrepo.outcome=='failure' + run: sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test" + - name: Retry Add Repo 2 + continue-on-error: true + id: retry2 + if: steps.retry1.outcome=='failure' + run: sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test" + - name: Install packages + run: sudo apt install g++-12 clang-14 libgmp-dev libmpfr-dev libfftw3-dev + - name: Checkout main boost + run: git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root + - name: Update tools/boostdep + run: git submodule update --init tools/boostdep + working-directory: ../boost-root + - name: Copy files + run: cp -r $GITHUB_WORKSPACE/* libs/math + working-directory: ../boost-root + - name: Install deps + run: python tools/boostdep/depinst/depinst.py math + working-directory: ../boost-root + - name: Bootstrap + run: ./bootstrap.sh + working-directory: ../boost-root + - name: Generate headers + run: ./b2 headers + working-directory: ../boost-root + - name: Generate user config + run: 'echo "using $TOOLSET : : ${{ matrix.compiler }} : -std=${{ matrix.standard }} ;" > ~/user-config.jam' + working-directory: ../boost-root + - name: Config info install + run: ../../../b2 config_info_travis_install toolset=$TOOLSET + working-directory: ../boost-root/libs/config/test + - name: Config info + run: ./config_info_travis + working-directory: ../boost-root/libs/config/test + - name: Test + run: ../../../b2 toolset=$TOOLSET ${{ matrix.suite }} define=CI_SUPPRESS_KNOWN_ISSUES define=SLOW_COMPILER + working-directory: ../boost-root/libs/math/test ubuntu-focal: runs-on: ubuntu-20.04 strategy: @@ -77,6 +141,69 @@ jobs: - name: Test run: ../../../b2 toolset=$TOOLSET ${{ matrix.suite }} define=CI_SUPPRESS_KNOWN_ISSUES define=SLOW_COMPILER working-directory: ../boost-root/libs/math/test + ubuntu-focal-no-eh: + runs-on: ubuntu-20.04 + strategy: + fail-fast: false + matrix: + compiler: [ g++-9, g++-11, clang++-10 ] + standard: [ c++11, c++14, c++17, c++2a ] + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: '0' + - uses: mstachniuk/ci-skip@v1 + with: + commit-filter: '[skip ci];[ci skip];[CI SKIP];[SKIP CI];***CI SKIP***;***SKIP CI***;[windows];[Windows];[WINDOWS];[apple];[Apple];[APPLE];[standalone];[STANDALONE];[cygwin];[CYGWIN]' + commit-filter-separator: ';' + fail-fast: true + - name: Set TOOLSET + run: echo ${{ matrix.compiler }} | awk '/^g/ { print "TOOLSET=gcc" } /^clang/ { print "TOOLSET=clang" }' >> $GITHUB_ENV + - name: Add repository + continue-on-error: true + id: addrepo + run: sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test" + - name: Retry Add Repo + continue-on-error: true + id: retry1 + if: steps.addrepo.outcome=='failure' + run: sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test" + - name: Retry Add Repo 2 + continue-on-error: true + id: retry2 + if: steps.retry1.outcome=='failure' + run: sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test" + - name: Install packages + run: sudo apt install g++-9 g++-11 clang-9 clang-10 libgmp-dev libmpfr-dev libfftw3-dev + - name: Checkout main boost + run: git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root + - name: Update tools/boostdep + run: git submodule update --init tools/boostdep + working-directory: ../boost-root + - name: Copy files + run: cp -r $GITHUB_WORKSPACE/* libs/math + working-directory: ../boost-root + - name: Install deps + run: python tools/boostdep/depinst/depinst.py math + working-directory: ../boost-root + - name: Bootstrap + run: ./bootstrap.sh + working-directory: ../boost-root + - name: Generate headers + run: ./b2 headers + working-directory: ../boost-root + - name: Generate user config + run: 'echo "using $TOOLSET : : ${{ matrix.compiler }} : -std=${{ matrix.standard }} ;" > ~/user-config.jam' + working-directory: ../boost-root + - name: Config info install + run: ../../../b2 config_info_travis_install toolset=$TOOLSET + working-directory: ../boost-root/libs/config/test + - name: Config info + run: ./config_info_travis + working-directory: ../boost-root/libs/config/test + - name: Test + run: ../../../b2 toolset=$TOOLSET no_eh_tests exception-handling=off rtti=off define=CI_SUPPRESS_KNOWN_ISSUES define=SLOW_COMPILER + working-directory: ../boost-root/libs/math/test ubuntu-bionic: runs-on: ubuntu-18.04 strategy: diff --git a/include/boost/math/special_functions/detail/ibeta_inverse.hpp b/include/boost/math/special_functions/detail/ibeta_inverse.hpp index e3dc0ba4fa..195f6abe18 100644 --- a/include/boost/math/special_functions/detail/ibeta_inverse.hpp +++ b/include/boost/math/special_functions/detail/ibeta_inverse.hpp @@ -688,13 +688,17 @@ T ibeta_inv_imp(T a, T b, T p, T q, const Policy& pol, T* py) T bet = 0; T xg; bool overflow = false; +#ifndef BOOST_NO_EXCEPTIONS try { +#endif bet = boost::math::beta(a, b, pol); +#ifndef BOOST_NO_EXCEPTIONS } catch (const std::runtime_error&) { overflow = true; } +#endif if (overflow || !(boost::math::isfinite)(bet)) { xg = exp((boost::math::lgamma(a + 1, pol) + boost::math::lgamma(b, pol) - boost::math::lgamma(a + b, pol) + log(p)) / a); diff --git a/include/boost/math/special_functions/gamma.hpp b/include/boost/math/special_functions/gamma.hpp index b94dcbbc32..13cd25e087 100644 --- a/include/boost/math/special_functions/gamma.hpp +++ b/include/boost/math/special_functions/gamma.hpp @@ -1465,14 +1465,18 @@ T gamma_incomplete_imp(T a, T x, bool normalised, bool invert, result = pow(x, a) / (a); else { +#ifndef BOOST_NO_EXCEPTIONS try { +#endif result = pow(x, a) / boost::math::tgamma(a + 1, pol); +#ifndef BOOST_NO_EXCEPTIONS } catch (const std::overflow_error&) { result = 0; } +#endif } result *= 1 - a * x / (a + 1); if (p_derivative) diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 5deced8cb0..dddf47c879 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -1504,3 +1504,125 @@ rule get_float128_tests } test-suite float128_tests : [ get_float128_tests ] ; + +# +# Things that we can test with exceptions and RTTI turned off: +# +alias no_eh_tests : + compl_abs_incl_test + compl_acos_incl_test + compl_acosh_incl_test + compl_asin_incl_test + compl_asinh_incl_test + compl_atan_incl_test + compl_atanh_incl_test + sf_acosh_incl_test + sf_asinh_incl_test + sf_atanh_incl_test + sf_beta_incl_test + sf_bernoulli_incl_test + sf_bessel_incl_test + sf_bessel_deriv_incl_test + sf_binomial_incl_test + sf_cbrt_incl_test + sf_cos_pi_incl_test + sf_digamma_incl_test + sf_polygamma_incl_test + sf_ellint_1_incl_test + sf_ellint_2_incl_test + sf_ellint_3_incl_test + sf_ellint_d_incl_test + sf_jacobi_theta_incl_test + sf_jacobi_zeta_incl_test + sf_heuman_lambda_incl_test + sf_ellint_rc_incl_test + sf_ellint_rd_incl_test + sf_ellint_rf_incl_test + sf_ellint_rj_incl_test + sf_ellint_rg_incl_test + sf_erf_incl_test + sf_expint_incl_test + sf_expm1_incl_test + sf_factorials_incl_test + sf_fpclassify_incl_test + sf_gamma_incl_test + sf_hermite_incl_test + sf_hypot_incl_test + sf_laguerre_incl_test + sf_lanczos_incl_test + sf_legendre_incl_test + #sf_legendre_stieltjes_incl_test + sf_log1p_incl_test + sf_math_fwd_incl_test + sf_modf_incl_test + sf_next_incl_test + sf_powm1_incl_test + sf_prime_incl_test + sf_relative_distance_incl_test + sf_round_incl_test + sf_sign_incl_test + sf_sin_pi_incl_test + sf_sinc_incl_test + sf_sinhc_incl_test + sf_sph_harm_incl_test + sf_sqrt1pm1_incl_test + sf_trunc_incl_test + sf_ulp_incl_test + sf_zeta_incl_test + sf_chebyshev_incl_test + sf_chebyshev_transform_incl_test + sf_fibonacci_incl_test + #sf_gegenbauer_incl_test + sf_lambert_w_incl_test + sf_nonfinite_num_facets_incl_test + sf_airy_incl_test + sf_hankel_incl_test + sf_jacobi_incl_test + sf_owens_t_incl_test + dist_skew_norm_incl_test + constants_incl_test + quad_trapezoidal_incl_test + test_traits + tools_config_inc_test + tools_fraction_inc_test + tools_minima_inc_test + tools_polynomial_inc_test + tools_precision_inc_test + tools_rational_inc_test + tools_real_cast_inc_test + tools_remez_inc_test + tools_roots_inc_test + tools_series_inc_test + tools_solve_inc_test + tools_stats_inc_test + tools_test_data_inc_test + #tools_test_inc_test + tools_toms748_inc_test + tools_agm_incl_test + tools_assert_incl_test + tools_atomic_incl_test + tools_big_constant_incl_test + #tools_centered_continued_fraction_incl_test + tools_cohen_acceleration_incl_test + tools_complex_incl_test + tools_condition_numbers_incl_test + tools_convert_from_string_incl_test + tools_cxx03_warn_incl_test + #tools_engel_expansion_incl_test + tools_header_deprecated_incl_test + tools_is_detected_incl_test + #tools_luroth_expansion_incl_test + tools_mp_incl_test + tools_norms_incl_test + tools_polynomial_gcd_incl_test + tools_promotion_incl_test + tools_random_vector_incl_test + #tools_simple_continued_fraction_incl_test + tools_test_value_incl_test + tools_throw_exception_incl_test + tools_traits_incl_test + #tools_ulps_plot_incl_test + tools_workaround_incl_test +; + +explicit no_eh_tests ; \ No newline at end of file From 6869066581b4736cb66df2bba49e7ab72ca521d4 Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Mon, 16 May 2022 18:24:06 +0100 Subject: [PATCH 06/17] Disable chebeshev_transform testing in no-eh mode. Doesn't easily support exception handling free compilation. --- test/Jamfile.v2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index dddf47c879..2719709923 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -1570,7 +1570,7 @@ alias no_eh_tests : sf_ulp_incl_test sf_zeta_incl_test sf_chebyshev_incl_test - sf_chebyshev_transform_incl_test + #sf_chebyshev_transform_incl_test sf_fibonacci_incl_test #sf_gegenbauer_incl_test sf_lambert_w_incl_test From 0edd1a23002656e977233258ab5e985251f6ca56 Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Mon, 16 May 2022 18:25:23 +0100 Subject: [PATCH 07/17] Try building with -j2 in ubuntu-22 CI. Otherwise we see the VM abort with out-of-memory errors. --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 46022f33e7..f6d46ae6b5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -75,7 +75,7 @@ jobs: run: ./config_info_travis working-directory: ../boost-root/libs/config/test - name: Test - run: ../../../b2 toolset=$TOOLSET ${{ matrix.suite }} define=CI_SUPPRESS_KNOWN_ISSUES define=SLOW_COMPILER + run: ../../../b2 -j2 toolset=$TOOLSET ${{ matrix.suite }} define=CI_SUPPRESS_KNOWN_ISSUES define=SLOW_COMPILER working-directory: ../boost-root/libs/math/test ubuntu-focal: runs-on: ubuntu-20.04 From 990704e8a94054777a1072d0c9578983265515ff Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Mon, 23 May 2022 12:14:09 +0100 Subject: [PATCH 08/17] Correct #include logic in test_hyperexponential_dist.cpp. [CI SKIP] --- test/test_hyperexponential_dist.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/test/test_hyperexponential_dist.cpp b/test/test_hyperexponential_dist.cpp index 7a30e77de2..c7d3c9843b 100644 --- a/test/test_hyperexponential_dist.cpp +++ b/test/test_hyperexponential_dist.cpp @@ -374,6 +374,15 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(special_cases, RealT, test_types) BOOST_CHECK_CLOSE(boost::math::mode(hexp2), boost::math::mode(exp2), tol); } +// Test C++20 ranges (Currently only GCC10 has full support to P0896R4) +#if (__cplusplus > 202000L || _MSVC_LANG > 202000L) && __has_include() && __GNUC__ >= 10 +// Support for ranges is broken using gcc 11.1 +#if __GNUC__ != 11 +#include +#include +#endif +#endif + BOOST_AUTO_TEST_CASE_TEMPLATE(error_cases, RealT, test_types) { typedef boost::math::hyperexponential_distribution dist_t; @@ -393,8 +402,6 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(error_cases, RealT, test_types) #if (__cplusplus > 202000L || _MSVC_LANG > 202000L) && __has_include() && __GNUC__ >= 10 // Support for ranges is broken using gcc 11.1 #if __GNUC__ != 11 - #include - #include std::array probs_array {1,2}; std::array rates_array {1,2,3}; From 81269470d59c4c6f23175453e8541dd5f2d67691 Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Tue, 24 May 2022 12:21:16 +0100 Subject: [PATCH 09/17] Split up 1F0 and 2F0 tests. Reduces compiler memory footprint of those test cases. --- test/Jamfile.v2 | 9 +++++++-- test/test_1F0.cpp | 6 ++++++ test/test_2F0.cpp | 9 ++++++++- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 2719709923..c7b3a79b06 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -92,8 +92,13 @@ cpp-pch pch_light : pch_light.hpp : ../../test/build//boost_unit_test_frame lib compile_test_main : compile_test/main.cpp ; test-suite special_fun : - [ run test_1F0.cpp ../../test/build//boost_unit_test_framework : : : [ requires cxx11_auto_declarations cxx11_lambdas cxx11_unified_initialization_syntax cxx11_smart_ptr ] ] # hypergeometric_pFq_checked_series.hpp uses auto, the rest are from quadrature tests. - [ run test_2F0.cpp ../../test/build//boost_unit_test_framework : : : [ requires cxx11_auto_declarations cxx11_lambdas cxx11_unified_initialization_syntax cxx11_smart_ptr ] [ check-target-builds ../config//has_float128 "GCC libquadmath and __float128 support" : BOOST_MATH_TEST_FLOAT128 "-Bstatic -lquadmath -Bdynamic" ] ] + [ run test_1F0.cpp ../../test/build//boost_unit_test_framework : : : [ requires cxx11_auto_declarations cxx11_lambdas cxx11_unified_initialization_syntax cxx11_smart_ptr ] TEST=1 : test_1F0_1 ] # hypergeometric_pFq_checked_series.hpp uses auto, the rest are from quadrature tests. + [ run test_1F0.cpp ../../test/build//boost_unit_test_framework : : : [ requires cxx11_auto_declarations cxx11_lambdas cxx11_unified_initialization_syntax cxx11_smart_ptr ] TEST=2 : test_1F0_2 ] # hypergeometric_pFq_checked_series.hpp uses auto, the rest are from quadrature tests. + [ run test_1F0.cpp ../../test/build//boost_unit_test_framework : : : [ requires cxx11_auto_declarations cxx11_lambdas cxx11_unified_initialization_syntax cxx11_smart_ptr ] TEST=3 : test_1F0_3 ] # hypergeometric_pFq_checked_series.hpp uses auto, the rest are from quadrature tests. + [ run test_2F0.cpp ../../test/build//boost_unit_test_framework : : : [ requires cxx11_auto_declarations cxx11_lambdas cxx11_unified_initialization_syntax cxx11_smart_ptr ] [ check-target-builds ../config//has_float128 "GCC libquadmath and __float128 support" : BOOST_MATH_TEST_FLOAT128 "-Bstatic -lquadmath -Bdynamic" ] TEST=1 : test_2F0_1 ] + [ run test_2F0.cpp ../../test/build//boost_unit_test_framework : : : [ requires cxx11_auto_declarations cxx11_lambdas cxx11_unified_initialization_syntax cxx11_smart_ptr ] [ check-target-builds ../config//has_float128 "GCC libquadmath and __float128 support" : BOOST_MATH_TEST_FLOAT128 "-Bstatic -lquadmath -Bdynamic" ] TEST=2 : test_2F0_2 ] + [ run test_2F0.cpp ../../test/build//boost_unit_test_framework : : : [ requires cxx11_auto_declarations cxx11_lambdas cxx11_unified_initialization_syntax cxx11_smart_ptr ] [ check-target-builds ../config//has_float128 "GCC libquadmath and __float128 support" : BOOST_MATH_TEST_FLOAT128 "-Bstatic -lquadmath -Bdynamic" ] TEST=3 : test_2F0_3 ] + [ run test_2F0.cpp ../../test/build//boost_unit_test_framework : : : [ requires cxx11_auto_declarations cxx11_lambdas cxx11_unified_initialization_syntax cxx11_smart_ptr ] [ check-target-builds ../config//has_float128 "GCC libquadmath and __float128 support" : BOOST_MATH_TEST_FLOAT128 "-Bstatic -lquadmath -Bdynamic" ] TEST=4 : test_2F0_4 ] [ run test_0F1.cpp ../../test/build//boost_unit_test_framework : : : [ requires cxx11_auto_declarations cxx11_lambdas cxx11_unified_initialization_syntax cxx11_smart_ptr ] TEST=1 : test_0F1_1 ] [ run test_0F1.cpp ../../test/build//boost_unit_test_framework : : : [ requires cxx11_auto_declarations cxx11_lambdas cxx11_unified_initialization_syntax cxx11_smart_ptr ] TEST=2 : test_0F1_2 ] diff --git a/test/test_1F0.cpp b/test/test_1F0.cpp index f99881da70..c32f253928 100644 --- a/test/test_1F0.cpp +++ b/test/test_1F0.cpp @@ -11,6 +11,7 @@ BOOST_AUTO_TEST_CASE( test_main ) { +#if !defined(TEST) || (TEST == 1) #ifndef BOOST_MATH_BUGGY_LARGE_FLOAT_CONSTANTS test_spots(0.0F); #endif @@ -21,8 +22,13 @@ BOOST_AUTO_TEST_CASE( test_main ) test_spots(boost::math::concepts::real_concept(0.1)); #endif #endif +#endif +#if !defined(TEST) || (TEST == 2) test_spots(boost::multiprecision::cpp_bin_float_quad()); +#endif +#if !defined(TEST) || (TEST == 3) test_spots(boost::multiprecision::cpp_dec_float_50()); +#endif } diff --git a/test/test_2F0.cpp b/test/test_2F0.cpp index 66b2fd9fb1..988ed9c0bd 100644 --- a/test/test_2F0.cpp +++ b/test/test_2F0.cpp @@ -82,21 +82,28 @@ BOOST_AUTO_TEST_CASE( test_main ) { expected_results(); BOOST_MATH_CONTROL_FP; - +#if !defined(TEST) || (TEST == 1) #ifndef BOOST_MATH_BUGGY_LARGE_FLOAT_CONSTANTS test_spots(0.0F, "float"); #endif test_spots(0.0, "double"); +#endif +#if !defined(TEST) || (TEST == 2) #ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS test_spots(0.0L, "long double"); #ifndef BOOST_MATH_NO_REAL_CONCEPT_TESTS test_spots(boost::math::concepts::real_concept(0.1), "real_concept"); #endif #endif +#endif #ifndef BOOST_MATH_NO_MP_TESTS using dec_40 = boost::multiprecision::number>; +#if !defined(TEST) || (TEST == 3) test_spots(boost::multiprecision::cpp_bin_float_quad(), "cpp_bin_float_quad"); +#endif +#if !defined(TEST) || (TEST == 4) test_spots(dec_40(), "dec_40"); #endif +#endif } From 536851add44d5890c16c3e39b875ddcab2bc013f Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Tue, 24 May 2022 16:47:48 +0100 Subject: [PATCH 10/17] Change naked throws to BOOST_MATH_THROW_EXCEPTION. --- include/boost/math/special_functions/chebyshev.hpp | 2 +- include/boost/math/tools/polynomial.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/boost/math/special_functions/chebyshev.hpp b/include/boost/math/special_functions/chebyshev.hpp index 66356ee012..2ea1560986 100644 --- a/include/boost/math/special_functions/chebyshev.hpp +++ b/include/boost/math/special_functions/chebyshev.hpp @@ -271,7 +271,7 @@ inline Real chebyshev_clenshaw_recurrence(const Real* const c, size_t length, co { if (x < a || x > b) { - throw std::domain_error("x in [a, b] is required."); + BOOST_MATH_THROW_EXCEPTION(std::domain_error("x in [a, b] is required.")); } if (length < 2) { diff --git a/include/boost/math/tools/polynomial.hpp b/include/boost/math/tools/polynomial.hpp index c2528b1da7..17e4362de2 100644 --- a/include/boost/math/tools/polynomial.hpp +++ b/include/boost/math/tools/polynomial.hpp @@ -360,7 +360,7 @@ class polynomial size_type degree() const { if (size() == 0) - throw std::logic_error("degree() is undefined for the zero polynomial."); + BOOST_MATH_THROW_EXCEPTION(std::logic_error("degree() is undefined for the zero polynomial.")); return m_data.size() - 1; } value_type& operator[](size_type i) From 3fa245da6d3f6229385cfc7f4928dc603e4e19ff Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Thu, 26 May 2022 12:11:27 +0100 Subject: [PATCH 11/17] Strip CI back to minimal failing test cases. In the hopes we might actually see some results on Github. --- .github/workflows/ci.yml | 470 +-------------------------------------- 1 file changed, 5 insertions(+), 465 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f6d46ae6b5..a4e58372af 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,9 +18,9 @@ jobs: strategy: fail-fast: false matrix: - compiler: [ g++-12, clang++-14 ] - standard: [ c++11, c++14, c++17, c++20 ] - suite: [ float128_tests, special_fun, distribution_tests, misc, quadrature, mp, interpolators, autodiff, ../example//examples, ../tools ] + compiler: [ g++-12 ] + standard: [ c++20 ] + suite: [ special_fun ] steps: - uses: actions/checkout@v2 with: @@ -77,77 +77,13 @@ jobs: - name: Test run: ../../../b2 -j2 toolset=$TOOLSET ${{ matrix.suite }} define=CI_SUPPRESS_KNOWN_ISSUES define=SLOW_COMPILER working-directory: ../boost-root/libs/math/test - ubuntu-focal: - runs-on: ubuntu-20.04 - strategy: - fail-fast: false - matrix: - compiler: [ g++-9, g++-11, clang++-10 ] - standard: [ c++11, c++14, c++17, c++2a ] - suite: [ float128_tests, special_fun, distribution_tests, misc, quadrature, mp, interpolators, autodiff, ../example//examples, ../tools ] - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: '0' - - uses: mstachniuk/ci-skip@v1 - with: - commit-filter: '[skip ci];[ci skip];[CI SKIP];[SKIP CI];***CI SKIP***;***SKIP CI***;[windows];[Windows];[WINDOWS];[apple];[Apple];[APPLE];[standalone];[STANDALONE];[cygwin];[CYGWIN]' - commit-filter-separator: ';' - fail-fast: true - - name: Set TOOLSET - run: echo ${{ matrix.compiler }} | awk '/^g/ { print "TOOLSET=gcc" } /^clang/ { print "TOOLSET=clang" }' >> $GITHUB_ENV - - name: Add repository - continue-on-error: true - id: addrepo - run: sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test" - - name: Retry Add Repo - continue-on-error: true - id: retry1 - if: steps.addrepo.outcome=='failure' - run: sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test" - - name: Retry Add Repo 2 - continue-on-error: true - id: retry2 - if: steps.retry1.outcome=='failure' - run: sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test" - - name: Install packages - run: sudo apt install g++-9 g++-11 clang-9 clang-10 libgmp-dev libmpfr-dev libfftw3-dev - - name: Checkout main boost - run: git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root - - name: Update tools/boostdep - run: git submodule update --init tools/boostdep - working-directory: ../boost-root - - name: Copy files - run: cp -r $GITHUB_WORKSPACE/* libs/math - working-directory: ../boost-root - - name: Install deps - run: python tools/boostdep/depinst/depinst.py math - working-directory: ../boost-root - - name: Bootstrap - run: ./bootstrap.sh - working-directory: ../boost-root - - name: Generate headers - run: ./b2 headers - working-directory: ../boost-root - - name: Generate user config - run: 'echo "using $TOOLSET : : ${{ matrix.compiler }} : -std=${{ matrix.standard }} ;" > ~/user-config.jam' - working-directory: ../boost-root - - name: Config info install - run: ../../../b2 config_info_travis_install toolset=$TOOLSET - working-directory: ../boost-root/libs/config/test - - name: Config info - run: ./config_info_travis - working-directory: ../boost-root/libs/config/test - - name: Test - run: ../../../b2 toolset=$TOOLSET ${{ matrix.suite }} define=CI_SUPPRESS_KNOWN_ISSUES define=SLOW_COMPILER - working-directory: ../boost-root/libs/math/test ubuntu-focal-no-eh: runs-on: ubuntu-20.04 strategy: fail-fast: false matrix: - compiler: [ g++-9, g++-11, clang++-10 ] - standard: [ c++11, c++14, c++17, c++2a ] + compiler: [ g++-9 ] + standard: [ c++14 ] steps: - uses: actions/checkout@v2 with: @@ -204,399 +140,3 @@ jobs: - name: Test run: ../../../b2 toolset=$TOOLSET no_eh_tests exception-handling=off rtti=off define=CI_SUPPRESS_KNOWN_ISSUES define=SLOW_COMPILER working-directory: ../boost-root/libs/math/test - ubuntu-bionic: - runs-on: ubuntu-18.04 - strategy: - fail-fast: false - matrix: - compiler: [ g++-6, clang++-6.0, g++-7, g++-8, clang++-7, clang++-8 ] - standard: [ c++11, c++14, c++17 ] - suite: [ float128_tests, special_fun, distribution_tests, misc, quadrature, mp, interpolators, autodiff, ../example//examples, ../tools ] - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: '0' - - uses: mstachniuk/ci-skip@v1 - with: - commit-filter: '[skip ci];[ci skip];[CI SKIP];[SKIP CI];***CI SKIP***;***SKIP CI***;[windows];[Windows];[WINDOWS];[apple];[Apple];[APPLE];[standalone];[STANDALONE];[cygwin];[CYGWIN]' - commit-filter-separator: ';' - fail-fast: true - - name: Set TOOLSET - run: echo ${{ matrix.compiler }} | awk '/^g/ { print "TOOLSET=gcc" } /^clang/ { print "TOOLSET=clang" }' >> $GITHUB_ENV - - name: Add repository - continue-on-error: true - id: addrepo - run: sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test" - - name: Retry Add Repo - continue-on-error: true - id: retry1 - if: steps.addrepo.outcome=='failure' - run: sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test" - - name: Retry Add Repo 2 - continue-on-error: true - id: retry2 - if: steps.retry1.outcome=='failure' - run: sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test" - - name: Install packages - run: sudo apt install g++-6 g++-7 g++-8 clang-6.0 clang-7 clang-8 libgmp-dev libmpfr-dev libfftw3-dev - - name: Checkout main boost - run: git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root - - name: Update tools/boostdep - run: git submodule update --init tools/boostdep - working-directory: ../boost-root - - name: Copy files - run: cp -r $GITHUB_WORKSPACE/* libs/math - working-directory: ../boost-root - - name: Install deps - run: python tools/boostdep/depinst/depinst.py math - working-directory: ../boost-root - - name: Bootstrap - run: ./bootstrap.sh - working-directory: ../boost-root - - name: Generate headers - run: ./b2 headers - working-directory: ../boost-root - - name: Generate user config - run: 'echo "using $TOOLSET : : ${{ matrix.compiler }} : -std=${{ matrix.standard }} ;" > ~/user-config.jam' - working-directory: ../boost-root - - name: Config info install - run: ../../../b2 config_info_travis_install toolset=$TOOLSET - working-directory: ../boost-root/libs/config/test - - name: Config info - run: ./config_info_travis - working-directory: ../boost-root/libs/config/test - - name: Test - run: ../../../b2 toolset=$TOOLSET ${{ matrix.suite }} define=CI_SUPPRESS_KNOWN_ISSUES define=SLOW_COMPILER - working-directory: ../boost-root/libs/math/test - macos: - runs-on: macos-latest - strategy: - fail-fast: false - matrix: - toolset: [ clang ] - standard: [ 11, 14, 17, 2a ] - suite: [ float128_tests, special_fun, distribution_tests, misc, quadrature, mp, interpolators, autodiff, ../example//examples, ../tools ] - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: '0' - - uses: mstachniuk/ci-skip@v1 - with: - commit-filter: '[skip ci];[ci skip];[CI SKIP];[SKIP CI];***CI SKIP***;***SKIP CI***;[windows];[Windows];[WINDOWS];[linux];[Linux];[LINUX];[standalone];[STANDALONE];[cygwin];[CYGWIN]' - commit-filter-separator: ';' - fail-fast: true - - name: Checkout main boost - run: git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root - - name: Update tools/boostdep - run: git submodule update --init tools/boostdep - working-directory: ../boost-root - - name: Copy files - run: cp -r $GITHUB_WORKSPACE/* libs/math - working-directory: ../boost-root - - name: Install deps - run: python tools/boostdep/depinst/depinst.py math - working-directory: ../boost-root - - name: Bootstrap - run: ./bootstrap.sh - working-directory: ../boost-root - - name: Generate headers - run: ./b2 headers - working-directory: ../boost-root - - name: Config info install - run: ../../../b2 config_info_travis_install toolset=${{ matrix.toolset }} cxxstd=${{ matrix.standard }} - working-directory: ../boost-root/libs/config/test - - name: Config info - run: ./config_info_travis - working-directory: ../boost-root/libs/config/test - - name: Test - run: ../../../b2 toolset=${{ matrix.toolset }} cxxstd=${{ matrix.standard }} ${{ matrix.suite }} define=CI_SUPPRESS_KNOWN_ISSUES define=SLOW_COMPILER - working-directory: ../boost-root/libs/math/test - windows: - runs-on: windows-2019 - defaults: - run: - shell: cmd - env: - ARGS: toolset=${{ matrix.toolset }} address-model=64 cxxstd=${{ matrix.standard }} - strategy: - fail-fast: false - matrix: - toolset: [ gcc, msvc-14.0, msvc-14.2 ] - standard: [ 11, 14, 17 ] - suite: [ float128_tests, special_fun, distribution_tests, misc, quadrature, mp, interpolators, autodiff, ../example//examples, ../tools ] - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: '0' - - uses: mstachniuk/ci-skip@v1 - with: - commit-filter: '[skip ci];[ci skip];[CI SKIP];[SKIP CI];***CI SKIP***;***SKIP CI***;[apple];[Apple];[APPLE];[linux];[Linux];[LINUX];[standalone];[STANDALONE];[cygwin];[CYGWIN]' - commit-filter-separator: ';' - fail-fast: true - - name: Checkout main boost - run: git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root - - name: Update tools/boostdep - run: git submodule update --init tools/boostdep - working-directory: ../boost-root - - name: Copy files - run: xcopy /s /e /q %GITHUB_WORKSPACE% libs\math - working-directory: ../boost-root - - name: Install deps - run: python tools/boostdep/depinst/depinst.py math - working-directory: ../boost-root - - name: Bootstrap - run: bootstrap - working-directory: ../boost-root - - name: Generate headers - run: b2 headers - working-directory: ../boost-root - - name: Config info install - run: ..\..\..\b2 config_info_travis_install %ARGS% - working-directory: ../boost-root/libs/config/test - - name: Config info - run: config_info_travis - working-directory: ../boost-root/libs/config/test - - name: Test - run: ..\..\..\b2 --hash %ARGS% define=CI_SUPPRESS_KNOWN_ISSUES ${{ matrix.suite }} - working-directory: ../boost-root/libs/math/test - MSVC2022: - runs-on: windows-2022 - defaults: - run: - shell: cmd - env: - ARGS: address-model=64 cxxstd=${{ matrix.standard }} - strategy: - fail-fast: false - matrix: - standard: [ 14, 17, 20 ] - suite: [ float128_tests, special_fun, distribution_tests, misc, quadrature, mp, interpolators, autodiff, ../example//examples, ../tools ] - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: '0' - - uses: mstachniuk/ci-skip@v1 - with: - commit-filter: '[skip ci];[ci skip];[CI SKIP];[SKIP CI];***CI SKIP***;***SKIP CI***;[apple];[Apple];[APPLE];[linux];[Linux];[LINUX];[standalone];[STANDALONE]' - commit-filter-separator: ';' - fail-fast: true - - name: Checkout main boost - run: git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root - - name: Update tools/boostdep - run: git submodule update --init tools/boostdep - working-directory: ../boost-root - - name: Copy files - run: xcopy /s /e /q %GITHUB_WORKSPACE% libs\math - working-directory: ../boost-root - - name: Install deps - run: python tools/boostdep/depinst/depinst.py math - working-directory: ../boost-root - - name: Bootstrap - run: bootstrap - working-directory: ../boost-root - - name: Generate headers - run: b2 headers - working-directory: ../boost-root - - name: Config info install - run: ..\..\..\b2 config_info_travis_install %ARGS% - working-directory: ../boost-root/libs/config/test - - name: Config info - run: config_info_travis - working-directory: ../boost-root/libs/config/test - - name: Test - run: ..\..\..\b2 --hash %ARGS% define=CI_SUPPRESS_KNOWN_ISSUES ${{ matrix.suite }} - working-directory: ../boost-root/libs/math/test - cygwin: - runs-on: windows-latest - strategy: - fail-fast: false - matrix: - compiler: [ g++-11 ] - standard: [ c++17 ] - suite: [ float128_tests, special_fun, distribution_tests, misc, quadrature, mp, interpolators, autodiff, ../example//examples, ../tools ] - env: - TOOLSET: gcc - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: '0' - - uses: mstachniuk/ci-skip@v1 - with: - commit-filter: '[skip ci];[ci skip];[CI SKIP];[SKIP CI];***CI SKIP***;***SKIP CI***;[apple];[Apple];[APPLE];[linux];[Linux];[LINUX];[standalone];[STANDALONE]' - commit-filter-separator: ';' - fail-fast: true - - name: Install Cygwin - run: | - choco install git gcc-core gcc-g++ python39 libgmp-devel libmpfr-devel libfftw3-devel --source cygwin - - name: Checkout main boost - run: C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root' - - name: Update tools/boostdep - run: C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE")/../boost-root && git submodule update --init tools/boostdep' - - name: Copy files - run: C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && cp -r * ../boost-root/libs/math' - - name: Install deps - run: C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE")/../boost-root && python tools/boostdep/depinst/depinst.py math' - - name: Bootstrap - run: C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE")/../boost-root && ./bootstrap.sh' - - name: Generate headers - run: C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE")/../boost-root && ./b2 headers' - - name: Config info install - run: C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE")/../boost-root/libs/config/test && ../../../b2 config_info_travis_install toolset=$TOOLSET' - - name: Config info - run: C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE")/../boost-root/libs/config/test && ./config_info_travis' - - name: Test - run: C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE")/../boost-root/libs/math/test && ../../../b2 toolset=$TOOLSET ${{ matrix.suite }} define=CI_SUPPRESS_KNOWN_ISSUES define=SLOW_COMPILER' - standalone-compile-tests-gcc: - runs-on: ubuntu-20.04 - strategy: - fail-fast: false - matrix: - compiler: [ g++-10 ] - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: '0' - - uses: mstachniuk/ci-skip@v1 - with: - commit-filter: '[skip ci];[ci skip];[CI SKIP];[SKIP CI];***CI SKIP***;***SKIP CI***;[windows];[Windows];[WINDOWS];[apple];[Apple];[APPLE];[cygwin];[CYGWIN]' - commit-filter-separator: ';' - fail-fast: true - - name: Add repository - continue-on-error: true - id: addrepo - run: sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test" - - name: Retry Add Repo - continue-on-error: true - id: retry1 - if: steps.addrepo.outcome=='failure' - run: sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test" - - name: Retry Add Repo 2 - continue-on-error: true - id: retry2 - if: steps.retry1.outcome=='failure' - run: sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test" - - name: Install packages - run: sudo apt install g++-10 libgmp-dev libmpfr-dev libfftw3-dev - - name: Checkout main boost - run: git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root - - name: Update tools/boostdep - run: git submodule update --init tools/boostdep - working-directory: ../boost-root - - name: Copy files - run: cp -r $GITHUB_WORKSPACE/* libs/math - working-directory: ../boost-root - - name: Run CMake - run: cmake -DBUILD_TESTING=1 -DCMAKE_CXX_COMPILER=g++-10 . - working-directory: ../boost-root/libs/math - - name: Run Compile Tests - run: make -j$((`nproc`+1)) - working-directory: ../boost-root/libs/math - standalone-compile-tests-clang: - runs-on: ubuntu-20.04 - strategy: - fail-fast: false - matrix: - compiler: [ clang++-10 ] - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: '0' - - uses: mstachniuk/ci-skip@v1 - with: - commit-filter: '[skip ci];[ci skip];[CI SKIP];[SKIP CI];***CI SKIP***;***SKIP CI***;[windows];[Windows];[WINDOWS];[apple];[Apple];[APPLE];[cygwin];[CYGWIN]' - commit-filter-separator: ';' - fail-fast: true - - name: Add repository - continue-on-error: true - id: addrepo - run: sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test" - - name: Retry Add Repo - continue-on-error: true - id: retry1 - if: steps.addrepo.outcome=='failure' - run: sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test" - - name: Retry Add Repo 2 - continue-on-error: true - id: retry2 - if: steps.retry1.outcome=='failure' - run: sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test" - - name: Install packages - run: sudo apt install clang-10 libgmp-dev libmpfr-dev libfftw3-dev - - name: Checkout main boost - run: git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root - - name: Update tools/boostdep - run: git submodule update --init tools/boostdep - working-directory: ../boost-root - - name: Copy files - run: cp -r $GITHUB_WORKSPACE/* libs/math - working-directory: ../boost-root - - name: Run CMake - run: cmake -DBUILD_TESTING=1 -DCMAKE_CXX_COMPILER=clang++-10 . - working-directory: ../boost-root/libs/math - - name: Run Compile Tests - run: make -j$((`nproc`+1)) - working-directory: ../boost-root/libs/math - standalone-gcc: - runs-on: ubuntu-20.04 - strategy: - fail-fast: false - matrix: - compiler: [ g++-10 ] - standard: [ c++11, c++14, c++17, c++2a ] - suite: [ float128_tests, special_fun, distribution_tests, misc, quadrature, interpolators, autodiff, ../example//examples, ../tools ] - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: '0' - - uses: mstachniuk/ci-skip@v1 - with: - commit-filter: '[skip ci];[ci skip];[CI SKIP];[SKIP CI];***CI SKIP***;***SKIP CI***;[windows];[Windows];[WINDOWS];[apple];[Apple];[APPLE];[standalone];[STANDALONE]' - commit-filter-separator: ';' - fail-fast: true - - name: Set TOOLSET - run: echo ${{ matrix.compiler }} | awk '/^g/ { print "TOOLSET=gcc" } /^clang/ { print "TOOLSET=clang" }' >> $GITHUB_ENV - - name: Add repository - continue-on-error: true - id: addrepo - run: sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test" - - name: Retry Add Repo - continue-on-error: true - id: retry1 - if: steps.addrepo.outcome=='failure' - run: sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test" - - name: Retry Add Repo 2 - continue-on-error: true - id: retry2 - if: steps.retry1.outcome=='failure' - run: sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test" - - name: Install packages - run: sudo apt install g++-10 libgmp-dev libmpfr-dev libfftw3-dev - - name: Checkout main boost - run: git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root - - name: Update tools/boostdep - run: git submodule update --init tools/boostdep - working-directory: ../boost-root - - name: Copy files - run: cp -r $GITHUB_WORKSPACE/* libs/math - working-directory: ../boost-root - - name: Install deps - run: python tools/boostdep/depinst/depinst.py math - working-directory: ../boost-root - - name: Bootstrap - run: ./bootstrap.sh - working-directory: ../boost-root - - name: Generate headers - run: ./b2 headers - working-directory: ../boost-root - - name: Generate user config - run: 'echo "using $TOOLSET : : ${{ matrix.compiler }} : -std=${{ matrix.standard }} ;" > ~/user-config.jam' - working-directory: ../boost-root - - name: Config info install - run: ../../../b2 config_info_travis_install toolset=$TOOLSET - working-directory: ../boost-root/libs/config/test - - name: Config info - run: ./config_info_travis - working-directory: ../boost-root/libs/config/test - - name: Test - run: ../../../b2 toolset=$TOOLSET ${{ matrix.suite }} define=CI_SUPPRESS_KNOWN_ISSUES define=SLOW_COMPILER define=BOOST_MATH_STANDALONE define=BOOST_MP_STANDALONE - working-directory: ../boost-root/libs/math/test From 355237efeb6d0dfb40b988fdbadfa5fee310e843 Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Thu, 26 May 2022 12:59:56 +0100 Subject: [PATCH 12/17] Add missing #include to chebeshev.hpp. --- include/boost/math/special_functions/chebyshev.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/include/boost/math/special_functions/chebyshev.hpp b/include/boost/math/special_functions/chebyshev.hpp index 2ea1560986..7aff765e6f 100644 --- a/include/boost/math/special_functions/chebyshev.hpp +++ b/include/boost/math/special_functions/chebyshev.hpp @@ -10,6 +10,7 @@ #include #include #include +#include #if (__cplusplus > 201103) || (defined(_CPPLIB_VER) && (_CPPLIB_VER >= 610)) # define BOOST_MATH_CHEB_USE_STD_ACOSH From 378b6a2273ac57b072c5ea40aca513c12a615472 Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Thu, 26 May 2022 13:02:35 +0100 Subject: [PATCH 13/17] Disable gcc-12 C++20 testing as it runs the machine out of memory compiling test_2F0.cpp. --- test/test_2F0.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/test_2F0.cpp b/test/test_2F0.cpp index 988ed9c0bd..9c951bfdd8 100644 --- a/test/test_2F0.cpp +++ b/test/test_2F0.cpp @@ -97,6 +97,11 @@ BOOST_AUTO_TEST_CASE( test_main ) #endif #endif +#if defined(__GNUC__) && (__GNUC__ == 12) && (__cplusplus > 202000) + // gcc-12 runs the machine out of memory in C++20 mode: +#define BOOST_MATH_NO_MP_TESTS +#endif + #ifndef BOOST_MATH_NO_MP_TESTS using dec_40 = boost::multiprecision::number>; #if !defined(TEST) || (TEST == 3) From 17813330e5544ca4b620a61aae288c0f644cbfa1 Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Thu, 26 May 2022 16:43:26 +0100 Subject: [PATCH 14/17] Revert "Strip CI back to minimal failing test cases." This reverts commit 3fa245da6d3f6229385cfc7f4928dc603e4e19ff. --- .github/workflows/ci.yml | 470 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 465 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a4e58372af..f6d46ae6b5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,9 +18,9 @@ jobs: strategy: fail-fast: false matrix: - compiler: [ g++-12 ] - standard: [ c++20 ] - suite: [ special_fun ] + compiler: [ g++-12, clang++-14 ] + standard: [ c++11, c++14, c++17, c++20 ] + suite: [ float128_tests, special_fun, distribution_tests, misc, quadrature, mp, interpolators, autodiff, ../example//examples, ../tools ] steps: - uses: actions/checkout@v2 with: @@ -77,13 +77,77 @@ jobs: - name: Test run: ../../../b2 -j2 toolset=$TOOLSET ${{ matrix.suite }} define=CI_SUPPRESS_KNOWN_ISSUES define=SLOW_COMPILER working-directory: ../boost-root/libs/math/test + ubuntu-focal: + runs-on: ubuntu-20.04 + strategy: + fail-fast: false + matrix: + compiler: [ g++-9, g++-11, clang++-10 ] + standard: [ c++11, c++14, c++17, c++2a ] + suite: [ float128_tests, special_fun, distribution_tests, misc, quadrature, mp, interpolators, autodiff, ../example//examples, ../tools ] + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: '0' + - uses: mstachniuk/ci-skip@v1 + with: + commit-filter: '[skip ci];[ci skip];[CI SKIP];[SKIP CI];***CI SKIP***;***SKIP CI***;[windows];[Windows];[WINDOWS];[apple];[Apple];[APPLE];[standalone];[STANDALONE];[cygwin];[CYGWIN]' + commit-filter-separator: ';' + fail-fast: true + - name: Set TOOLSET + run: echo ${{ matrix.compiler }} | awk '/^g/ { print "TOOLSET=gcc" } /^clang/ { print "TOOLSET=clang" }' >> $GITHUB_ENV + - name: Add repository + continue-on-error: true + id: addrepo + run: sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test" + - name: Retry Add Repo + continue-on-error: true + id: retry1 + if: steps.addrepo.outcome=='failure' + run: sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test" + - name: Retry Add Repo 2 + continue-on-error: true + id: retry2 + if: steps.retry1.outcome=='failure' + run: sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test" + - name: Install packages + run: sudo apt install g++-9 g++-11 clang-9 clang-10 libgmp-dev libmpfr-dev libfftw3-dev + - name: Checkout main boost + run: git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root + - name: Update tools/boostdep + run: git submodule update --init tools/boostdep + working-directory: ../boost-root + - name: Copy files + run: cp -r $GITHUB_WORKSPACE/* libs/math + working-directory: ../boost-root + - name: Install deps + run: python tools/boostdep/depinst/depinst.py math + working-directory: ../boost-root + - name: Bootstrap + run: ./bootstrap.sh + working-directory: ../boost-root + - name: Generate headers + run: ./b2 headers + working-directory: ../boost-root + - name: Generate user config + run: 'echo "using $TOOLSET : : ${{ matrix.compiler }} : -std=${{ matrix.standard }} ;" > ~/user-config.jam' + working-directory: ../boost-root + - name: Config info install + run: ../../../b2 config_info_travis_install toolset=$TOOLSET + working-directory: ../boost-root/libs/config/test + - name: Config info + run: ./config_info_travis + working-directory: ../boost-root/libs/config/test + - name: Test + run: ../../../b2 toolset=$TOOLSET ${{ matrix.suite }} define=CI_SUPPRESS_KNOWN_ISSUES define=SLOW_COMPILER + working-directory: ../boost-root/libs/math/test ubuntu-focal-no-eh: runs-on: ubuntu-20.04 strategy: fail-fast: false matrix: - compiler: [ g++-9 ] - standard: [ c++14 ] + compiler: [ g++-9, g++-11, clang++-10 ] + standard: [ c++11, c++14, c++17, c++2a ] steps: - uses: actions/checkout@v2 with: @@ -140,3 +204,399 @@ jobs: - name: Test run: ../../../b2 toolset=$TOOLSET no_eh_tests exception-handling=off rtti=off define=CI_SUPPRESS_KNOWN_ISSUES define=SLOW_COMPILER working-directory: ../boost-root/libs/math/test + ubuntu-bionic: + runs-on: ubuntu-18.04 + strategy: + fail-fast: false + matrix: + compiler: [ g++-6, clang++-6.0, g++-7, g++-8, clang++-7, clang++-8 ] + standard: [ c++11, c++14, c++17 ] + suite: [ float128_tests, special_fun, distribution_tests, misc, quadrature, mp, interpolators, autodiff, ../example//examples, ../tools ] + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: '0' + - uses: mstachniuk/ci-skip@v1 + with: + commit-filter: '[skip ci];[ci skip];[CI SKIP];[SKIP CI];***CI SKIP***;***SKIP CI***;[windows];[Windows];[WINDOWS];[apple];[Apple];[APPLE];[standalone];[STANDALONE];[cygwin];[CYGWIN]' + commit-filter-separator: ';' + fail-fast: true + - name: Set TOOLSET + run: echo ${{ matrix.compiler }} | awk '/^g/ { print "TOOLSET=gcc" } /^clang/ { print "TOOLSET=clang" }' >> $GITHUB_ENV + - name: Add repository + continue-on-error: true + id: addrepo + run: sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test" + - name: Retry Add Repo + continue-on-error: true + id: retry1 + if: steps.addrepo.outcome=='failure' + run: sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test" + - name: Retry Add Repo 2 + continue-on-error: true + id: retry2 + if: steps.retry1.outcome=='failure' + run: sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test" + - name: Install packages + run: sudo apt install g++-6 g++-7 g++-8 clang-6.0 clang-7 clang-8 libgmp-dev libmpfr-dev libfftw3-dev + - name: Checkout main boost + run: git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root + - name: Update tools/boostdep + run: git submodule update --init tools/boostdep + working-directory: ../boost-root + - name: Copy files + run: cp -r $GITHUB_WORKSPACE/* libs/math + working-directory: ../boost-root + - name: Install deps + run: python tools/boostdep/depinst/depinst.py math + working-directory: ../boost-root + - name: Bootstrap + run: ./bootstrap.sh + working-directory: ../boost-root + - name: Generate headers + run: ./b2 headers + working-directory: ../boost-root + - name: Generate user config + run: 'echo "using $TOOLSET : : ${{ matrix.compiler }} : -std=${{ matrix.standard }} ;" > ~/user-config.jam' + working-directory: ../boost-root + - name: Config info install + run: ../../../b2 config_info_travis_install toolset=$TOOLSET + working-directory: ../boost-root/libs/config/test + - name: Config info + run: ./config_info_travis + working-directory: ../boost-root/libs/config/test + - name: Test + run: ../../../b2 toolset=$TOOLSET ${{ matrix.suite }} define=CI_SUPPRESS_KNOWN_ISSUES define=SLOW_COMPILER + working-directory: ../boost-root/libs/math/test + macos: + runs-on: macos-latest + strategy: + fail-fast: false + matrix: + toolset: [ clang ] + standard: [ 11, 14, 17, 2a ] + suite: [ float128_tests, special_fun, distribution_tests, misc, quadrature, mp, interpolators, autodiff, ../example//examples, ../tools ] + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: '0' + - uses: mstachniuk/ci-skip@v1 + with: + commit-filter: '[skip ci];[ci skip];[CI SKIP];[SKIP CI];***CI SKIP***;***SKIP CI***;[windows];[Windows];[WINDOWS];[linux];[Linux];[LINUX];[standalone];[STANDALONE];[cygwin];[CYGWIN]' + commit-filter-separator: ';' + fail-fast: true + - name: Checkout main boost + run: git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root + - name: Update tools/boostdep + run: git submodule update --init tools/boostdep + working-directory: ../boost-root + - name: Copy files + run: cp -r $GITHUB_WORKSPACE/* libs/math + working-directory: ../boost-root + - name: Install deps + run: python tools/boostdep/depinst/depinst.py math + working-directory: ../boost-root + - name: Bootstrap + run: ./bootstrap.sh + working-directory: ../boost-root + - name: Generate headers + run: ./b2 headers + working-directory: ../boost-root + - name: Config info install + run: ../../../b2 config_info_travis_install toolset=${{ matrix.toolset }} cxxstd=${{ matrix.standard }} + working-directory: ../boost-root/libs/config/test + - name: Config info + run: ./config_info_travis + working-directory: ../boost-root/libs/config/test + - name: Test + run: ../../../b2 toolset=${{ matrix.toolset }} cxxstd=${{ matrix.standard }} ${{ matrix.suite }} define=CI_SUPPRESS_KNOWN_ISSUES define=SLOW_COMPILER + working-directory: ../boost-root/libs/math/test + windows: + runs-on: windows-2019 + defaults: + run: + shell: cmd + env: + ARGS: toolset=${{ matrix.toolset }} address-model=64 cxxstd=${{ matrix.standard }} + strategy: + fail-fast: false + matrix: + toolset: [ gcc, msvc-14.0, msvc-14.2 ] + standard: [ 11, 14, 17 ] + suite: [ float128_tests, special_fun, distribution_tests, misc, quadrature, mp, interpolators, autodiff, ../example//examples, ../tools ] + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: '0' + - uses: mstachniuk/ci-skip@v1 + with: + commit-filter: '[skip ci];[ci skip];[CI SKIP];[SKIP CI];***CI SKIP***;***SKIP CI***;[apple];[Apple];[APPLE];[linux];[Linux];[LINUX];[standalone];[STANDALONE];[cygwin];[CYGWIN]' + commit-filter-separator: ';' + fail-fast: true + - name: Checkout main boost + run: git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root + - name: Update tools/boostdep + run: git submodule update --init tools/boostdep + working-directory: ../boost-root + - name: Copy files + run: xcopy /s /e /q %GITHUB_WORKSPACE% libs\math + working-directory: ../boost-root + - name: Install deps + run: python tools/boostdep/depinst/depinst.py math + working-directory: ../boost-root + - name: Bootstrap + run: bootstrap + working-directory: ../boost-root + - name: Generate headers + run: b2 headers + working-directory: ../boost-root + - name: Config info install + run: ..\..\..\b2 config_info_travis_install %ARGS% + working-directory: ../boost-root/libs/config/test + - name: Config info + run: config_info_travis + working-directory: ../boost-root/libs/config/test + - name: Test + run: ..\..\..\b2 --hash %ARGS% define=CI_SUPPRESS_KNOWN_ISSUES ${{ matrix.suite }} + working-directory: ../boost-root/libs/math/test + MSVC2022: + runs-on: windows-2022 + defaults: + run: + shell: cmd + env: + ARGS: address-model=64 cxxstd=${{ matrix.standard }} + strategy: + fail-fast: false + matrix: + standard: [ 14, 17, 20 ] + suite: [ float128_tests, special_fun, distribution_tests, misc, quadrature, mp, interpolators, autodiff, ../example//examples, ../tools ] + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: '0' + - uses: mstachniuk/ci-skip@v1 + with: + commit-filter: '[skip ci];[ci skip];[CI SKIP];[SKIP CI];***CI SKIP***;***SKIP CI***;[apple];[Apple];[APPLE];[linux];[Linux];[LINUX];[standalone];[STANDALONE]' + commit-filter-separator: ';' + fail-fast: true + - name: Checkout main boost + run: git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root + - name: Update tools/boostdep + run: git submodule update --init tools/boostdep + working-directory: ../boost-root + - name: Copy files + run: xcopy /s /e /q %GITHUB_WORKSPACE% libs\math + working-directory: ../boost-root + - name: Install deps + run: python tools/boostdep/depinst/depinst.py math + working-directory: ../boost-root + - name: Bootstrap + run: bootstrap + working-directory: ../boost-root + - name: Generate headers + run: b2 headers + working-directory: ../boost-root + - name: Config info install + run: ..\..\..\b2 config_info_travis_install %ARGS% + working-directory: ../boost-root/libs/config/test + - name: Config info + run: config_info_travis + working-directory: ../boost-root/libs/config/test + - name: Test + run: ..\..\..\b2 --hash %ARGS% define=CI_SUPPRESS_KNOWN_ISSUES ${{ matrix.suite }} + working-directory: ../boost-root/libs/math/test + cygwin: + runs-on: windows-latest + strategy: + fail-fast: false + matrix: + compiler: [ g++-11 ] + standard: [ c++17 ] + suite: [ float128_tests, special_fun, distribution_tests, misc, quadrature, mp, interpolators, autodiff, ../example//examples, ../tools ] + env: + TOOLSET: gcc + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: '0' + - uses: mstachniuk/ci-skip@v1 + with: + commit-filter: '[skip ci];[ci skip];[CI SKIP];[SKIP CI];***CI SKIP***;***SKIP CI***;[apple];[Apple];[APPLE];[linux];[Linux];[LINUX];[standalone];[STANDALONE]' + commit-filter-separator: ';' + fail-fast: true + - name: Install Cygwin + run: | + choco install git gcc-core gcc-g++ python39 libgmp-devel libmpfr-devel libfftw3-devel --source cygwin + - name: Checkout main boost + run: C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root' + - name: Update tools/boostdep + run: C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE")/../boost-root && git submodule update --init tools/boostdep' + - name: Copy files + run: C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && cp -r * ../boost-root/libs/math' + - name: Install deps + run: C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE")/../boost-root && python tools/boostdep/depinst/depinst.py math' + - name: Bootstrap + run: C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE")/../boost-root && ./bootstrap.sh' + - name: Generate headers + run: C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE")/../boost-root && ./b2 headers' + - name: Config info install + run: C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE")/../boost-root/libs/config/test && ../../../b2 config_info_travis_install toolset=$TOOLSET' + - name: Config info + run: C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE")/../boost-root/libs/config/test && ./config_info_travis' + - name: Test + run: C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE")/../boost-root/libs/math/test && ../../../b2 toolset=$TOOLSET ${{ matrix.suite }} define=CI_SUPPRESS_KNOWN_ISSUES define=SLOW_COMPILER' + standalone-compile-tests-gcc: + runs-on: ubuntu-20.04 + strategy: + fail-fast: false + matrix: + compiler: [ g++-10 ] + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: '0' + - uses: mstachniuk/ci-skip@v1 + with: + commit-filter: '[skip ci];[ci skip];[CI SKIP];[SKIP CI];***CI SKIP***;***SKIP CI***;[windows];[Windows];[WINDOWS];[apple];[Apple];[APPLE];[cygwin];[CYGWIN]' + commit-filter-separator: ';' + fail-fast: true + - name: Add repository + continue-on-error: true + id: addrepo + run: sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test" + - name: Retry Add Repo + continue-on-error: true + id: retry1 + if: steps.addrepo.outcome=='failure' + run: sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test" + - name: Retry Add Repo 2 + continue-on-error: true + id: retry2 + if: steps.retry1.outcome=='failure' + run: sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test" + - name: Install packages + run: sudo apt install g++-10 libgmp-dev libmpfr-dev libfftw3-dev + - name: Checkout main boost + run: git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root + - name: Update tools/boostdep + run: git submodule update --init tools/boostdep + working-directory: ../boost-root + - name: Copy files + run: cp -r $GITHUB_WORKSPACE/* libs/math + working-directory: ../boost-root + - name: Run CMake + run: cmake -DBUILD_TESTING=1 -DCMAKE_CXX_COMPILER=g++-10 . + working-directory: ../boost-root/libs/math + - name: Run Compile Tests + run: make -j$((`nproc`+1)) + working-directory: ../boost-root/libs/math + standalone-compile-tests-clang: + runs-on: ubuntu-20.04 + strategy: + fail-fast: false + matrix: + compiler: [ clang++-10 ] + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: '0' + - uses: mstachniuk/ci-skip@v1 + with: + commit-filter: '[skip ci];[ci skip];[CI SKIP];[SKIP CI];***CI SKIP***;***SKIP CI***;[windows];[Windows];[WINDOWS];[apple];[Apple];[APPLE];[cygwin];[CYGWIN]' + commit-filter-separator: ';' + fail-fast: true + - name: Add repository + continue-on-error: true + id: addrepo + run: sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test" + - name: Retry Add Repo + continue-on-error: true + id: retry1 + if: steps.addrepo.outcome=='failure' + run: sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test" + - name: Retry Add Repo 2 + continue-on-error: true + id: retry2 + if: steps.retry1.outcome=='failure' + run: sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test" + - name: Install packages + run: sudo apt install clang-10 libgmp-dev libmpfr-dev libfftw3-dev + - name: Checkout main boost + run: git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root + - name: Update tools/boostdep + run: git submodule update --init tools/boostdep + working-directory: ../boost-root + - name: Copy files + run: cp -r $GITHUB_WORKSPACE/* libs/math + working-directory: ../boost-root + - name: Run CMake + run: cmake -DBUILD_TESTING=1 -DCMAKE_CXX_COMPILER=clang++-10 . + working-directory: ../boost-root/libs/math + - name: Run Compile Tests + run: make -j$((`nproc`+1)) + working-directory: ../boost-root/libs/math + standalone-gcc: + runs-on: ubuntu-20.04 + strategy: + fail-fast: false + matrix: + compiler: [ g++-10 ] + standard: [ c++11, c++14, c++17, c++2a ] + suite: [ float128_tests, special_fun, distribution_tests, misc, quadrature, interpolators, autodiff, ../example//examples, ../tools ] + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: '0' + - uses: mstachniuk/ci-skip@v1 + with: + commit-filter: '[skip ci];[ci skip];[CI SKIP];[SKIP CI];***CI SKIP***;***SKIP CI***;[windows];[Windows];[WINDOWS];[apple];[Apple];[APPLE];[standalone];[STANDALONE]' + commit-filter-separator: ';' + fail-fast: true + - name: Set TOOLSET + run: echo ${{ matrix.compiler }} | awk '/^g/ { print "TOOLSET=gcc" } /^clang/ { print "TOOLSET=clang" }' >> $GITHUB_ENV + - name: Add repository + continue-on-error: true + id: addrepo + run: sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test" + - name: Retry Add Repo + continue-on-error: true + id: retry1 + if: steps.addrepo.outcome=='failure' + run: sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test" + - name: Retry Add Repo 2 + continue-on-error: true + id: retry2 + if: steps.retry1.outcome=='failure' + run: sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test" + - name: Install packages + run: sudo apt install g++-10 libgmp-dev libmpfr-dev libfftw3-dev + - name: Checkout main boost + run: git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root + - name: Update tools/boostdep + run: git submodule update --init tools/boostdep + working-directory: ../boost-root + - name: Copy files + run: cp -r $GITHUB_WORKSPACE/* libs/math + working-directory: ../boost-root + - name: Install deps + run: python tools/boostdep/depinst/depinst.py math + working-directory: ../boost-root + - name: Bootstrap + run: ./bootstrap.sh + working-directory: ../boost-root + - name: Generate headers + run: ./b2 headers + working-directory: ../boost-root + - name: Generate user config + run: 'echo "using $TOOLSET : : ${{ matrix.compiler }} : -std=${{ matrix.standard }} ;" > ~/user-config.jam' + working-directory: ../boost-root + - name: Config info install + run: ../../../b2 config_info_travis_install toolset=$TOOLSET + working-directory: ../boost-root/libs/config/test + - name: Config info + run: ./config_info_travis + working-directory: ../boost-root/libs/config/test + - name: Test + run: ../../../b2 toolset=$TOOLSET ${{ matrix.suite }} define=CI_SUPPRESS_KNOWN_ISSUES define=SLOW_COMPILER define=BOOST_MATH_STANDALONE define=BOOST_MP_STANDALONE + working-directory: ../boost-root/libs/math/test From 8f808da3a7525c4efbacb733804996cad44fecf0 Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Fri, 27 May 2022 15:25:44 +0100 Subject: [PATCH 15/17] Disable test_2F0 MP tests for all gcc-12. They run the machine out of memory. --- test/test_2F0.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/test_2F0.cpp b/test/test_2F0.cpp index 9c951bfdd8..3726a61840 100644 --- a/test/test_2F0.cpp +++ b/test/test_2F0.cpp @@ -97,8 +97,8 @@ BOOST_AUTO_TEST_CASE( test_main ) #endif #endif -#if defined(__GNUC__) && (__GNUC__ == 12) && (__cplusplus > 202000) - // gcc-12 runs the machine out of memory in C++20 mode: +#if defined(__GNUC__) && (__GNUC__ == 12) + // gcc-12 runs the machine out of memory: #define BOOST_MATH_NO_MP_TESTS #endif From 25e51f773ae1967a5d6691fcc87742547b3527ce Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Fri, 27 May 2022 18:46:47 +0100 Subject: [PATCH 16/17] Fix condition_numbers.hpp for no-eh usage. Enclose try...catch keywords in BOOST_NO_EXCEPTIONS check. --- include/boost/math/tools/condition_numbers.hpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/boost/math/tools/condition_numbers.hpp b/include/boost/math/tools/condition_numbers.hpp index a5801996a5..8754d12828 100644 --- a/include/boost/math/tools/condition_numbers.hpp +++ b/include/boost/math/tools/condition_numbers.hpp @@ -94,15 +94,18 @@ Real evaluation_condition_number(F const & f, Real const & x) } bool caught_exception = false; Real fp; +#ifndef BOOST_NO_EXCEPTIONS try { +#endif fp = finite_difference_derivative(f, x); +#ifndef BOOST_NO_EXCEPTIONS } catch(...) { caught_exception = true; } - +#endif if (isnan(fp) || caught_exception) { // Check if the right derivative exists: From 14d6cfdea2e5a82888d281700e9ae787fc4b1c53 Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Mon, 30 May 2022 18:37:05 +0100 Subject: [PATCH 17/17] Tweak CI runs: Increase tolerance in chatterjee_correlation test. Remove a few tests from Github CI. Remove autodiff from the sanitizer tests as they time out. --- .drone.star | 2 +- .github/workflows/ci.yml | 6 +++--- test/test_chatterjee_correlation.cpp | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.drone.star b/.drone.star index fdb0db327d..22a127991b 100644 --- a/.drone.star +++ b/.drone.star @@ -16,7 +16,7 @@ windowsglobalimage="cppalliance/dronevs2019" def main(ctx): things_to_test = [ "special_fun", "distribution_tests", "mp", "misc", "interpolators", "quadrature", "autodiff", "long-running-tests", "float128_tests" ] - sanitizer_test = [ "special_fun", "distribution_tests", "misc", "interpolators", "quadrature", "autodiff", "float128_tests" ] + sanitizer_test = [ "special_fun", "distribution_tests", "misc", "interpolators", "quadrature", "float128_tests" ] gnu_5_stds = [ "gnu++11" ] gnu_6_stds = [ "gnu++11", "gnu++14" ] gnu_8_stds = [ "gnu++11", "gnu++14", "gnu++17" ] diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f6d46ae6b5..0e3576aed3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,7 +19,7 @@ jobs: fail-fast: false matrix: compiler: [ g++-12, clang++-14 ] - standard: [ c++11, c++14, c++17, c++20 ] + standard: [ c++14, c++17, c++20 ] suite: [ float128_tests, special_fun, distribution_tests, misc, quadrature, mp, interpolators, autodiff, ../example//examples, ../tools ] steps: - uses: actions/checkout@v2 @@ -83,7 +83,7 @@ jobs: fail-fast: false matrix: compiler: [ g++-9, g++-11, clang++-10 ] - standard: [ c++11, c++14, c++17, c++2a ] + standard: [ c++14, c++17, c++2a ] suite: [ float128_tests, special_fun, distribution_tests, misc, quadrature, mp, interpolators, autodiff, ../example//examples, ../tools ] steps: - uses: actions/checkout@v2 @@ -274,7 +274,7 @@ jobs: fail-fast: false matrix: toolset: [ clang ] - standard: [ 11, 14, 17, 2a ] + standard: [ 11, 14, 17, 20 ] suite: [ float128_tests, special_fun, distribution_tests, misc, quadrature, mp, interpolators, autodiff, ../example//examples, ../tools ] steps: - uses: actions/checkout@v2 diff --git a/test/test_chatterjee_correlation.cpp b/test/test_chatterjee_correlation.cpp index be91a925e6..d39a1a33a2 100644 --- a/test/test_chatterjee_correlation.cpp +++ b/test/test_chatterjee_correlation.cpp @@ -127,7 +127,7 @@ void test_paper() } result = chatterjee_correlation(x, y); - CHECK_MOLLIFIED_CLOSE(result, Real(0.885), 0.01); + CHECK_MOLLIFIED_CLOSE(result, Real(0.885), 0.012); } int main(void)