From 87e1e3dcda5f9da613f551e34a7f4cfa3a14ba15 Mon Sep 17 00:00:00 2001 From: Daniel Sharp Date: Tue, 4 Nov 2025 17:29:26 -0500 Subject: [PATCH 01/21] Fixing cmake versioning --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 56a8c3ad..03344549 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,7 +2,7 @@ requires = [ "setuptools", "scikit-build>=0.13", - "cmake", + "cmake<=3.31", "ninja", ] build-backend = "setuptools.build_meta" @@ -16,7 +16,7 @@ license={file="LICENSE.txt"} readme="README.md" requires-python = ">=3.7" description="A Monotone Parameterization Toolkit" -version="2.2.2" +version="2.2.3" keywords=["Measure Transport", "Monotone", "Transport Map", "Isotonic Regression", "Triangular", "Knothe-Rosenblatt"] [project.urls] From 6586b94756d92edebd9af3ba5c68a7c76d7f3cb5 Mon Sep 17 00:00:00 2001 From: Daniel Sharp Date: Tue, 4 Nov 2025 17:30:02 -0500 Subject: [PATCH 02/21] Change kokkos to 4.5 to fix build issue --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 861f4d65..d7beddfb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -88,7 +88,7 @@ if(NOT Kokkos_FOUND) FetchContent_Declare( kokkos GIT_REPOSITORY https://github.com/kokkos/kokkos - GIT_TAG 4.2.00 + GIT_TAG 4.5.01 GIT_SHALLOW TRUE ) FetchContent_MakeAvailable(kokkos) @@ -96,7 +96,7 @@ if(NOT Kokkos_FOUND) message(FATAL_ERROR "Could not find Kokkos library and MPART_FETCH_DEPS=OFF, so CMake will not attempt to fetch and install Kokkos itself.") endif() else() - message(STATUS "Found Kokkos!") + message(STATUS "Found Kokkos: ${Kokkos_DIR}") endif() if(${COMPILER_IS_NVCC}) From ca8a2242d854f7c406be46e652ca4e943da0d5a9 Mon Sep 17 00:00:00 2001 From: Daniel Sharp Date: Tue, 4 Nov 2025 17:39:09 -0500 Subject: [PATCH 03/21] Fix citation --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index 01dd1fde..02cf4ba4 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,15 @@ [![DOI](https://joss.theoj.org/papers/10.21105/joss.04843/status.svg)](https://doi.org/10.21105/joss.04843) # MParT: A Monotone Parameterization Toolkit + A CPU/GPU performance-portable library for parameterizing and constructing monotone functions in the context of measure transport and regression. ## Documentation + See [measuretransport.github.io/MParT/](https://measuretransport.github.io/MParT/) for more extensive documentation. +# Citation + +``` +@article{Parno2022, doi = {10.21105/joss.04843}, url = {https://doi.org/10.21105/joss.04843}, year = {2022}, publisher = {The Open Journal}, volume = {7}, number = {80}, pages = {4843}, author = {Parno, Matthew and Rubio, Paul-Baptiste and Sharp, Daniel and Brennan, Michael and Baptista, Ricardo and Bonart, Henning and Marzouk, Youssef}, title = {MParT: Monotone Parameterization Toolkit}, journal = {Journal of Open Source Software} } +``` From 986e68113608a36b58a158333350bf798a5fd4c9 Mon Sep 17 00:00:00 2001 From: Daniel Sharp Date: Tue, 4 Nov 2025 17:39:22 -0500 Subject: [PATCH 04/21] Fix `kokkos-num-threads` --- MParT/Initialization.h | 182 ++++++++++++++++++----------------- docs/source/installation.rst | 2 +- tests/RunTests.cpp | 21 ++-- 3 files changed, 107 insertions(+), 98 deletions(-) diff --git a/MParT/Initialization.h b/MParT/Initialization.h index 5f3cc264..e6b7c8cb 100644 --- a/MParT/Initialization.h +++ b/MParT/Initialization.h @@ -1,120 +1,128 @@ #ifndef MPART_INITIALIZATION_H #define MPART_INITIALIZATION_H - #include -#include -#include -#include #include #include +#include +#include +#include #if defined(MPART_ENABLE_GPU) -#include #include +#include #include -#endif +#endif -namespace mpart{ +namespace mpart { - /** @defgroup InitializationHelpers +/** @defgroup InitializationHelpers - @code{.cpp} +@code{.cpp} #include "MParT/Initialization.h" int main( int argc, char* argv[] ) { - mpart::Initialize(argc,argv); +mpart::Initialize(argc,argv); - return 0; +return 0; } - @endcode - */ - - /** - @brief Call Kokkos::Finalize - @ingroup InitializationHelpers - @details the mpart::Initialize function will set add this function to the `atexit` list so that it is called at program termination. - */ - void Finalize(); - - // Simply holds a private variable isInitialized. A static instance of this function is used in the GetInitializeStatusObject object. - struct InitializeStatus{ - - bool Get(){return isInitialized;}; - void Set(){isInitialized = true;} - - #if defined(MPART_ENABLE_GPU) - cublasHandle_t& GetCublasHandle(){return blasHandle;} - cusolverDnHandle_t& GetCusolverHandle(){return solverHandle;} - #endif - private: - bool isInitialized = false; - - #if defined(MPART_ENABLE_GPU) - cublasHandle_t blasHandle; - cusolverDnHandle_t solverHandle; - #endif - }; - - // Holds a static InitializeStatus object - InitializeStatus& GetInitializeStatusObject(); - - /** - @brief Calls Kokkos::initialize if it hasn't been called yet. - @ingroup InitializationHelpers - @details - This function provides a thin wrapper around the Kokkos::initialize function that can be called multiple times without error. - This function also adds Kokkos::finalize to `atexit` so that manually calling Kokkos::finalize is not necessary. - - Note that Kokkos::initialize can only be called once and this function will print a warning message if called multiple times. The warning - indicates that any changes to Kokkos parameters, like `--kokkos-threads` in subsequent calls will have no impact. Only the - parameters passed the to the first mpart::Initialize call will be used. - - The warning messages can be silenced by setting the `MPART_WARNINGS` environment variable to `OFF`. - - @tparam Arguments - @param args Parameters to be passed on to Kokkos::initialize. - */ - template - void Initialize(FirstArgType& arg1, Arguments... args) - { - if(!GetInitializeStatusObject().Get()){ - - // Initialize kokkos - Kokkos::initialize(arg1, args...); +@endcode +*/ + +/** + @brief Call Kokkos::Finalize + @ingroup InitializationHelpers + @details the mpart::Initialize function will set add this function to the + `atexit` list so that it is called at program termination. + */ +void Finalize(); + +// Simply holds a private variable isInitialized. A static instance of this +// function is used in the GetInitializeStatusObject object. +struct InitializeStatus { + bool Get() { return isInitialized; }; + void Set() { isInitialized = true; } #if defined(MPART_ENABLE_GPU) - // Set up the cublas handles - cublasCreate(&GetInitializeStatusObject().GetCublasHandle()); - cusolverDnCreate(&GetInitializeStatusObject().GetCusolverHandle()); + cublasHandle_t& GetCublasHandle() { return blasHandle; } + cusolverDnHandle_t& GetCusolverHandle() { return solverHandle; } #endif + private: + bool isInitialized = false; - // Make sure Kokkos::finalize() is called at program exit. - std::atexit(&mpart::Finalize); +#if defined(MPART_ENABLE_GPU) + cublasHandle_t blasHandle; + cusolverDnHandle_t solverHandle; +#endif +}; + +// Holds a static InitializeStatus object +InitializeStatus& GetInitializeStatusObject(); + +/** + @brief Calls Kokkos::initialize if it hasn't been called yet. + @ingroup InitializationHelpers + @details + This function provides a thin wrapper around the Kokkos::initialize function + that can be called multiple times without error. This function also adds + Kokkos::finalize to `atexit` so that manually calling Kokkos::finalize is not + necessary. + + Note that Kokkos::initialize can only be called once and this function will + print a warning message if called multiple times. The warning indicates that + any changes to Kokkos parameters, like `--kokkos-num-threads` in subsequent + calls will have no impact. Only the parameters passed the to the first + mpart::Initialize call will be used. + + The warning messages can be silenced by setting the `MPART_WARNINGS` + environment variable to `OFF`. + + @tparam Arguments + @param args Parameters to be passed on to Kokkos::initialize. + */ +template +void Initialize(FirstArgType& arg1, Arguments... args) { + if (!GetInitializeStatusObject().Get()) { + // Initialize kokkos + Kokkos::initialize(arg1, args...); - // Update the state to remember that we called Initialize - GetInitializeStatusObject().Set(); +#if defined(MPART_ENABLE_GPU) + // Set up the cublas handles + cublasCreate(&GetInitializeStatusObject().GetCublasHandle()); + cusolverDnCreate(&GetInitializeStatusObject().GetCusolverHandle()); +#endif - }else{ + // Make sure Kokkos::finalize() is called at program exit. + std::atexit(&mpart::Finalize); - const char* warningStr = std::getenv("MPART_WARNINGS"); + // Update the state to remember that we called Initialize + GetInitializeStatusObject().Set(); - bool shouldPrint = true; - if(warningStr != nullptr){ - std::string warningFlag = warningStr; + } else { + const char* warningStr = std::getenv("MPART_WARNINGS"); - // Convert to lowercase so we catch OFF, off, Off, or any combination of capitalization. - std::transform(warningFlag.begin(), warningFlag.end(), warningFlag.begin(), [](unsigned char c){ return std::tolower(c); }); + bool shouldPrint = true; + if (warningStr != nullptr) { + std::string warningFlag = warningStr; - if(warningFlag=="off") - shouldPrint = false; - } + // Convert to lowercase so we catch OFF, off, Off, or any combination of + // capitalization. + std::transform(warningFlag.begin(), warningFlag.end(), + warningFlag.begin(), + [](unsigned char c) { return std::tolower(c); }); - if(shouldPrint) - std::cout << "WARNING: mpart::Initialize has already been called. Any changes to runtime settings (e.g., \"--kokkos-threads\") will not go into effect." << std::endl; - } + if (warningFlag == "off") shouldPrint = false; } -} // namespace mpart + if (shouldPrint) + std::cout + << "WARNING: mpart::Initialize has already been called. Any " + "changes to runtime settings (e.g., \"--kokkos-num-threads\") " + "will not go into effect." + << std::endl; + } +} + +} // namespace mpart #endif \ No newline at end of file diff --git a/docs/source/installation.rst b/docs/source/installation.rst index b57924f4..45428018 100644 --- a/docs/source/installation.rst +++ b/docs/source/installation.rst @@ -94,7 +94,7 @@ Or, with the additional specification of the number of Kokkos threads to use: .. code-block:: - ./RunTests --kokkos-threads=4 + ./RunTests --kokkos-num-threads=4 Environment Paths diff --git a/tests/RunTests.cpp b/tests/RunTests.cpp index 051bd5dc..4e3cfff6 100644 --- a/tests/RunTests.cpp +++ b/tests/RunTests.cpp @@ -2,25 +2,26 @@ #include "MParT/Initialization.h" -int main( int argc, char* argv[] ) { - mpart::Initialize(argc,argv); +int main(int argc, char* argv[]) { + mpart::Initialize(argc, argv); - Catch::Session session; // There must be exactly one instance + Catch::Session session; // There must be exactly one instance - int cores = 0; // Some user variable you want to be able to set + int cores = 0; // Some user variable you want to be able to set // Build a new parser on top of Catch2's using namespace Catch::Clara; - auto cli - = session.cli() | Opt( cores, "kokkos-thread" ) ["--kokkos-threads"]("Number of cores to use with Kokkos."); + auto cli = + session.cli() | Opt(cores, "kokkos-thread")["--kokkos-num-threads"]( + "Number of cores to use with Kokkos."); // Now pass the new composite back to Catch2 so it uses that - session.cli( cli ); + session.cli(cli); // Let Catch2 (using Clara) parse the command line - int returnCode = session.applyCommandLine( argc, argv ); - if( returnCode != 0 ) // Indicates a command line error - return returnCode; + int returnCode = session.applyCommandLine(argc, argv); + if (returnCode != 0) // Indicates a command line error + return returnCode; session.run(); } \ No newline at end of file From 247a7244858511eedbc5745ac016a6488f6c3943 Mon Sep 17 00:00:00 2001 From: Daniel Sharp Date: Tue, 4 Nov 2025 17:39:29 -0500 Subject: [PATCH 05/21] Fix deploy --- .github/environment.yml | 1 + .github/workflows/build-tests.yml | 4 +--- .github/workflows/pypi-deploy.yml | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/environment.yml b/.github/environment.yml index e14fe0d1..6f8ad3e8 100644 --- a/.github/environment.yml +++ b/.github/environment.yml @@ -15,3 +15,4 @@ dependencies: - pytorch - cxx-compiler - dill + - cmake =3.31 diff --git a/.github/workflows/build-tests.yml b/.github/workflows/build-tests.yml index 2ba6d1bf..44e5f406 100644 --- a/.github/workflows/build-tests.yml +++ b/.github/workflows/build-tests.yml @@ -25,7 +25,7 @@ jobs: run: cd build; make -j2 - name: Run Tests - run: cd build; ./RunTests --kokkos-threads=2 --reporter junit -o test-results.xml + run: cd build; ./RunTests --kokkos-num-threads=2 --reporter junit -o test-results.xml - name: Publish Unit Test Results uses: EnricoMi/publish-unit-test-result-action@v1 @@ -33,5 +33,3 @@ jobs: with: check_name: "Test Results" files: build/test-results.xml - - diff --git a/.github/workflows/pypi-deploy.yml b/.github/workflows/pypi-deploy.yml index bb0915f9..48c59fb9 100644 --- a/.github/workflows/pypi-deploy.yml +++ b/.github/workflows/pypi-deploy.yml @@ -37,7 +37,7 @@ jobs: - name: Build sdist run: pipx run build --sdist - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: path: dist/*.tar.gz From 5e078ba0df66d6d909b4e5cd62883587d8e0fc42 Mon Sep 17 00:00:00 2001 From: Daniel Sharp Date: Tue, 4 Nov 2025 17:48:04 -0500 Subject: [PATCH 06/21] Work on bindings --- .github/workflows/build-bindings.yml | 16 ++++++---------- .github/workflows/build-doc.yml | 6 +++--- .github/workflows/build-external-lib-tests.yml | 13 +++++-------- .github/workflows/build-tests.yml | 3 +++ 4 files changed, 17 insertions(+), 21 deletions(-) diff --git a/.github/workflows/build-bindings.yml b/.github/workflows/build-bindings.yml index 91337b47..3208f92a 100644 --- a/.github/workflows/build-bindings.yml +++ b/.github/workflows/build-bindings.yml @@ -8,13 +8,12 @@ on: pull_request: {} env: - CONDA_CACHE_NUMBER: 0 # increase to reset cache manually + CONDA_CACHE_NUMBER: 0 # increase to reset cache manually jobs: build-tests: runs-on: ubuntu-latest steps: - - name: Store Date shell: bash -l {0} run: echo "DATE=$(date +'%Y%m%d')" >> $GITHUB_ENV @@ -25,14 +24,11 @@ jobs: path: mpart - name: Use Conda - uses: conda-incubator/setup-miniconda@v2 + uses: conda-incubator/setup-miniconda@v3 with: - miniforge-variant: Mambaforge - miniforge-version: latest - activate-environment: test - use-mamba: true auto-update-conda: true python-version: "3.8" + activate-environment: "test" - name: Cache Conda Deps uses: actions/cache@v3 @@ -62,7 +58,7 @@ jobs: id: cache-kokkos with: path: "${{ github.workspace }}/KOKKOS_INSTALL" - key: kokkos4.2.00 + key: kokkos4.5.01 - if: ${{steps.cache-kokkos.outputs.cache-hit != 'true'}} name: Checkout Kokkos @@ -70,7 +66,7 @@ jobs: with: repository: kokkos/kokkos path: kokkos - ref: '4.2.00' + ref: "4.5.01" - if: ${{steps.cache-kokkos.outputs.cache-hit != 'true'}} name: Install Kokkos @@ -132,4 +128,4 @@ jobs: if: always() with: check_name: "Test Results with Bindings" - junit_files: ${{ github.workspace }}/test-results-*.xml \ No newline at end of file + junit_files: ${{ github.workspace }}/test-results-*.xml diff --git a/.github/workflows/build-doc.yml b/.github/workflows/build-doc.yml index 16e54588..a0a5ff9b 100644 --- a/.github/workflows/build-doc.yml +++ b/.github/workflows/build-doc.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Use Conda - uses: conda-incubator/setup-miniconda@v2 + uses: conda-incubator/setup-miniconda@v3 with: auto-update-conda: true python-version: "3.11" @@ -46,8 +46,8 @@ jobs: - name: Build Docs shell: bash -l {0} run: | - cd ${{ github.workspace }} && cd build - make sphinx + cd ${{ github.workspace }} && cd build + make sphinx - name: Push to gh-pages uses: peaceiris/actions-gh-pages@v3.6.1 diff --git a/.github/workflows/build-external-lib-tests.yml b/.github/workflows/build-external-lib-tests.yml index e58f2c03..caaa6ebe 100644 --- a/.github/workflows/build-external-lib-tests.yml +++ b/.github/workflows/build-external-lib-tests.yml @@ -8,7 +8,7 @@ on: pull_request: {} env: - CONDA_CACHE_NUMBER: 0 # increase to reset cache manually + CONDA_CACHE_NUMBER: 0 # increase to reset cache manually jobs: build-tests: @@ -24,14 +24,11 @@ jobs: path: mpart - name: Use Conda - uses: conda-incubator/setup-miniconda@v2 + uses: conda-incubator/setup-miniconda@v3 with: - miniforge-variant: Mambaforge - miniforge-version: latest - activate-environment: test - use-mamba: true auto-update-conda: true python-version: "3.8" + activate-environment: "test" - name: Cache Conda Deps uses: actions/cache@v3 @@ -53,7 +50,7 @@ jobs: with: repository: kokkos/kokkos path: kokkos - ref: '4.2.00' + ref: "4.2.00" - if: ${{steps.cache-kokkos.outputs.cache-hit != 'true'}} name: Install Kokkos @@ -93,4 +90,4 @@ jobs: if: always() with: check_name: "Test Results with Externally Built Libraries" - junit_files: ${{ github.workspace }}/mpart/build/test-results-external.xml \ No newline at end of file + junit_files: ${{ github.workspace }}/mpart/build/test-results-external.xml diff --git a/.github/workflows/build-tests.yml b/.github/workflows/build-tests.yml index 44e5f406..28412206 100644 --- a/.github/workflows/build-tests.yml +++ b/.github/workflows/build-tests.yml @@ -14,6 +14,9 @@ jobs: - name: Checkout uses: actions/checkout@v1 + - name: Install CMake + uses: lukka/get-cmake@3.26.0 + - name: Run CMake run: | cd ${{ github.workspace }} From bf9ae46bb9618ab334bd95850e83a5df0d915acb Mon Sep 17 00:00:00 2001 From: Daniel Sharp Date: Tue, 4 Nov 2025 17:48:49 -0500 Subject: [PATCH 07/21] Fix cmake build-tests --- .github/workflows/build-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-tests.yml b/.github/workflows/build-tests.yml index 28412206..d595b417 100644 --- a/.github/workflows/build-tests.yml +++ b/.github/workflows/build-tests.yml @@ -15,7 +15,7 @@ jobs: uses: actions/checkout@v1 - name: Install CMake - uses: lukka/get-cmake@3.26.0 + uses: lukka/get-cmake@v3.26.0 - name: Run CMake run: | From 610099c85a56c5f07d93a1da6b6e682a5b0b3c94 Mon Sep 17 00:00:00 2001 From: Daniel Sharp Date: Tue, 4 Nov 2025 17:49:32 -0500 Subject: [PATCH 08/21] Fix mamba --- .github/workflows/build-bindings.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-bindings.yml b/.github/workflows/build-bindings.yml index 3208f92a..ca27c5d7 100644 --- a/.github/workflows/build-bindings.yml +++ b/.github/workflows/build-bindings.yml @@ -39,7 +39,7 @@ jobs: - name: Install Conda Dependencies shell: bash -l {0} - run: mamba env update -n test -f $GITHUB_WORKSPACE/mpart/.github/environment.yml + run: conda env update -n test -f $GITHUB_WORKSPACE/mpart/.github/environment.yml if: steps.cache-conda.outputs.cache-hit != 'true' - name: Setup Julia From bda5d8babca3858ff66de933dc243f30d2a105ca Mon Sep 17 00:00:00 2001 From: Daniel Sharp Date: Tue, 4 Nov 2025 17:55:13 -0500 Subject: [PATCH 09/21] Pin cmake version --- .github/workflows/build-tests.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-tests.yml b/.github/workflows/build-tests.yml index d595b417..62636050 100644 --- a/.github/workflows/build-tests.yml +++ b/.github/workflows/build-tests.yml @@ -15,7 +15,10 @@ jobs: uses: actions/checkout@v1 - name: Install CMake - uses: lukka/get-cmake@v3.26.0 + uses: lukka/get-cmake@latest + with: + cmakeVersion: 3.25.2 + ninjaVersion: 1.13.1 - name: Run CMake run: | @@ -25,7 +28,7 @@ jobs: cmake -DKokkos_ENABLE_THREADS=ON -DKokkos_ENABLE_SERIAL=ON ../ - name: Build - run: cd build; make -j2 + run: cd build; ninja - name: Run Tests run: cd build; ./RunTests --kokkos-num-threads=2 --reporter junit -o test-results.xml From f256cf9ebc234c920aafc3029a01afe6293e85f9 Mon Sep 17 00:00:00 2001 From: Daniel Sharp Date: Tue, 4 Nov 2025 17:58:14 -0500 Subject: [PATCH 10/21] Fix julia version in binding setup --- .github/workflows/build-bindings.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build-bindings.yml b/.github/workflows/build-bindings.yml index ca27c5d7..553bc67a 100644 --- a/.github/workflows/build-bindings.yml +++ b/.github/workflows/build-bindings.yml @@ -41,6 +41,9 @@ jobs: shell: bash -l {0} run: conda env update -n test -f $GITHUB_WORKSPACE/mpart/.github/environment.yml if: steps.cache-conda.outputs.cache-hit != 'true' + - uses: julia-actions/setup-julia@v2 + with: + version: "1.10" - name: Setup Julia run: | From e89bd6ddece63fc850160f31c1e28e02792dc957 Mon Sep 17 00:00:00 2001 From: Daniel Sharp Date: Tue, 4 Nov 2025 18:03:29 -0500 Subject: [PATCH 11/21] Fix another kokkos-threads --- .github/workflows/build-external-lib-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-external-lib-tests.yml b/.github/workflows/build-external-lib-tests.yml index caaa6ebe..e8c59ff6 100644 --- a/.github/workflows/build-external-lib-tests.yml +++ b/.github/workflows/build-external-lib-tests.yml @@ -83,7 +83,7 @@ jobs: - name: Run Tests shell: bash -l {0} - run: cd $GITHUB_WORKSPACE/mpart/build; ./RunTests --kokkos-threads=2 --reporter junit -o test-results-external.xml + run: cd $GITHUB_WORKSPACE/mpart/build; ./RunTests --kokkos-num-threads=2 --reporter junit -o test-results-external.xml - name: Publish Unit Test Results uses: EnricoMi/publish-unit-test-result-action@v2 From c62a04ffea65aa7981f8ed3ed41d60efa66ef82e Mon Sep 17 00:00:00 2001 From: Daniel Sharp Date: Tue, 4 Nov 2025 18:14:44 -0500 Subject: [PATCH 12/21] Fix kokkos version external lib --- .github/workflows/build-external-lib-tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-external-lib-tests.yml b/.github/workflows/build-external-lib-tests.yml index e8c59ff6..11738e1a 100644 --- a/.github/workflows/build-external-lib-tests.yml +++ b/.github/workflows/build-external-lib-tests.yml @@ -42,7 +42,7 @@ jobs: id: cache-kokkos with: path: "${{ github.workspace }}/KOKKOS_INSTALL" - key: kokkos4.2.00 + key: kokkos4.5.01 - if: ${{steps.cache-kokkos.outputs.cache-hit != 'true'}} name: Checkout Kokkos @@ -50,7 +50,7 @@ jobs: with: repository: kokkos/kokkos path: kokkos - ref: "4.2.00" + ref: "4.5.01" - if: ${{steps.cache-kokkos.outputs.cache-hit != 'true'}} name: Install Kokkos From 6197efee697d155229c67552d7260727edabf531 Mon Sep 17 00:00:00 2001 From: Daniel Sharp Date: Tue, 4 Nov 2025 18:16:11 -0500 Subject: [PATCH 13/21] Fix ninja interface --- .github/workflows/build-tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-tests.yml b/.github/workflows/build-tests.yml index 62636050..c8e312d7 100644 --- a/.github/workflows/build-tests.yml +++ b/.github/workflows/build-tests.yml @@ -25,10 +25,10 @@ jobs: cd ${{ github.workspace }} mkdir build cd build - cmake -DKokkos_ENABLE_THREADS=ON -DKokkos_ENABLE_SERIAL=ON ../ + cmake -GNinja -DKokkos_ENABLE_THREADS=ON -DKokkos_ENABLE_SERIAL=ON ../ - name: Build - run: cd build; ninja + run: cd build; cmake --build . -- -j2 - name: Run Tests run: cd build; ./RunTests --kokkos-num-threads=2 --reporter junit -o test-results.xml From 7e5815ab3c4b53a2931b2d766158c6376965ef1e Mon Sep 17 00:00:00 2001 From: Daniel Sharp Date: Tue, 4 Nov 2025 18:20:45 -0500 Subject: [PATCH 14/21] Fix junit_files warning --- .github/workflows/build-bindings.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-bindings.yml b/.github/workflows/build-bindings.yml index 553bc67a..8a99f8a1 100644 --- a/.github/workflows/build-bindings.yml +++ b/.github/workflows/build-bindings.yml @@ -131,4 +131,4 @@ jobs: if: always() with: check_name: "Test Results with Bindings" - junit_files: ${{ github.workspace }}/test-results-*.xml + files: ${{ github.workspace }}/test-results-*.xml From 3c889cf4e73a29f29d0ac54b42d7e6d320e5277b Mon Sep 17 00:00:00 2001 From: Daniel Sharp Date: Tue, 4 Nov 2025 18:26:05 -0500 Subject: [PATCH 15/21] Fixing cmake install --- .docker/Dockerfile | 8 ++++---- .github/workflows/build-bindings.yml | 5 +++-- docs/source/installation.rst | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.docker/Dockerfile b/.docker/Dockerfile index 08be8db4..fd2397a6 100644 --- a/.docker/Dockerfile +++ b/.docker/Dockerfile @@ -16,8 +16,8 @@ RUN git clone --depth=1 --branch 3.7.02 https://github.com/kokkos/kokkos.git && -DBUILD_SHARED_LIBS=ON \ -DCMAKE_CXX_STANDARD=17 \ ../ && \ - make -j$(nproc) && \ - make install && \ + cmake --build . -- -j$(nproc) && \ + cmake --install . && \ cd / && \ rm -rf kokkos @@ -25,8 +25,8 @@ RUN cd MParT_ && \ mkdir build && \ cd build && \ cmake -DMPART_BUILD_TESTS=OFF -DPYTHON_EXECUTABLE=`which python` -DMPART_FETCH_DEPS=OFF ../ && \ - make -j$(nproc) && \ - make install && \ + cmake --build . -- -j$(nproc) && \ + cmake --install . && \ cd / && \ rm -rf MParT_ diff --git a/.github/workflows/build-bindings.yml b/.github/workflows/build-bindings.yml index 8a99f8a1..27465590 100644 --- a/.github/workflows/build-bindings.yml +++ b/.github/workflows/build-bindings.yml @@ -82,7 +82,8 @@ jobs: -DCMAKE_CXX_STANDARD=17 \ -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/KOKKOS_INSTALL/ \ ../ - sudo make -j2 install + sudo cmake --build . -- -j2 + sudo cmake --install . - name: Configure MParT shell: bash -l {0} @@ -96,7 +97,7 @@ jobs: - name: Build MParT shell: bash -l {0} - run: cd $GITHUB_WORKSPACE/mpart/build; make -j2 install + run: cd $GITHUB_WORKSPACE/mpart/build; cmake --build . -- -j2; cmake --install . - name: Run Python Tests continue-on-error: true diff --git a/docs/source/installation.rst b/docs/source/installation.rst index 45428018..7033f844 100644 --- a/docs/source/installation.rst +++ b/docs/source/installation.rst @@ -42,7 +42,7 @@ MParT uses CMake to handle dependencies and compiler configurations. A basic b .. make install -This will compile the main c++ :code:`mpart` library as well as any other language bindings that can be automatically configured. If you are compiling on a multicore machine, you can use :code:`make -j N_JOBS install`, where :code:`N_JOBS` is the number of processes the computer can compile with in parallel. +This will compile the main c++ :code:`mpart` library as well as any other language bindings that can be automatically configured. If you are compiling on a multicore machine, you can use :code:`cmake --build . -- -j N_JOBS`, where :code:`N_JOBS` is the number of processes the computer can compile with in parallel. This installation should also automatically install and build Kokkos, Eigen, Cereal, Pybind11, and Catch2, assuming they aren't installed already. If CMake has trouble finding prior installations of these, then you can configuring CMake using: From 82c9943e5cb8160e9c795e2e8fd113c173c990b9 Mon Sep 17 00:00:00 2001 From: Daniel Sharp Date: Tue, 4 Nov 2025 18:36:22 -0500 Subject: [PATCH 16/21] Fix cache-conda path --- .github/workflows/build-bindings.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-bindings.yml b/.github/workflows/build-bindings.yml index 27465590..ba6a688b 100644 --- a/.github/workflows/build-bindings.yml +++ b/.github/workflows/build-bindings.yml @@ -34,7 +34,7 @@ jobs: uses: actions/cache@v3 id: cache-conda with: - path: /usr/share/miniconda3/envs/test + path: /usr/share/miniconda/envs/test key: cache-conda-${{ hashFiles('mpart/.github/environment.yml') }}-${{ env.DATE }}-${{ env.CONDA_CACHE_NUMBER }}-BINDINGS - name: Install Conda Dependencies From 3ef517dbd7a82dec66b2958c1ebeeefa5510b5bc Mon Sep 17 00:00:00 2001 From: Daniel Sharp Date: Tue, 4 Nov 2025 18:45:58 -0500 Subject: [PATCH 17/21] Fix to g++-12 --- .github/workflows/build-tests.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/build-tests.yml b/.github/workflows/build-tests.yml index c8e312d7..c7fb9859 100644 --- a/.github/workflows/build-tests.yml +++ b/.github/workflows/build-tests.yml @@ -14,6 +14,11 @@ jobs: - name: Checkout uses: actions/checkout@v1 + - name: Install compiler + uses: rlalik/setup-cpp-compiler@master + with: + compiler: g++-12 + - name: Install CMake uses: lukka/get-cmake@latest with: From 3597b58011dc2fbba470bf0348f1f6fd3c05a3ca Mon Sep 17 00:00:00 2001 From: Daniel Sharp Date: Tue, 4 Nov 2025 18:49:49 -0500 Subject: [PATCH 18/21] Bump default catch2 to 3.4.0 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d7beddfb..e78feb97 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -297,7 +297,7 @@ if(MPART_BUILD_TESTS) FetchContent_Declare( Catch2 GIT_REPOSITORY https://github.com/catchorg/Catch2.git - GIT_TAG v3.2.1 + GIT_TAG v3.4.0 ) FetchContent_MakeAvailable(Catch2) From 9f2b8bf845a6ccdfe05d019fc2ee348872af7099 Mon Sep 17 00:00:00 2001 From: Daniel Sharp Date: Wed, 5 Nov 2025 10:15:59 -0500 Subject: [PATCH 19/21] Add max cmake version --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e78feb97..4010cb31 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.13) +cmake_minimum_required(VERSION 3.13 ...3.31) project(MParT VERSION 2.2.1) message(STATUS "Will install MParT to ${CMAKE_INSTALL_PREFIX}") From b2329f7d59c7c21e59f7ee9eaa6032997653a11f Mon Sep 17 00:00:00 2001 From: Daniel Sharp Date: Wed, 5 Nov 2025 10:23:15 -0500 Subject: [PATCH 20/21] Fix issue --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4010cb31..d978f44b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.13 ...3.31) +cmake_minimum_required(VERSION 3.13 ... 3.31) project(MParT VERSION 2.2.1) message(STATUS "Will install MParT to ${CMAKE_INSTALL_PREFIX}") From bbf8d96cd4672183212baa166e8330b2149c0857 Mon Sep 17 00:00:00 2001 From: Daniel Sharp Date: Wed, 5 Nov 2025 10:24:26 -0500 Subject: [PATCH 21/21] Fix version --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d978f44b..a550b354 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.13 ... 3.31) +cmake_minimum_required(VERSION 3.13...3.31) project(MParT VERSION 2.2.1) message(STATUS "Will install MParT to ${CMAKE_INSTALL_PREFIX}")