Skip to content

Commit 8b4c9f0

Browse files
authored
Merge pull request #1148 from boostorg/develop
Merge for 1.86
2 parents 434a017 + 5459e14 commit 8b4c9f0

File tree

104 files changed

+13657
-734
lines changed

Some content is hidden

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

104 files changed

+13657
-734
lines changed

.drone.star

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ def main(ctx):
3232
#
3333
# Sanitizers:
3434
#
35-
result.append(linux_cxx("Ubuntu g++-12 C++20 ASAN" + " " + suite, "g++-12", packages="g++-12", privileged=True, buildtype="boost", image="cppalliance/droneubuntu2204:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-12', 'CXXSTD': 'gnu++20', 'TEST_SUITE': suite, 'OPTIONS': '<cxxflags>-fsanitize=address <linkflags>-fsanitize=address <cxxflags>-DBOOST_CI_SANITIZER_BUILD' }, globalenv=globalenv))
36-
result.append(linux_cxx("Ubuntu g++-12 C++20 USAN" + " " + suite, "g++-12", packages="g++-12", privileged=True, buildtype="boost", image="cppalliance/droneubuntu2204:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-12', 'CXXSTD': 'gnu++20', 'TEST_SUITE': suite, 'OPTIONS': '<cxxflags>-fsanitize=undefined <linkflags>-fsanitize=undefined <cxxflags>-DBOOST_CI_SANITIZER_BUILD' }, globalenv=globalenv))
37-
result.append(linux_cxx("Ubuntu g++-12 C++20 TSAN" + " " + suite, "g++-12", packages="g++-12", privileged=True, buildtype="boost", image="cppalliance/droneubuntu2204:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-12', 'CXXSTD': 'gnu++20', 'TEST_SUITE': suite, 'OPTIONS': '<cxxflags>-fsanitize=thread <linkflags>-fsanitize=thread <cxxflags>-DBOOST_CI_SANITIZER_BUILD' }, globalenv=globalenv))
38-
result.append(linux_cxx("Ubuntu clang++-14 C++20 ISAN" + " " + suite, "clang++-14", packages="clang-14", privileged=True, buildtype="boost", image="cppalliance/droneubuntu2204:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-14', 'CXXSTD': 'gnu++20', 'TEST_SUITE': suite, 'OPTIONS': '<cxxflags>-fsanitize=integer <linkflags>-fsanitize=integer' }, globalenv=globalenv))
35+
result.append(linux_cxx("Ubuntu Clang-18 C++20 ASAN" + " " + suite, "clang++-18", packages="clang-18", privileged=True, buildtype="boost", image="cppalliance/droneubuntu2404:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-18', 'CXXSTD': 'gnu++20', 'TEST_SUITE': suite, 'OPTIONS': '<cxxflags>-fsanitize=address <linkflags>-fsanitize=address <cxxflags>-DBOOST_CI_SANITIZER_BUILD' }, globalenv=globalenv))
36+
result.append(linux_cxx("Ubuntu Clang-18 C++20 USAN" + " " + suite, "clang++-18", packages="clang-18", privileged=True, buildtype="boost", image="cppalliance/droneubuntu2404:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-18', 'CXXSTD': 'gnu++20', 'TEST_SUITE': suite, 'OPTIONS': '<cxxflags>-fsanitize=undefined <linkflags>-fsanitize=undefined <cxxflags>-DBOOST_CI_SANITIZER_BUILD' }, globalenv=globalenv))
37+
result.append(linux_cxx("Ubuntu Clang-18 C++20 TSAN" + " " + suite, "clang++-18", packages="clang-18", privileged=True, buildtype="boost", image="cppalliance/droneubuntu2404:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-18', 'CXXSTD': 'gnu++20', 'TEST_SUITE': suite, 'OPTIONS': '<cxxflags>-fsanitize=thread <linkflags>-fsanitize=thread <cxxflags>-DBOOST_CI_SANITIZER_BUILD' }, globalenv=globalenv))
38+
result.append(linux_cxx("Ubuntu Clang-18 C++20 ISAN" + " " + suite, "clang++-18", packages="clang-18", privileged=True, buildtype="boost", image="cppalliance/droneubuntu2404:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-18', 'CXXSTD': 'gnu++20', 'TEST_SUITE': suite, 'OPTIONS': '<cxxflags>-fsanitize=integer <linkflags>-fsanitize=integer' }, globalenv=globalenv))
3939

4040
for suite in things_to_test:
4141
for cxx in gnu_5_stds:
@@ -63,7 +63,8 @@ def main(ctx):
6363
result.append(osx_cxx("M1 Clang " + cxx + " " + suite, "clang++", buildscript="drone", buildtype="boost", xcode_version="14.1", environment={'TOOLSET': 'clang', 'CXXSTD': cxx, 'TEST_SUITE': suite, 'DEFINE': 'BOOST_MATH_NO_REAL_CONCEPT_TESTS,BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS,BOOST_MATH_MULTI_ARCH_CI_RUN', }, globalenv=globalenv))
6464
for suite in gcc13_things_to_test:
6565
for cxx in gcc13_stds:
66-
result.append(linux_cxx("Ubuntu g++-13 " + cxx + " " + suite, "g++-13", packages="g++-13", buildtype="boost", image="cppalliance/droneubuntu2304:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-13', 'CXXSTD': cxx, 'TEST_SUITE': suite, }, globalenv=globalenv))
66+
result.append(linux_cxx("Ubuntu g++-13 " + cxx + " " + suite, "g++-13", packages="g++-13", buildtype="boost", image="cppalliance/droneubuntu2404:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-13', 'CXXSTD': cxx, 'TEST_SUITE': suite, }, globalenv=globalenv))
67+
result.append(linux_cxx("Ubuntu g++-14 " + cxx + " " + suite, "g++-14", packages="g++-14", buildtype="boost", image="cppalliance/droneubuntu2404:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-14', 'CXXSTD': cxx, 'TEST_SUITE': suite, }, globalenv=globalenv))
6768

6869
return result
6970

.drone/drone.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ python tools/boostdep/depinst/depinst.py math
4040
./bootstrap.sh
4141
./b2 headers
4242

43+
if [[ $(uname) == "Linux" ]]; then
44+
echo 0 | sudo tee /proc/sys/kernel/randomize_va_space
45+
fi
46+
4347
echo '==================================> BEFORE_SCRIPT'
4448

4549
. $DRONE_BUILD_DIR/.drone/before-script.sh

.github/workflows/ci.yml

Lines changed: 63 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,72 @@ concurrency:
1919
cancel-in-progress: true
2020

2121
jobs:
22+
ubuntu-noble:
23+
runs-on: ubuntu-24.04
24+
strategy:
25+
fail-fast: false
26+
matrix:
27+
compiler: [ g++-14, clang++-16, clang++-17, clang++-18 ]
28+
standard: [ c++20 ]
29+
suite: [ github_ci_block_1, github_ci_block_2 ]
30+
steps:
31+
- uses: actions/checkout@v4
32+
with:
33+
fetch-depth: '0'
34+
- name: Set TOOLSET
35+
run: echo ${{ matrix.compiler }} | awk '/^g/ { print "TOOLSET=gcc" } /^clang/ { print "TOOLSET=clang" }' >> $GITHUB_ENV
36+
- name: Add repository
37+
continue-on-error: true
38+
id: addrepo
39+
run: sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test"
40+
- name: Retry Add Repo
41+
continue-on-error: true
42+
id: retry1
43+
if: steps.addrepo.outcome=='failure'
44+
run: sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test"
45+
- name: Retry Add Repo 2
46+
continue-on-error: true
47+
id: retry2
48+
if: steps.retry1.outcome=='failure'
49+
run: sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test"
50+
- name: Install packages
51+
run: sudo apt-get install -y g++-13 g++-14 clang-16 clang-17 clang-18 libgmp-dev libmpfr-dev libfftw3-dev
52+
- name: Checkout main boost
53+
run: git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root
54+
- name: Update tools/boostdep
55+
run: git submodule update --init tools/boostdep
56+
working-directory: ../boost-root
57+
- name: Copy files
58+
run: cp -r $GITHUB_WORKSPACE/* libs/math
59+
working-directory: ../boost-root
60+
- name: Install deps
61+
run: python tools/boostdep/depinst/depinst.py math -I example -I tools
62+
working-directory: ../boost-root
63+
- name: Bootstrap
64+
run: ./bootstrap.sh
65+
working-directory: ../boost-root
66+
- name: Generate headers
67+
run: ./b2 headers
68+
working-directory: ../boost-root
69+
- name: Generate user config
70+
run: 'echo "using $TOOLSET : : ${{ matrix.compiler }} : <cxxflags>-std=${{ matrix.standard }} ;" > ~/user-config.jam'
71+
working-directory: ../boost-root
72+
- name: Config info install
73+
run: ../../../b2 config_info_travis_install toolset=$TOOLSET
74+
working-directory: ../boost-root/libs/config/test
75+
- name: Config info
76+
run: ./config_info_travis
77+
working-directory: ../boost-root/libs/config/test
78+
- name: Test
79+
run: ../../../b2 toolset=$TOOLSET ${{ matrix.suite }} define=CI_SUPPRESS_KNOWN_ISSUES define=SLOW_COMPILER define=BOOST_MATH_RUN_MP_TESTS
80+
working-directory: ../boost-root/libs/math/test
81+
2282
ubuntu-jammy:
2383
runs-on: ubuntu-22.04
2484
strategy:
2585
fail-fast: false
2686
matrix:
27-
compiler: [ g++-12, clang++-14 ]
87+
compiler: [ g++-12, clang++-14, clang++-15 ]
2888
standard: [ c++14, c++17 ]
2989
suite: [ github_ci_block_1, github_ci_block_2 ]
3090
steps:
@@ -48,7 +108,7 @@ jobs:
48108
if: steps.retry1.outcome=='failure'
49109
run: sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test"
50110
- name: Install packages
51-
run: sudo apt-get install -y g++-12 clang-14 libgmp-dev libmpfr-dev libfftw3-dev
111+
run: sudo apt-get install -y g++-12 clang-14 clang-15 libgmp-dev libmpfr-dev libfftw3-dev
52112
- name: Checkout main boost
53113
run: git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root
54114
- name: Update tools/boostdep
@@ -185,7 +245,7 @@ jobs:
185245
strategy:
186246
fail-fast: false
187247
matrix:
188-
toolset: [ msvc-14.0, msvc-14.2 ]
248+
toolset: [ msvc-14.2 ]
189249
standard: [ 14, 17 ]
190250
suite: [ github_ci_block_1, github_ci_block_2 ]
191251
steps:

.github/workflows/codecov.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,3 +195,15 @@ jobs:
195195
- name: Upload coverage
196196
if: matrix.coverage
197197
run: ci/codecov.sh "upload"
198+
env:
199+
BOOST_CI_CODECOV_IO_UPLOAD: skip
200+
201+
- name: Upload coverage
202+
if: matrix.coverage
203+
uses: codecov/codecov-action@v4
204+
with:
205+
disable_search: true
206+
file: coverage.info
207+
name: Github Actions
208+
token: ${{secrets.CODECOV_TOKEN}}
209+
verbose: true

include/boost/math/ccmath/fmin.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,13 @@ constexpr auto fmin(T1 x, T2 y) noexcept
7272
}
7373
}
7474

75-
float fminf(float x, float y) noexcept
75+
constexpr float fminf(float x, float y) noexcept
7676
{
7777
return boost::math::ccmath::fmin(x, y);
7878
}
7979

8080
#ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
81-
long double fminl(long double x, long double y) noexcept
81+
constexpr long double fminl(long double x, long double y) noexcept
8282
{
8383
return boost::math::ccmath::fmin(x, y);
8484
}

include/boost/math/concepts/distributions.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ struct DistributionConcept
343343
template <class R, class P>
344344
static void test_extra_members(const boost::math::hypergeometric_distribution<R, P>& d)
345345
{
346-
unsigned u = d.defective();
346+
std::uint64_t u = d.defective();
347347
u = d.sample_count();
348348
u = d.total();
349349
suppress_unused_variable_warning(u);

include/boost/math/concepts/std_real_concept.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,9 @@ class std_real_concept
9090
std_real_concept& operator=(float c) { m_value = c; return *this; }
9191
std_real_concept& operator=(double c) { m_value = c; return *this; }
9292
std_real_concept& operator=(long double c) { m_value = c; return *this; }
93+
#ifdef BOOST_MATH_USE_FLOAT128
94+
std_real_concept& operator=(BOOST_MATH_FLOAT128_TYPE c) { m_value = c; return *this; }
95+
#endif
9396

9497
// Access:
9598
std_real_concept_base_type value()const{ return m_value; }

include/boost/math/distributions/detail/hypergeometric_pdf.hpp

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ T hypergeometric_pdf_prime_loop_imp(hypergeometric_pdf_prime_loop_data& data, hy
297297
while(data.current_prime <= data.N)
298298
{
299299
std::uint64_t base = data.current_prime;
300-
std::int64_t prime_powers = 0;
300+
std::uint64_t prime_powers = 0;
301301
while(base <= data.N)
302302
{
303303
prime_powers += data.n / base;
@@ -313,15 +313,15 @@ T hypergeometric_pdf_prime_loop_imp(hypergeometric_pdf_prime_loop_data& data, hy
313313
}
314314
if(prime_powers)
315315
{
316-
T p = integer_power<T>(static_cast<T>(data.current_prime), prime_powers);
316+
T p = integer_power<T>(static_cast<T>(data.current_prime), static_cast<int>(prime_powers));
317317
if((p > 1) && (tools::max_value<T>() / p < result.value))
318318
{
319319
//
320320
// The next calculation would overflow, use recursion
321321
// to sidestep the issue:
322322
//
323323
hypergeometric_pdf_prime_loop_result_entry<T> t = { p, &result };
324-
data.current_prime = prime(++data.prime_index);
324+
data.current_prime = prime(static_cast<unsigned>(++data.prime_index));
325325
return hypergeometric_pdf_prime_loop_imp<T>(data, t);
326326
}
327327
if((p < 1) && (tools::min_value<T>() / p > result.value))
@@ -331,12 +331,12 @@ T hypergeometric_pdf_prime_loop_imp(hypergeometric_pdf_prime_loop_data& data, hy
331331
// to sidestep the issue:
332332
//
333333
hypergeometric_pdf_prime_loop_result_entry<T> t = { p, &result };
334-
data.current_prime = prime(++data.prime_index);
334+
data.current_prime = prime(static_cast<unsigned>(++data.prime_index));
335335
return hypergeometric_pdf_prime_loop_imp<T>(data, t);
336336
}
337337
result.value *= p;
338338
}
339-
data.current_prime = prime(++data.prime_index);
339+
data.current_prime = prime(static_cast<unsigned>(++data.prime_index));
340340
}
341341
//
342342
// When we get to here we have run out of prime factors,
@@ -395,18 +395,18 @@ T hypergeometric_pdf_factorial_imp(std::uint64_t x, std::uint64_t r, std::uint64
395395
{
396396
BOOST_MATH_STD_USING
397397
BOOST_MATH_ASSERT(N <= boost::math::max_factorial<T>::value);
398-
T result = boost::math::unchecked_factorial<T>(n);
398+
T result = boost::math::unchecked_factorial<T>(static_cast<unsigned>(n));
399399
T num[3] = {
400-
boost::math::unchecked_factorial<T>(r),
401-
boost::math::unchecked_factorial<T>(N - n),
402-
boost::math::unchecked_factorial<T>(N - r)
400+
boost::math::unchecked_factorial<T>(static_cast<unsigned>(r)),
401+
boost::math::unchecked_factorial<T>(static_cast<unsigned>(N - n)),
402+
boost::math::unchecked_factorial<T>(static_cast<unsigned>(N - r))
403403
};
404404
T denom[5] = {
405-
boost::math::unchecked_factorial<T>(N),
406-
boost::math::unchecked_factorial<T>(x),
407-
boost::math::unchecked_factorial<T>(n - x),
408-
boost::math::unchecked_factorial<T>(r - x),
409-
boost::math::unchecked_factorial<T>(N - n - r + x)
405+
boost::math::unchecked_factorial<T>(static_cast<unsigned>(N)),
406+
boost::math::unchecked_factorial<T>(static_cast<unsigned>(x)),
407+
boost::math::unchecked_factorial<T>(static_cast<unsigned>(n - x)),
408+
boost::math::unchecked_factorial<T>(static_cast<unsigned>(r - x)),
409+
boost::math::unchecked_factorial<T>(static_cast<unsigned>(N - n - r + x))
410410
};
411411
std::size_t i = 0;
412412
std::size_t j = 0;

0 commit comments

Comments
 (0)