Skip to content

Commit

Permalink
Merge pull request #1148 from boostorg/develop
Browse files Browse the repository at this point in the history
Merge for 1.86
  • Loading branch information
mborland authored Jul 3, 2024
2 parents 434a017 + 5459e14 commit 8b4c9f0
Show file tree
Hide file tree
Showing 104 changed files with 13,657 additions and 734 deletions.
11 changes: 6 additions & 5 deletions .drone.star
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ def main(ctx):
#
# Sanitizers:
#
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))
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))
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))
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))
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))
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))
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))
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))

for suite in things_to_test:
for cxx in gnu_5_stds:
Expand Down Expand Up @@ -63,7 +63,8 @@ def main(ctx):
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))
for suite in gcc13_things_to_test:
for cxx in gcc13_stds:
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))
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))
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))

return result

Expand Down
4 changes: 4 additions & 0 deletions .drone/drone.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ python tools/boostdep/depinst/depinst.py math
./bootstrap.sh
./b2 headers

if [[ $(uname) == "Linux" ]]; then
echo 0 | sudo tee /proc/sys/kernel/randomize_va_space
fi

echo '==================================> BEFORE_SCRIPT'

. $DRONE_BUILD_DIR/.drone/before-script.sh
Expand Down
66 changes: 63 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,72 @@ concurrency:
cancel-in-progress: true

jobs:
ubuntu-noble:
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
compiler: [ g++-14, clang++-16, clang++-17, clang++-18 ]
standard: [ c++20 ]
suite: [ github_ci_block_1, github_ci_block_2 ]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- 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-get install -y g++-13 g++-14 clang-16 clang-17 clang-18 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 -I example -I tools
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 }} : <cxxflags>-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_RUN_MP_TESTS
working-directory: ../boost-root/libs/math/test

ubuntu-jammy:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
compiler: [ g++-12, clang++-14 ]
compiler: [ g++-12, clang++-14, clang++-15 ]
standard: [ c++14, c++17 ]
suite: [ github_ci_block_1, github_ci_block_2 ]
steps:
Expand All @@ -48,7 +108,7 @@ jobs:
if: steps.retry1.outcome=='failure'
run: sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test"
- name: Install packages
run: sudo apt-get install -y g++-12 clang-14 libgmp-dev libmpfr-dev libfftw3-dev
run: sudo apt-get install -y g++-12 clang-14 clang-15 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
Expand Down Expand Up @@ -185,7 +245,7 @@ jobs:
strategy:
fail-fast: false
matrix:
toolset: [ msvc-14.0, msvc-14.2 ]
toolset: [ msvc-14.2 ]
standard: [ 14, 17 ]
suite: [ github_ci_block_1, github_ci_block_2 ]
steps:
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -195,3 +195,15 @@ jobs:
- name: Upload coverage
if: matrix.coverage
run: ci/codecov.sh "upload"
env:
BOOST_CI_CODECOV_IO_UPLOAD: skip

- name: Upload coverage
if: matrix.coverage
uses: codecov/codecov-action@v4
with:
disable_search: true
file: coverage.info
name: Github Actions
token: ${{secrets.CODECOV_TOKEN}}
verbose: true
4 changes: 2 additions & 2 deletions include/boost/math/ccmath/fmin.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,13 @@ constexpr auto fmin(T1 x, T2 y) noexcept
}
}

float fminf(float x, float y) noexcept
constexpr float fminf(float x, float y) noexcept
{
return boost::math::ccmath::fmin(x, y);
}

#ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
long double fminl(long double x, long double y) noexcept
constexpr long double fminl(long double x, long double y) noexcept
{
return boost::math::ccmath::fmin(x, y);
}
Expand Down
2 changes: 1 addition & 1 deletion include/boost/math/concepts/distributions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ struct DistributionConcept
template <class R, class P>
static void test_extra_members(const boost::math::hypergeometric_distribution<R, P>& d)
{
unsigned u = d.defective();
std::uint64_t u = d.defective();
u = d.sample_count();
u = d.total();
suppress_unused_variable_warning(u);
Expand Down
3 changes: 3 additions & 0 deletions include/boost/math/concepts/std_real_concept.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ class std_real_concept
std_real_concept& operator=(float c) { m_value = c; return *this; }
std_real_concept& operator=(double c) { m_value = c; return *this; }
std_real_concept& operator=(long double c) { m_value = c; return *this; }
#ifdef BOOST_MATH_USE_FLOAT128
std_real_concept& operator=(BOOST_MATH_FLOAT128_TYPE c) { m_value = c; return *this; }
#endif

// Access:
std_real_concept_base_type value()const{ return m_value; }
Expand Down
28 changes: 14 additions & 14 deletions include/boost/math/distributions/detail/hypergeometric_pdf.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ T hypergeometric_pdf_prime_loop_imp(hypergeometric_pdf_prime_loop_data& data, hy
while(data.current_prime <= data.N)
{
std::uint64_t base = data.current_prime;
std::int64_t prime_powers = 0;
std::uint64_t prime_powers = 0;
while(base <= data.N)
{
prime_powers += data.n / base;
Expand All @@ -313,15 +313,15 @@ T hypergeometric_pdf_prime_loop_imp(hypergeometric_pdf_prime_loop_data& data, hy
}
if(prime_powers)
{
T p = integer_power<T>(static_cast<T>(data.current_prime), prime_powers);
T p = integer_power<T>(static_cast<T>(data.current_prime), static_cast<int>(prime_powers));
if((p > 1) && (tools::max_value<T>() / p < result.value))
{
//
// The next calculation would overflow, use recursion
// to sidestep the issue:
//
hypergeometric_pdf_prime_loop_result_entry<T> t = { p, &result };
data.current_prime = prime(++data.prime_index);
data.current_prime = prime(static_cast<unsigned>(++data.prime_index));
return hypergeometric_pdf_prime_loop_imp<T>(data, t);
}
if((p < 1) && (tools::min_value<T>() / p > result.value))
Expand All @@ -331,12 +331,12 @@ T hypergeometric_pdf_prime_loop_imp(hypergeometric_pdf_prime_loop_data& data, hy
// to sidestep the issue:
//
hypergeometric_pdf_prime_loop_result_entry<T> t = { p, &result };
data.current_prime = prime(++data.prime_index);
data.current_prime = prime(static_cast<unsigned>(++data.prime_index));
return hypergeometric_pdf_prime_loop_imp<T>(data, t);
}
result.value *= p;
}
data.current_prime = prime(++data.prime_index);
data.current_prime = prime(static_cast<unsigned>(++data.prime_index));
}
//
// When we get to here we have run out of prime factors,
Expand Down Expand Up @@ -395,18 +395,18 @@ T hypergeometric_pdf_factorial_imp(std::uint64_t x, std::uint64_t r, std::uint64
{
BOOST_MATH_STD_USING
BOOST_MATH_ASSERT(N <= boost::math::max_factorial<T>::value);
T result = boost::math::unchecked_factorial<T>(n);
T result = boost::math::unchecked_factorial<T>(static_cast<unsigned>(n));
T num[3] = {
boost::math::unchecked_factorial<T>(r),
boost::math::unchecked_factorial<T>(N - n),
boost::math::unchecked_factorial<T>(N - r)
boost::math::unchecked_factorial<T>(static_cast<unsigned>(r)),
boost::math::unchecked_factorial<T>(static_cast<unsigned>(N - n)),
boost::math::unchecked_factorial<T>(static_cast<unsigned>(N - r))
};
T denom[5] = {
boost::math::unchecked_factorial<T>(N),
boost::math::unchecked_factorial<T>(x),
boost::math::unchecked_factorial<T>(n - x),
boost::math::unchecked_factorial<T>(r - x),
boost::math::unchecked_factorial<T>(N - n - r + x)
boost::math::unchecked_factorial<T>(static_cast<unsigned>(N)),
boost::math::unchecked_factorial<T>(static_cast<unsigned>(x)),
boost::math::unchecked_factorial<T>(static_cast<unsigned>(n - x)),
boost::math::unchecked_factorial<T>(static_cast<unsigned>(r - x)),
boost::math::unchecked_factorial<T>(static_cast<unsigned>(N - n - r + x))
};
std::size_t i = 0;
std::size_t j = 0;
Expand Down
Loading

0 comments on commit 8b4c9f0

Please sign in to comment.