From 6a3a10908864b1ac992fa70b462803ea3ec9db97 Mon Sep 17 00:00:00 2001 From: Matt Borland Date: Tue, 15 Oct 2024 11:00:12 -0400 Subject: [PATCH 1/4] Add boost standard CMake Testing --- .github/workflows/ci.yml | 55 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ee72988440..be738eb96e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -546,6 +546,61 @@ jobs: - 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 + + posix-cmake-test: + strategy: + fail-fast: false + matrix: + include: + - os: ubuntu-20.04 + - os: ubuntu-22.04 + + runs-on: ${{matrix.os}} + + steps: + - uses: actions/checkout@v4 + + - name: Install packages + if: matrix.install + run: sudo apt install ${{matrix.install}} libgmp-dev libmpfr-dev libfftw3-dev + + - name: Setup Boost + run: | + echo GITHUB_REPOSITORY: $GITHUB_REPOSITORY + LIBRARY=${GITHUB_REPOSITORY#*/} + echo LIBRARY: $LIBRARY + echo "LIBRARY=$LIBRARY" >> $GITHUB_ENV + echo GITHUB_BASE_REF: $GITHUB_BASE_REF + echo GITHUB_REF: $GITHUB_REF + REF=${GITHUB_BASE_REF:-$GITHUB_REF} + REF=${REF#refs/heads/} + echo REF: $REF + BOOST_BRANCH=develop && [ "$REF" == "master" ] && BOOST_BRANCH=master || true + echo BOOST_BRANCH: $BOOST_BRANCH + cd .. + git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root + cd boost-root + mkdir -p libs/$LIBRARY + cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY + git submodule update --init tools/boostdep + python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" $LIBRARY + + - name: Configure + run: | + cd ../boost-root + mkdir __build__ && cd __build__ + cmake -DBOOST_INCLUDE_LIBRARIES=$LIBRARY -DBUILD_TESTING=ON .. + + - name: Build tests + run: | + cd ../boost-root/__build__ + cmake --build . --target tests + + - name: Run tests + run: | + cd ../boost-root/__build__ + ctest --output-on-failure --no-tests=error + sycl-cmake-test: strategy: fail-fast: false From cf06238f33589f525bd4158aec9d8425d5149dce Mon Sep 17 00:00:00 2001 From: Matt Borland Date: Tue, 15 Oct 2024 13:33:14 -0400 Subject: [PATCH 2/4] Add include private --- .github/workflows/ci.yml | 1 - test/compile_test/CMakeLists.txt | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index be738eb96e..c050c37c3d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -552,7 +552,6 @@ jobs: fail-fast: false matrix: include: - - os: ubuntu-20.04 - os: ubuntu-22.04 runs-on: ${{matrix.os}} diff --git a/test/compile_test/CMakeLists.txt b/test/compile_test/CMakeLists.txt index ddd764dfa8..f777e61c36 100644 --- a/test/compile_test/CMakeLists.txt +++ b/test/compile_test/CMakeLists.txt @@ -2,7 +2,8 @@ # Distributed under the Boost Software License, Version 1.0. # https://www.boost.org/LICENSE_1_0.txt +include_directories(../../include_private) file(GLOB SOURCES "*.cpp") add_library(boost_math-compile_tests STATIC ${SOURCES}) target_compile_features(boost_math-compile_tests PRIVATE cxx_std_17) -target_link_libraries(boost_math-compile_tests PUBLIC Boost::math Boost::multiprecision Boost::numeric_ublas) +target_link_libraries(boost_math-compile_tests PUBLIC Boost::math Boost::multiprecision Boost::numeric_ublas Boost::unit_test_framework) From ead2df5f20af7bf61fe8edfa3fecb37c98b6938c Mon Sep 17 00:00:00 2001 From: Matt Borland Date: Wed, 16 Oct 2024 17:29:25 -0400 Subject: [PATCH 3/4] Change CI command --- .github/workflows/ci.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c050c37c3d..0e7b8bbac2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -593,12 +593,7 @@ jobs: - name: Build tests run: | cd ../boost-root/__build__ - cmake --build . --target tests - - - name: Run tests - run: | - cd ../boost-root/__build__ - ctest --output-on-failure --no-tests=error + cmake --build . sycl-cmake-test: strategy: From ab35018fecad2093e845efb450dcc2f666eabca2 Mon Sep 17 00:00:00 2001 From: Matt Borland Date: Thu, 17 Oct 2024 09:31:39 -0400 Subject: [PATCH 4/4] Use boost test and change target --- .github/workflows/ci.yml | 2 +- test/compile_test/CMakeLists.txt | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0e7b8bbac2..fb0154b969 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -593,7 +593,7 @@ jobs: - name: Build tests run: | cd ../boost-root/__build__ - cmake --build . + cmake --build . --target tests sycl-cmake-test: strategy: diff --git a/test/compile_test/CMakeLists.txt b/test/compile_test/CMakeLists.txt index f777e61c36..acfa292228 100644 --- a/test/compile_test/CMakeLists.txt +++ b/test/compile_test/CMakeLists.txt @@ -3,7 +3,5 @@ # https://www.boost.org/LICENSE_1_0.txt include_directories(../../include_private) -file(GLOB SOURCES "*.cpp") -add_library(boost_math-compile_tests STATIC ${SOURCES}) -target_compile_features(boost_math-compile_tests PRIVATE cxx_std_17) -target_link_libraries(boost_math-compile_tests PUBLIC Boost::math Boost::multiprecision Boost::numeric_ublas Boost::unit_test_framework) +file(GLOB SRC_FILES CONFIGURE_DEPENDS "*.cpp") +boost_test(TYPE "compile" SOURCES ${SRC_FILES} COMPILE_DEFINITIONS BOOST_MATH_STANDALONE COMPILE_FEATURES cxx_std_17 LINK_LIBRARIES Boost::math Boost::multiprecision Boost::numeric_ublas Boost::unit_test_framework )