Skip to content

Commit f1b0b95

Browse files
authored
Merge pull request #1219 from boostorg/develop
Merge to master for 1.87
2 parents 4c2cdc2 + 8f843fd commit f1b0b95

File tree

1,169 files changed

+144328
-7330
lines changed

Some content is hidden

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

1,169 files changed

+144328
-7330
lines changed

.github/workflows/ci.yml

Lines changed: 230 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -546,3 +546,233 @@ jobs:
546546
- name: Test
547547
run: ../../../b2 toolset=$TOOLSET ${{ matrix.suite }} define=CI_SUPPRESS_KNOWN_ISSUES define=SLOW_COMPILER define=BOOST_MATH_STANDALONE define=BOOST_MP_STANDALONE
548548
working-directory: ../boost-root/libs/math/test
549+
550+
posix-cmake-test:
551+
strategy:
552+
fail-fast: false
553+
matrix:
554+
include:
555+
- os: ubuntu-22.04
556+
557+
runs-on: ${{matrix.os}}
558+
559+
steps:
560+
- uses: actions/checkout@v4
561+
562+
- name: Install packages
563+
if: matrix.install
564+
run: sudo apt install ${{matrix.install}} libgmp-dev libmpfr-dev libfftw3-dev
565+
566+
- name: Setup Boost
567+
run: |
568+
echo GITHUB_REPOSITORY: $GITHUB_REPOSITORY
569+
LIBRARY=${GITHUB_REPOSITORY#*/}
570+
echo LIBRARY: $LIBRARY
571+
echo "LIBRARY=$LIBRARY" >> $GITHUB_ENV
572+
echo GITHUB_BASE_REF: $GITHUB_BASE_REF
573+
echo GITHUB_REF: $GITHUB_REF
574+
REF=${GITHUB_BASE_REF:-$GITHUB_REF}
575+
REF=${REF#refs/heads/}
576+
echo REF: $REF
577+
BOOST_BRANCH=develop && [ "$REF" == "master" ] && BOOST_BRANCH=master || true
578+
echo BOOST_BRANCH: $BOOST_BRANCH
579+
cd ..
580+
git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
581+
cd boost-root
582+
mkdir -p libs/$LIBRARY
583+
cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY
584+
git submodule update --init tools/boostdep
585+
python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" $LIBRARY
586+
587+
- name: Configure
588+
run: |
589+
cd ../boost-root
590+
mkdir __build__ && cd __build__
591+
cmake -DBOOST_INCLUDE_LIBRARIES=$LIBRARY -DBUILD_TESTING=ON ..
592+
593+
- name: Build tests
594+
run: |
595+
cd ../boost-root/__build__
596+
cmake --build . --target tests
597+
598+
sycl-cmake-test:
599+
strategy:
600+
fail-fast: false
601+
602+
runs-on: ubuntu-latest
603+
604+
steps:
605+
- name: Intel Apt repository
606+
timeout-minutes: 1
607+
run: |
608+
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
609+
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
610+
rm GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
611+
echo "deb https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
612+
sudo apt-get update
613+
614+
- name: Install Intel oneAPI compilers
615+
timeout-minutes: 5
616+
run: sudo apt-get install intel-oneapi-compiler-fortran intel-oneapi-compiler-dpcpp-cpp
617+
618+
- name: Setup Intel oneAPI environment
619+
run: |
620+
source /opt/intel/oneapi/setvars.sh
621+
printenv >> $GITHUB_ENV
622+
623+
- name: checkout project code
624+
uses: actions/checkout@v4
625+
626+
- name: Install Packages
627+
run: |
628+
sudo apt-get install -y cmake make
629+
630+
- name: Setup Boost
631+
run: |
632+
echo GITHUB_REPOSITORY: $GITHUB_REPOSITORY
633+
LIBRARY=${GITHUB_REPOSITORY#*/}
634+
echo LIBRARY: $LIBRARY
635+
echo "LIBRARY=$LIBRARY" >> $GITHUB_ENV
636+
echo GITHUB_BASE_REF: $GITHUB_BASE_REF
637+
echo GITHUB_REF: $GITHUB_REF
638+
REF=${GITHUB_BASE_REF:-$GITHUB_REF}
639+
REF=${REF#refs/heads/}
640+
echo REF: $REF
641+
BOOST_BRANCH=develop && [ "$REF" == "master" ] && BOOST_BRANCH=master || true
642+
echo BOOST_BRANCH: $BOOST_BRANCH
643+
cd ..
644+
git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
645+
cd boost-root
646+
mkdir -p libs/$LIBRARY
647+
cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY
648+
git submodule update --init tools/boostdep
649+
python3 tools/boostdep/depinst/depinst.py --git_args "--jobs 3" $LIBRARY
650+
- name: Configure
651+
run: |
652+
cd ../boost-root
653+
mkdir __build__ && cd __build__
654+
cmake -DBOOST_INCLUDE_LIBRARIES=$LIBRARY -DBUILD_TESTING=ON -DBOOST_MATH_ENABLE_SYCL=ON ..
655+
- name: Build tests
656+
run: |
657+
cd ../boost-root/__build__
658+
cmake --build . --target tests -j $(nproc)
659+
- name: Run tests
660+
run: |
661+
cd ../boost-root/__build__
662+
ctest --output-on-failure --no-tests=error
663+
cuda-cmake-test:
664+
strategy:
665+
fail-fast: false
666+
667+
runs-on: ubuntu-22.04
668+
669+
steps:
670+
- uses: Jimver/cuda-toolkit@v0.2.16
671+
id: cuda-toolkit
672+
with:
673+
cuda: '12.5.0'
674+
method: 'network'
675+
sub-packages: '["nvcc"]'
676+
677+
- name: Output CUDA information
678+
run: |
679+
echo "Installed cuda version is: ${{steps.cuda-toolkit.outputs.cuda}}"+
680+
echo "Cuda install location: ${{steps.cuda-toolkit.outputs.CUDA_PATH}}"
681+
nvcc -V
682+
- uses: actions/checkout@v4
683+
684+
- name: Install Packages
685+
run: |
686+
sudo apt-get install -y cmake make
687+
- name: Setup Boost
688+
run: |
689+
echo GITHUB_REPOSITORY: $GITHUB_REPOSITORY
690+
LIBRARY=${GITHUB_REPOSITORY#*/}
691+
echo LIBRARY: $LIBRARY
692+
echo "LIBRARY=$LIBRARY" >> $GITHUB_ENV
693+
echo GITHUB_BASE_REF: $GITHUB_BASE_REF
694+
echo GITHUB_REF: $GITHUB_REF
695+
REF=${GITHUB_BASE_REF:-$GITHUB_REF}
696+
REF=${REF#refs/heads/}
697+
echo REF: $REF
698+
BOOST_BRANCH=develop && [ "$REF" == "master" ] && BOOST_BRANCH=master || true
699+
echo BOOST_BRANCH: $BOOST_BRANCH
700+
cd ..
701+
git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
702+
cd boost-root
703+
mkdir -p libs/$LIBRARY
704+
cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY
705+
git submodule update --init tools/boostdep
706+
python3 tools/boostdep/depinst/depinst.py --git_args "--jobs 3" $LIBRARY
707+
- name: Configure
708+
run: |
709+
cd ../boost-root
710+
mkdir __build__ && cd __build__
711+
cmake -DBOOST_INCLUDE_LIBRARIES=$LIBRARY -DBUILD_TESTING=ON -DCMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc -DBOOST_MATH_ENABLE_CUDA=1 -DCMAKE_CUDA_ARCHITECTURES=70 -DCUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda-12.5 ..
712+
- name: Build tests
713+
run: |
714+
cd ../boost-root/__build__
715+
cmake --build . --target tests -j $(nproc)
716+
# Will leave this commented out for now. GHA does not install graphics cards by default
717+
#- name: Run tests
718+
# run: |
719+
# cd ../boost-root/__build__
720+
# ctest --output-on-failure --no-tests=error
721+
nvrtc-cmake-test:
722+
strategy:
723+
fail-fast: false
724+
725+
runs-on: ubuntu-22.04
726+
727+
steps:
728+
- uses: Jimver/cuda-toolkit@v0.2.16
729+
id: cuda-toolkit
730+
with:
731+
cuda: '12.5.0'
732+
method: 'network'
733+
734+
- name: Output CUDA information
735+
run: |
736+
echo "Installed cuda version is: ${{steps.cuda-toolkit.outputs.cuda}}"+
737+
echo "Cuda install location: ${{steps.cuda-toolkit.outputs.CUDA_PATH}}"
738+
nvcc -V
739+
- uses: actions/checkout@v4
740+
741+
- name: Install Packages
742+
run: |
743+
sudo apt-get install -y cmake make
744+
- name: Setup Boost
745+
run: |
746+
echo GITHUB_REPOSITORY: $GITHUB_REPOSITORY
747+
LIBRARY=${GITHUB_REPOSITORY#*/}
748+
echo LIBRARY: $LIBRARY
749+
echo "LIBRARY=$LIBRARY" >> $GITHUB_ENV
750+
echo GITHUB_BASE_REF: $GITHUB_BASE_REF
751+
echo GITHUB_REF: $GITHUB_REF
752+
REF=${GITHUB_BASE_REF:-$GITHUB_REF}
753+
REF=${REF#refs/heads/}
754+
echo REF: $REF
755+
BOOST_BRANCH=develop && [ "$REF" == "master" ] && BOOST_BRANCH=master || true
756+
echo BOOST_BRANCH: $BOOST_BRANCH
757+
cd ..
758+
git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
759+
cd boost-root
760+
mkdir -p libs/$LIBRARY
761+
cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY
762+
git submodule update --init tools/boostdep
763+
python3 tools/boostdep/depinst/depinst.py --git_args "--jobs 3" $LIBRARY
764+
- name: Configure
765+
run: |
766+
cd ../boost-root
767+
mkdir __build__ && cd __build__
768+
cmake -DBOOST_INCLUDE_LIBRARIES=$LIBRARY -DBUILD_TESTING=ON -DCMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc -DBOOST_MATH_ENABLE_NVRTC=1 -DCMAKE_CUDA_ARCHITECTURES=70 -DCUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda-12.5 -DBOOST_MATH_NVRTC_CI_RUN=1 ..
769+
pwd
770+
- name: Build tests
771+
run: |
772+
cd ../boost-root/__build__
773+
cmake --build . --target tests -j $(nproc)
774+
# We don't have the ability for runtime right now
775+
#- name: Run tests
776+
# run: |
777+
# cd ../boost-root/__build__
778+
# ctest --output-on-failure --no-tests=error

CMakeLists.txt

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,17 @@
55

66
cmake_minimum_required(VERSION 3.5...3.16)
77

8-
project(boost_math VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX)
8+
project(boost_math VERSION 1.87.0 LANGUAGES CXX)
99

1010
add_library(boost_math INTERFACE)
1111

1212
add_library(Boost::math ALIAS boost_math)
1313

1414
target_include_directories(boost_math INTERFACE include)
15+
if(NOT CMAKE_VERSION VERSION_LESS "3.19")
16+
file(GLOB_RECURSE headers include/*.hpp)
17+
target_sources(boost_math PRIVATE ${headers})
18+
endif()
1519

1620
include(CMakeDependentOption)
1721

@@ -41,12 +45,17 @@ else()
4145

4246
endif()
4347

48+
if(BUILD_TESTING AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/test/CMakeLists.txt")
49+
50+
add_subdirectory(test)
51+
4452
# Only enable tests when we're the root project
45-
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
53+
elseif(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
4654

4755
include(CTest)
4856
add_subdirectory(test)
4957

5058
include(GNUInstallDirs)
5159
install(DIRECTORY "include/" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
60+
5261
endif()

build.jam

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

0 commit comments

Comments
 (0)