From dbbbe30276eac70b3577f49f9980c4b1d29b4424 Mon Sep 17 00:00:00 2001 From: Sichao25 Date: Wed, 4 Feb 2026 20:20:34 -0500 Subject: [PATCH 1/8] export gmsh and adios2 --- CMakeLists.txt | 6 +++++- cmake/bob.cmake | 15 +++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3bc22e4d..fc68fbb4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -48,7 +48,7 @@ endif() if (Omega_h_USE_MPI) enable_language(C) set(MPI_REQUIRED_VERSION 3) - bob_add_dependency(PUBLIC NAME MPI COMPONENTS CXX TARGETS MPI::MPI_CXX) + bob_add_dependency(PUBLIC NAME MPI COMPONENTS C CXX TARGETS MPI::MPI_CXX) endif() set(Omega_h_USE_ZLIB_DEFAULT ON) @@ -87,6 +87,10 @@ bob_add_dependency(PUBLIC NAME SEACASExodus TARGETS SEACASExodus::all_libs) set(Omega_h_USE_pybind11_DEFAULT OFF) bob_public_dep(pybind11) +set(Omega_h_USE_ADIOS2_DEFAULT OFF) +set(ADIOS2_PREFIX_DEFAULT ${ADIOS2_DIR}) +bob_add_dependency(PUBLIC NAME ADIOS2 TARGETS adios2::adios2) + if(Omega_h_USE_Kokkos) bob_option(Omega_h_USE_Kokkos_Sort "Use Kokkos sort_by_key instead of vendor (Thrust, SYCL, etc.) provided sorting APIs." ON) if(Omega_h_USE_Kokkos_Sort AND Kokkos_VERSION VERSION_LESS 4.3) diff --git a/cmake/bob.cmake b/cmake/bob.cmake index 6c57b5a6..ebaa3a7b 100644 --- a/cmake/bob.cmake +++ b/cmake/bob.cmake @@ -610,13 +610,28 @@ endmacro(latest_find_dependency)" set(FIND_DEPS_CONTENT) foreach(dep IN LISTS ${PROJECT_NAME}_DEPS) string(REPLACE ";" " " FIND_DEP_ARGS "${${dep}_find_package_args}") + # Enable C language before finding MPI if MPI requires C component + if(dep STREQUAL "MPI" AND FIND_DEP_ARGS MATCHES "C") + set(FIND_DEPS_CONTENT +"${FIND_DEPS_CONTENT} +enable_language(C)" + ) + endif() set(FIND_DEPS_CONTENT "${FIND_DEPS_CONTENT} latest_find_dependency(${dep} ${FIND_DEP_ARGS})" ) endforeach() + foreach(dep IN LISTS ${PROJECT_NAME}_DEPS) + if(EXISTS "${PROJECT_SOURCE_DIR}/cmake/Find${dep}.cmake") + install(FILES + "${PROJECT_SOURCE_DIR}/cmake/Find${dep}.cmake" + DESTINATION ${BOB_LIB_DESTINATION}/cmake/${PROJECT_NAME}) + endif() + endforeach() set(CONFIG_CONTENT "set(${PROJECT_NAME}_VERSION ${${PROJECT_NAME}_VERSION}) +list(APPEND CMAKE_MODULE_PATH \"\${CMAKE_CURRENT_LIST_DIR}\") ${LATEST_FIND_DEPENDENCY} ${FIND_DEPS_CONTENT} set(${PROJECT_NAME}_EXPORTED_TARGETS \"${${PROJECT_NAME}_EXPORTED_TARGETS}\") From 2ca568e02ac6209c04355a816a0f11c838a86858 Mon Sep 17 00:00:00 2001 From: Sichao25 Date: Thu, 12 Feb 2026 22:45:27 -0500 Subject: [PATCH 2/8] specify gmsh HINTS --- cmake/FindGmsh.cmake | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/cmake/FindGmsh.cmake b/cmake/FindGmsh.cmake index 68d5c77d..72821171 100644 --- a/cmake/FindGmsh.cmake +++ b/cmake/FindGmsh.cmake @@ -48,8 +48,23 @@ if(Gmsh_EXECUTABLE) endif() endif() -find_path(Gmsh_INCLUDE_DIRS NAMES gmsh.h) -find_library(Gmsh_LIBRARIES NAMES gmsh) +# Get hints from executable location +if(Gmsh_EXECUTABLE) + get_filename_component(Gmsh_BINARY_DIR "${Gmsh_EXECUTABLE}" DIRECTORY) + get_filename_component(Gmsh_PREFIX_HINT "${Gmsh_BINARY_DIR}" DIRECTORY) +endif() + +find_path(Gmsh_INCLUDE_DIRS + NAMES gmsh.h + HINTS ${Gmsh_PREFIX_HINT} + PATH_SUFFIXES include +) + +find_library(Gmsh_LIBRARIES + NAMES gmsh + HINTS ${Gmsh_PREFIX_HINT} + PATH_SUFFIXES lib lib64 +) include(FindPackageHandleStandardArgs) find_package_handle_standard_args( From 2166698329001e181d2cb62f7213f6beb631341b Mon Sep 17 00:00:00 2001 From: Sichao25 Date: Fri, 20 Feb 2026 17:57:29 -0500 Subject: [PATCH 3/8] add installation test --- .github/workflows/installation.yml | 236 +++++++++++++++++++ example/external_installation/CMakeLists.txt | 25 ++ example/external_installation/test_expot.cpp | 24 ++ 3 files changed, 285 insertions(+) create mode 100644 .github/workflows/installation.yml create mode 100644 example/external_installation/CMakeLists.txt create mode 100644 example/external_installation/test_expot.cpp diff --git a/.github/workflows/installation.yml b/.github/workflows/installation.yml new file mode 100644 index 00000000..15beda70 --- /dev/null +++ b/.github/workflows/installation.yml @@ -0,0 +1,236 @@ +name: CMake test matrix +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] +jobs: + build: + runs-on: ubuntu-22.04 + strategy: + matrix: + compiler: [g++, clang++] + + env: + CCACHE_DIR: ${{github.workspace}}/.ccache + CCACHE_BASEDIR: ${{github.workspace}} + CCACHE_COMPRESS: true + CCACHE_MAXSIZE: 100M + CMAKE_C_COMPILER_LAUNCHER: ccache + CMAKE_CXX_COMPILER_LAUNCHER: ccache + + steps: + - uses: actions/checkout@v4 + with: + path: omega_h + + - name: install mpich and dependencies + run: | + sudo apt update + sudo apt install mpich libhdf5-dev libnetcdf-dev clang + + - name: setup ccache + id: setup-ccache + run: | + sudo apt-get install ccache + ccache -p # Print ccache config + echo timestamp=$(date -u '+%Y-%m-%dT%T') >> "$GITHUB_OUTPUT" + + - name: ccache + uses: actions/cache@v4 + with: + path: ${{github.workspace}}/.ccache + key: "${{matrix.compiler}}-ccache-${{github.ref}}-${{github.sha}}" + restore-keys: | + ${{matrix.compiler}}-ccache-${{github.ref}}- + ${{matrix.compiler}}-ccache- + + - name: Clear ccache statistics + run: ccache -z + + - name: cache gmsh + id: cache-gmsh + uses: actions/cache@v3 + with: + path: ${{runner.temp}}/gmsh + key: build-gmsh-${{ matrix.compiler }} + + - name: clone gmsh + if: steps.cache-gmsh.outputs.cache-hit != 'true' + working-directory: ${{runner.temp }} + run: | + git clone --branch gmsh_4_14_1 https://gitlab.onelab.info/gmsh/gmsh.git + + - name: build and install gmsh + if: steps.cache-gmsh.outputs.cache-hit != 'true' + working-directory: ${{runner.temp}}/gmsh + run: | + mkdir build + cd build + cmake .. \ + -DENABLE_BUILD_DYNAMIC=1 \ + -DCMAKE_INSTALL_PREFIX=install \ + -DENABLE_BUILD_LIB=ON \ + -DBUILD_SHARED_LIBS=ON + cmake --build . -j 4 --target install + + - name: cache libMeshb + id: cache-libmeshb + uses: actions/cache@v3 + with: + path: ${{runner.temp}}/libmeshb + key: build-libmeshb-${{ matrix.compiler }} + + - name: clone libMeshb + if: steps.cache-libmeshb.outputs.cache-hit != 'true' + working-directory: ${{runner.temp }} + run: | + git clone --depth 1 https://github.com/LoicMarechal/libMeshb.git libmeshb + + - name: build and install libMeshb + if: steps.cache-libmeshb.outputs.cache-hit != 'true' + working-directory: ${{runner.temp }}/libmeshb + run: | + mkdir build + cd build + cmake .. \ + -DCMAKE_INSTALL_PREFIX=install \ + -DBUILD_SHARED_LIBS=ON + cmake --build . -j 4 --target install + + - name: cache kokkos + id: cache-kokkos + uses: actions/cache@v3 + with: + path: ${{runner.temp}}/kokkos + key: build-kokkos-${{ matrix.compiler }} + + - name: clone Kokkos + if: steps.cache-kokkos.outputs.cache-hit != 'true' + working-directory: ${{runner.temp }} + run: | + git clone --branch 5.0.0 https://github.com/kokkos/kokkos.git kokkos + + - name: build and install kokkos + if: steps.cache-kokkos.outputs.cache-hit != 'true' + working-directory: ${{runner.temp }}/kokkos + run: | + mkdir build + cd build + cmake .. \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_CXX_COMPILER=${{ matrix.compiler }} \ + -DCMAKE_INSTALL_PREFIX=install \ + -DKokkos_ENABLE_CUDA=OFF \ + -DBUILD_SHARED_LIBS=ON + cmake --build . -j 4 --target install + + - name: cache trilinos + id: cache-trilinos + uses: actions/cache@v3 + with: + path: ${{runner.temp}}/trilinos + key: build-trilinos-${{ matrix.compiler }} + + - name: clone Trilinos + if: steps.cache-trilinos.outputs.cache-hit != 'true' + working-directory: ${{runner.temp }} + run: | + git clone --depth 1 https://github.com/trilinos/Trilinos.git trilinos + + - name: build and install Trilinos + if: steps.cache-trilinos.outputs.cache-hit != 'true' + working-directory: ${{runner.temp }}/trilinos + run: | + mkdir build + cd build + cmake .. \ + -DCMAKE_INSTALL_PREFIX=install \ + -DBUILD_SHARED_LIBS:BOOL=ON \ + -DTPL_ENABLE_MPI:BOOL=ON \ + -DCMAKE_CXX_COMPILER:FILEPATH=mpicxx \ + -DCMAKE_C_COMPILER:FILEPATH=mpicc \ + -DTrilinos_ENABLE_Fortran=OFF \ + -DTrilinos_ENABLE_ALL_PACKAGES:BOOL=OFF \ + -DTrilinos_ENABLE_ALL_OPTIONAL_PACKAGES:BOOL=OFF \ + -DTrilinos_ENABLE_SEACAS:BOOL=ON \ + -DTrilinos_ENABLE_SEACASExodus:BOOL=ON \ + -DTrilinos_ENABLE_Kokkos:BOOL=ON + cmake --build . -j 4 --target install + + - name: cache ADIOS2 + id: cache-adios2 + uses: actions/cache@v3 + with: + path: ${{runner.temp}}/adios2 + key: build-adios2-${{ matrix.compiler }} + + - name: clone ADIOS2 + if: steps.cache-adios2.outputs.cache-hit != 'true' + working-directory: ${{runner.temp }} + run: | + git clone --depth 1 https://github.com/ornladios/ADIOS2.git adios2 + + - name: build and install ADIOS2 + if: steps.cache-adios2.outputs.cache-hit != 'true' + working-directory: ${{runner.temp }}/adios2 + run: | + mkdir build + cd build + cmake .. \ + -DCMAKE_INSTALL_PREFIX=install \ + -DADIOS2_USE_CUDA=OFF \ + -DCMAKE_CXX_COMPILER=mpicxx \ + -DCMAKE_C_COMPILER=mpicc \ + -DCMAKE_BUILD_TYPE=Release \ + -DADIOS2_USE_ZFP=OFF + cmake --build . -j 4 --target install + + - name: Set environment variables for gmsh + run: | + echo "CMAKE_PREFIX_PATH=${{runner.temp}}/gmsh/build/install:$CMAKE_PREFIX_PATH" >> $GITHUB_ENV + echo "LD_LIBRARY_PATH=${{runner.temp}}/gmsh/build/install/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV + echo "CMAKE_LIBRARY_PATH=${{runner.temp}}/adios2/build/install/lib:$CMAKE_LIBRARY_PATH" >> $GITHUB_ENV + + - name: build and install omega_h + working-directory: omega_h + run: | + ls ${{runner.temp}}/adios2/build/install/lib/cmake/adios2 + ls ${{runner.temp}}/adios2/build/install + ls ${{runner.temp}}/adios2/build/install/include + mkdir build + cd build + cmake .. \ + -DCMAKE_BUILD_TYPE="Release" \ + -DCMAKE_C_COMPILER_LAUNCHER=ccache \ + -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ + -DCMAKE_INSTALL_PREFIX=install \ + -DOmega_h_USE_MPI=on \ + -DOmega_h_USE_Kokkos=on \ + -DKokkos_PREFIX=${{runner.temp}}/kokkos/build/install \ + -DBUILD_TESTING=off \ + -DBUILD_SHARED_LIBS=on \ + -DOmega_h_USE_ADIOS2=ON \ + -DADIOS2_DIR=${{runner.temp}}/adios2/build/install/lib/cmake/adios2 \ + -DOmega_h_USE_Gmsh=ON \ + -DGmsh_INCLUDE_DIRS=${{runner.temp}}/gmsh/build/install/include \ + -DGmsh_LIBRARIES=${{runner.temp}}/gmsh/build/install/lib/libgmsh.so \ + -DOmega_h_USE_libMeshb=on \ + -DlibMeshb_PREFIX=${{runner.temp}}/libmeshb/build/install \ + -DOmega_h_USE_OpenMP=OFF \ + -DCMAKE_CXX_EXTENSIONS=OFF + cmake --build . -j 8 --target install + + - name: Print ccache statistics + run: ccache -s + + - name: test omega_h install + working-directory: omega_h/example/external_installation + run: | + mkdir build + cd build + cmake .. \ + -DOmega_h_DIR=${{github.workspace}}/omega_h/build/install/lib/cmake/Omega_h + cmake --build . -j 8 + + \ No newline at end of file diff --git a/example/external_installation/CMakeLists.txt b/example/external_installation/CMakeLists.txt new file mode 100644 index 00000000..194d7513 --- /dev/null +++ b/example/external_installation/CMakeLists.txt @@ -0,0 +1,25 @@ +cmake_minimum_required(VERSION 3.10) +project(TestOmegaHConfig CXX) + +set(CMAKE_CXX_EXTENSIONS OFF) + +# Enable testing +enable_testing() + +# Find Omega_h package +find_package(Omega_h REQUIRED) + +# Create test executable +add_executable(test_export test_export.cpp) + +# Link with Omega_h +target_link_libraries(test_export Omega_h::omega_h) + +# Set C++ standard to match Omega_h (C++17) +set_property(TARGET test_export PROPERTY CXX_STANDARD 17) +set_property(TARGET test_export PROPERTY CXX_STANDARD_REQUIRED ON) + +# Add test +add_test(NAME test_export COMMAND test_export) +set_tests_properties(test_export PROPERTIES + PASS_REGULAR_EXPRESSION "Test completed successfully!") \ No newline at end of file diff --git a/example/external_installation/test_expot.cpp b/example/external_installation/test_expot.cpp new file mode 100644 index 00000000..59b6f388 --- /dev/null +++ b/example/external_installation/test_expot.cpp @@ -0,0 +1,24 @@ +#include +#include +#include +#include +#include + +int main(int argc, char** argv) { + // Initialize Omega_h library + auto lib = Omega_h::Library(&argc, &argv); + auto world = lib.world(); + + // Create a simple 2D box mesh + std::cout << "Creating 2D box mesh..." << std::endl; + auto mesh = Omega_h::build_box(world, OMEGA_H_SIMPLEX, 1.0, 1.0, 0.0, 4, 4, 0); + + std::cout << "Mesh created with:" << std::endl; + std::cout << " Dimension: " << mesh.dim() << std::endl; + std::cout << " Vertices: " << mesh.nverts() << std::endl; + std::cout << " Elements: " << mesh.nelems() << std::endl; + + std::cout << "Test completed successfully!" << std::endl; + + return 0; +} \ No newline at end of file From 8726b5675dfa22c5e0300fc2b16a7f233ff13103 Mon Sep 17 00:00:00 2001 From: Sichao25 Date: Fri, 20 Feb 2026 18:56:52 -0500 Subject: [PATCH 4/8] debug typo --- example/external_installation/{test_expot.cpp => test_export.cpp} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename example/external_installation/{test_expot.cpp => test_export.cpp} (100%) diff --git a/example/external_installation/test_expot.cpp b/example/external_installation/test_export.cpp similarity index 100% rename from example/external_installation/test_expot.cpp rename to example/external_installation/test_export.cpp From da7098c7d0db2bb3ecd51aee182e0c0d253de377 Mon Sep 17 00:00:00 2001 From: Sichao25 Date: Wed, 27 May 2026 15:01:51 -0400 Subject: [PATCH 5/8] remove unnecessary cmake --- CMakeLists.txt | 11 ++++++++--- example/external_installation/CMakeLists.txt | 4 ---- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fc68fbb4..517e3912 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -46,9 +46,14 @@ if (Omega_h_ENABLE_DEMANGLED_STACKTRACE) endif() if (Omega_h_USE_MPI) - enable_language(C) - set(MPI_REQUIRED_VERSION 3) - bob_add_dependency(PUBLIC NAME MPI COMPONENTS C CXX TARGETS MPI::MPI_CXX) + if (Omega_h_USE_ADIOS2) + enable_language(C) + set(MPI_REQUIRED_VERSION 3) + bob_add_dependency(PUBLIC NAME MPI COMPONENTS C CXX TARGETS MPI::MPI_CXX) + else() + set(MPI_REQUIRED_VERSION 3) + bob_add_dependency(PUBLIC NAME MPI COMPONENTS CXX TARGETS MPI::MPI_CXX) + endif() endif() set(Omega_h_USE_ZLIB_DEFAULT ON) diff --git a/example/external_installation/CMakeLists.txt b/example/external_installation/CMakeLists.txt index 194d7513..13fb3a8f 100644 --- a/example/external_installation/CMakeLists.txt +++ b/example/external_installation/CMakeLists.txt @@ -15,10 +15,6 @@ add_executable(test_export test_export.cpp) # Link with Omega_h target_link_libraries(test_export Omega_h::omega_h) -# Set C++ standard to match Omega_h (C++17) -set_property(TARGET test_export PROPERTY CXX_STANDARD 17) -set_property(TARGET test_export PROPERTY CXX_STANDARD_REQUIRED ON) - # Add test add_test(NAME test_export COMMAND test_export) set_tests_properties(test_export PROPERTIES From 3739b0742856d56806b75e7c0910dcdcbb3e7f3c Mon Sep 17 00:00:00 2001 From: Sichao25 Date: Wed, 27 May 2026 15:50:30 -0400 Subject: [PATCH 6/8] remove duplicate find package --- src/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index f08293c0..73ff9921 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -169,7 +169,6 @@ endif() message(STATUS "Omega_h_USE_ADIOS2: ${Omega_h_USE_ADIOS2}") if(Omega_h_USE_ADIOS2) list(APPEND Omega_h_SOURCES Omega_h_adios2.cpp) - find_package(ADIOS2 REQUIRED) endif() if(Omega_h_USE_SEACASExodus) From 55fe23d222e0aadfe107894a5fd422a10dfd6cc3 Mon Sep 17 00:00:00 2001 From: Sichao25 Date: Wed, 27 May 2026 17:43:02 -0400 Subject: [PATCH 7/8] set libmeshb version --- .github/workflows/installation.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/installation.yml b/.github/workflows/installation.yml index 15beda70..afa0210b 100644 --- a/.github/workflows/installation.yml +++ b/.github/workflows/installation.yml @@ -1,4 +1,4 @@ -name: CMake test matrix +name: CMake installation test matrix on: push: branches: [ master ] @@ -85,7 +85,7 @@ jobs: if: steps.cache-libmeshb.outputs.cache-hit != 'true' working-directory: ${{runner.temp }} run: | - git clone --depth 1 https://github.com/LoicMarechal/libMeshb.git libmeshb + git clone --branch v7.80 --depth 1 https://github.com/LoicMarechal/libMeshb.git libmeshb - name: build and install libMeshb if: steps.cache-libmeshb.outputs.cache-hit != 'true' From 1115a87db836860d3870459ae1976c3f7d5b987e Mon Sep 17 00:00:00 2001 From: Sichao25 Date: Fri, 28 Aug 2026 00:31:32 -0400 Subject: [PATCH 8/8] merge installation test to cmake CI --- .github/workflows/cmake.yml | 210 ++++++++++++++++++++++--- .github/workflows/installation.yml | 236 ----------------------------- 2 files changed, 190 insertions(+), 256 deletions(-) delete mode 100644 .github/workflows/installation.yml diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index b4dc6b7c..fd407984 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -17,6 +17,7 @@ jobs: mempool: [on, off] cxx_standard: [17] python: [off] + installation_test: [off] exclude: - kokkos: off mempool: on @@ -34,6 +35,12 @@ jobs: mpi: on cxx_standard: 20 python: on + #run one config as installation test + - compiler: g++ + mpi: on + kokkos: on + mempool: on + installation_test: on env: CXX: ${{matrix.compiler}} MPICH_CXX: ${{matrix.compiler}} @@ -106,7 +113,7 @@ jobs: -Bbuild -DCMAKE_CXX_COMPILER=${{ matrix.compiler }} -DCMAKE_INSTALL_PREFIX=build/install - -DBUILD_SHARED_LIBS=${{ matrix.python }} + -DBUILD_SHARED_LIBS=${{ matrix.installation_test == 'on' || matrix.python }} - name: Build Kokkos if: ${{ matrix.kokkos == 'on' }} @@ -129,57 +136,220 @@ jobs: -DCMAKE_INSTALL_PREFIX=build/install -DADIOS2_USE_CUDA=OFF -DADIOS2_USE_ZFP=OFF - -DBUILD_SHARED_LIBS=${{ matrix.python }} + -DBUILD_SHARED_LIBS=${{ matrix.installation_test == 'on' || matrix.python }} - name: Build ADIOS2 if: ${{ matrix.mpi == 'on' }} shell: bash run: cmake --build $GITHUB_WORKSPACE/ADIOS2/build --target install + - name: cache hdf5 + id: cache-hdf5 + if: ${{ matrix.installation_test == 'on' }} + uses: actions/cache@v3 + with: + path: ${{runner.temp}}/hdf5 + key: build-hdf5-${{ matrix.compiler }} + + - name: clone hdf5 + if: ${{ matrix.installation_test == 'on' && steps.cache-hdf5.outputs.cache-hit != 'true' }} + working-directory: ${{runner.temp}} + run: git clone https://github.com/HDFGroup/hdf5.git hdf5 + + - name: build and install hdf5 + if: ${{ matrix.installation_test == 'on' && steps.cache-hdf5.outputs.cache-hit != 'true' }} + working-directory: ${{runner.temp}}/hdf5 + run: | + mkdir build + cd build + cmake .. \ + -DCMAKE_CXX_COMPILER=$CXX \ + -DCMAKE_C_COMPILER=$CC \ + -DCMAKE_INSTALL_PREFIX=install \ + -DBUILD_SHARED_LIBS=ON \ + -DHDF5_BUILD_HL_LIB=ON \ + -DHDF5_ENABLE_PARALLEL=ON \ + -DHDF5_ENABLE_ZLIB_SUPPORT=ON + cmake --build . -j 4 --target install + + - name: cache netcdf + id: cache-netcdf + if: ${{ matrix.installation_test == 'on' }} + uses: actions/cache@v3 + with: + path: ${{runner.temp}}/netcdf-c + key: build-netcdf-${{ matrix.compiler }} + + - name: clone netcdf + if: ${{ matrix.installation_test == 'on' && steps.cache-netcdf.outputs.cache-hit != 'true' }} + working-directory: ${{runner.temp}} + run: git clone https://github.com/Unidata/netcdf-c.git netcdf-c + + - name: build and install netcdf + if: ${{ matrix.installation_test == 'on' && steps.cache-netcdf.outputs.cache-hit != 'true' }} + working-directory: ${{runner.temp}}/netcdf-c + run: | + mkdir build + cd build + cmake .. \ + -DCMAKE_CXX_COMPILER=$CXX \ + -DCMAKE_C_COMPILER=$CC \ + -DCMAKE_INSTALL_PREFIX=install \ + -DBUILD_SHARED_LIBS=ON \ + -DHDF5_ROOT=${{runner.temp}}/hdf5/build/install \ + -DNETCDF_ENABLE_HDF5=ON \ + -DNETCDF_ENABLE_DAP=OFF \ + -DNETCDF_ENABLE_LOGGING=ON \ + -DNETCDF_ENABLE_LIBXML2=OFF + cmake --build . -j 4 --target install + + - name: cache seacas + id: cache-seacas + if: ${{ matrix.installation_test == 'on' }} + uses: actions/cache@v3 + with: + path: ${{runner.temp}}/seacas + key: build-seacas-${{ matrix.compiler }} + + - name: clone seacas + if: ${{ matrix.installation_test == 'on' && steps.cache-seacas.outputs.cache-hit != 'true' }} + working-directory: ${{runner.temp}} + run: git clone --depth 1 https://github.com/sandialabs/seacas.git seacas + + - name: build and install seacas + if: ${{ matrix.installation_test == 'on' && steps.cache-seacas.outputs.cache-hit != 'true' }} + working-directory: ${{runner.temp}}/seacas + run: | + mkdir build + cd build + cmake .. \ + -DCMAKE_CXX_COMPILER=$CXX \ + -DCMAKE_C_COMPILER=$CC \ + -DCMAKE_INSTALL_PREFIX=install \ + -DBUILD_SHARED_LIBS=ON \ + -DSeacas_ENABLE_SEACASExodus=ON \ + -DSeacas_ENABLE_Fortran=OFF \ + -DSeacas_ENABLE_TESTS=OFF \ + -DTPL_ENABLE_Netcdf=ON \ + -DTPL_ENABLE_MPI=ON \ + -DTPL_ENABLE_Pthread=OFF \ + -DNetCDF_ROOT=${{runner.temp}}/netcdf-c/build/install \ + -DHDF5_ROOT=${{runner.temp}}/hdf5/build/install \ + -DHDF5_NO_SYSTEM_PATHS=YES + cmake --build . -j 4 --target install + + - name: cache libMeshb + id: cache-libmeshb + if: ${{ matrix.installation_test == 'on' }} + uses: actions/cache@v3 + with: + path: ${{runner.temp}}/libmeshb + key: build-libmeshb-${{ matrix.compiler }} + + - name: clone libMeshb + if: ${{ matrix.installation_test == 'on' && steps.cache-libmeshb.outputs.cache-hit != 'true' }} + working-directory: ${{runner.temp}} + run: git clone --branch v7.80 --depth 1 https://github.com/LoicMarechal/libMeshb.git libmeshb + + - name: build and install libMeshb + if: ${{ matrix.installation_test == 'on' && steps.cache-libmeshb.outputs.cache-hit != 'true' }} + working-directory: ${{runner.temp}}/libmeshb + run: | + mkdir build + cd build + cmake .. \ + -DCMAKE_INSTALL_PREFIX=install \ + -DBUILD_SHARED_LIBS=ON + cmake --build . -j 4 --target install + - name: Configure CMake shell: bash working-directory: ${{github.workspace}}/omega_h run: | export CMAKE_PREFIX_PATH="${{runner.temp }}/gmsh/install:$CMAKE_PREFIX_PATH" - export LD_LIBRARY_PATH="${{runner.temp }}/gmsh/install/lib:$LD_LIBRARY_PATH" export CMAKE_PREFIX_PATH="$GITHUB_WORKSPACE/ADIOS2/build/install:$CMAKE_PREFIX_PATH" if [ "${{ matrix.python }}" == "on" ]; then export CMAKE_PREFIX_PATH="$(python -m pybind11 --cmakedir):$CMAKE_PREFIX_PATH" fi - cmake . -Bbuild \ - -DCMAKE_CXX_COMPILER=$CXX \ - -DCMAKE_CXX_STANDARD=${{ matrix.cxx_standard }} \ - -DCMAKE_VERBOSE_MAKEFILE=on \ - -DOmega_h_USE_MPI=${{ matrix.mpi }} \ - -DOmega_h_USE_Kokkos=${{ matrix.kokkos }} \ - -DKokkos_PREFIX=$GITHUB_WORKSPACE/kokkos/build/install \ - -DOmega_h_USE_pybind11=${{ matrix.python }} \ - -DOmega_h_USE_Gmsh=ON \ - -DGmsh_INCLUDE_DIRS=${{runner.temp }}/gmsh/install/include \ - -DGmsh_LIBRARIES=${{runner.temp }}/gmsh/install/lib/libgmsh.so.4.14.1 \ - -DOmega_h_USE_ADIOS2=${{ matrix.mpi }} \ - -DBUILD_TESTING=ON \ - -DBUILD_SHARED_LIBS=${{ matrix.python }} \ - -DENABLE_CTEST_MEMPOOL=${{ matrix.mempool }} + if [ "${{ matrix.installation_test }}" == "on" ]; then + cmake . -Bbuild \ + -DCMAKE_CXX_COMPILER=$CXX \ + -DCMAKE_CXX_STANDARD=${{ matrix.cxx_standard }} \ + -DCMAKE_VERBOSE_MAKEFILE=on \ + -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/omega_h/build/install \ + -DOmega_h_USE_MPI=ON \ + -DOmega_h_USE_Kokkos=ON \ + -DKokkos_PREFIX=$GITHUB_WORKSPACE/kokkos/build/install \ + -DOmega_h_USE_Gmsh=ON \ + -DGmsh_INCLUDE_DIRS=${{runner.temp }}/gmsh/install/include \ + -DGmsh_LIBRARIES=${{runner.temp }}/gmsh/install/lib/libgmsh.so.4.14.1 \ + -DOmega_h_USE_ADIOS2=ON \ + -DOmega_h_USE_libMeshb=ON \ + -DlibMeshb_PREFIX=${{runner.temp}}/libmeshb/build/install \ + -DOmega_h_USE_SEACASExodus=ON \ + -DSEACASExodus_PREFIX=${{runner.temp}}/seacas/build/install \ + -DBUILD_TESTING=OFF \ + -DBUILD_SHARED_LIBS=ON + else + cmake . -Bbuild \ + -DCMAKE_CXX_COMPILER=$CXX \ + -DCMAKE_CXX_STANDARD=${{ matrix.cxx_standard }} \ + -DCMAKE_VERBOSE_MAKEFILE=on \ + -DOmega_h_USE_MPI=${{ matrix.mpi }} \ + -DOmega_h_USE_Kokkos=${{ matrix.kokkos }} \ + -DKokkos_PREFIX=$GITHUB_WORKSPACE/kokkos/build/install \ + -DOmega_h_USE_pybind11=${{ matrix.python }} \ + -DOmega_h_USE_Gmsh=ON \ + -DGmsh_INCLUDE_DIRS=${{runner.temp }}/gmsh/install/include \ + -DGmsh_LIBRARIES=${{runner.temp }}/gmsh/install/lib/libgmsh.so.4.14.1 \ + -DOmega_h_USE_ADIOS2=${{ matrix.mpi }} \ + -DBUILD_TESTING=ON \ + -DBUILD_SHARED_LIBS=${{ matrix.python }} \ + -DENABLE_CTEST_MEMPOOL=${{ matrix.mempool }} + fi - name: Build + if: ${{ matrix.installation_test != 'on' }} working-directory: ${{github.workspace}}/omega_h/build shell: bash run: cmake --build . -j2 - name: Test + if: ${{ matrix.installation_test != 'on' }} working-directory: ${{github.workspace}}/omega_h/build shell: bash - run: ctest + run: | + export LD_LIBRARY_PATH="${{runner.temp}}/gmsh/install/lib:$GITHUB_WORKSPACE/kokkos/build/install/lib:$GITHUB_WORKSPACE/ADIOS2/build/install/lib:$LD_LIBRARY_PATH" + ctest - name: Test Python if: ${{ matrix.python == 'on' }} working-directory: ${{github.workspace}}/omega_h/build shell: bash run: | + export LD_LIBRARY_PATH="${{runner.temp}}/gmsh/install/lib:$GITHUB_WORKSPACE/kokkos/build/install/lib:$GITHUB_WORKSPACE/ADIOS2/build/install/lib:$LD_LIBRARY_PATH" export PYTHONPATH=${{github.workspace}}/omega_h/build/src:$PYTHONPATH pytest ${{github.workspace}}/omega_h/pytest + - name: Install + if: ${{ matrix.installation_test == 'on' }} + working-directory: ${{github.workspace}}/omega_h/build + shell: bash + run: cmake --build . -j2 --target install + + - name: Test Installation + if: ${{ matrix.installation_test == 'on' }} + working-directory: ${{github.workspace}}/omega_h/example/external_installation + shell: bash + run: | + export CMAKE_PREFIX_PATH="${{runner.temp}}/gmsh/install:$GITHUB_WORKSPACE/ADIOS2/build/install:$CMAKE_PREFIX_PATH" + export LD_LIBRARY_PATH="${{github.workspace}}/omega_h/build/install/lib:${{runner.temp}}/gmsh/install/lib:$GITHUB_WORKSPACE/kokkos/build/install/lib:$GITHUB_WORKSPACE/ADIOS2/build/install/lib:${{runner.temp}}/hdf5/build/install/lib:${{runner.temp}}/netcdf-c/build/install/lib:${{runner.temp}}/seacas/build/install/lib:${{runner.temp}}/libmeshb/build/install/lib:$LD_LIBRARY_PATH" + mkdir build + cd build + cmake .. -DOmega_h_DIR=${{github.workspace}}/omega_h/build/install/lib/cmake/Omega_h + cmake --build . + ctest --output-on-failure + - name: Print - if: always() + if: ${{ matrix.installation_test != 'on' && always() }} run: cat ${{github.workspace}}/omega_h/build/Testing/Temporary/LastTest.log diff --git a/.github/workflows/installation.yml b/.github/workflows/installation.yml deleted file mode 100644 index afa0210b..00000000 --- a/.github/workflows/installation.yml +++ /dev/null @@ -1,236 +0,0 @@ -name: CMake installation test matrix -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] -jobs: - build: - runs-on: ubuntu-22.04 - strategy: - matrix: - compiler: [g++, clang++] - - env: - CCACHE_DIR: ${{github.workspace}}/.ccache - CCACHE_BASEDIR: ${{github.workspace}} - CCACHE_COMPRESS: true - CCACHE_MAXSIZE: 100M - CMAKE_C_COMPILER_LAUNCHER: ccache - CMAKE_CXX_COMPILER_LAUNCHER: ccache - - steps: - - uses: actions/checkout@v4 - with: - path: omega_h - - - name: install mpich and dependencies - run: | - sudo apt update - sudo apt install mpich libhdf5-dev libnetcdf-dev clang - - - name: setup ccache - id: setup-ccache - run: | - sudo apt-get install ccache - ccache -p # Print ccache config - echo timestamp=$(date -u '+%Y-%m-%dT%T') >> "$GITHUB_OUTPUT" - - - name: ccache - uses: actions/cache@v4 - with: - path: ${{github.workspace}}/.ccache - key: "${{matrix.compiler}}-ccache-${{github.ref}}-${{github.sha}}" - restore-keys: | - ${{matrix.compiler}}-ccache-${{github.ref}}- - ${{matrix.compiler}}-ccache- - - - name: Clear ccache statistics - run: ccache -z - - - name: cache gmsh - id: cache-gmsh - uses: actions/cache@v3 - with: - path: ${{runner.temp}}/gmsh - key: build-gmsh-${{ matrix.compiler }} - - - name: clone gmsh - if: steps.cache-gmsh.outputs.cache-hit != 'true' - working-directory: ${{runner.temp }} - run: | - git clone --branch gmsh_4_14_1 https://gitlab.onelab.info/gmsh/gmsh.git - - - name: build and install gmsh - if: steps.cache-gmsh.outputs.cache-hit != 'true' - working-directory: ${{runner.temp}}/gmsh - run: | - mkdir build - cd build - cmake .. \ - -DENABLE_BUILD_DYNAMIC=1 \ - -DCMAKE_INSTALL_PREFIX=install \ - -DENABLE_BUILD_LIB=ON \ - -DBUILD_SHARED_LIBS=ON - cmake --build . -j 4 --target install - - - name: cache libMeshb - id: cache-libmeshb - uses: actions/cache@v3 - with: - path: ${{runner.temp}}/libmeshb - key: build-libmeshb-${{ matrix.compiler }} - - - name: clone libMeshb - if: steps.cache-libmeshb.outputs.cache-hit != 'true' - working-directory: ${{runner.temp }} - run: | - git clone --branch v7.80 --depth 1 https://github.com/LoicMarechal/libMeshb.git libmeshb - - - name: build and install libMeshb - if: steps.cache-libmeshb.outputs.cache-hit != 'true' - working-directory: ${{runner.temp }}/libmeshb - run: | - mkdir build - cd build - cmake .. \ - -DCMAKE_INSTALL_PREFIX=install \ - -DBUILD_SHARED_LIBS=ON - cmake --build . -j 4 --target install - - - name: cache kokkos - id: cache-kokkos - uses: actions/cache@v3 - with: - path: ${{runner.temp}}/kokkos - key: build-kokkos-${{ matrix.compiler }} - - - name: clone Kokkos - if: steps.cache-kokkos.outputs.cache-hit != 'true' - working-directory: ${{runner.temp }} - run: | - git clone --branch 5.0.0 https://github.com/kokkos/kokkos.git kokkos - - - name: build and install kokkos - if: steps.cache-kokkos.outputs.cache-hit != 'true' - working-directory: ${{runner.temp }}/kokkos - run: | - mkdir build - cd build - cmake .. \ - -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_CXX_COMPILER=${{ matrix.compiler }} \ - -DCMAKE_INSTALL_PREFIX=install \ - -DKokkos_ENABLE_CUDA=OFF \ - -DBUILD_SHARED_LIBS=ON - cmake --build . -j 4 --target install - - - name: cache trilinos - id: cache-trilinos - uses: actions/cache@v3 - with: - path: ${{runner.temp}}/trilinos - key: build-trilinos-${{ matrix.compiler }} - - - name: clone Trilinos - if: steps.cache-trilinos.outputs.cache-hit != 'true' - working-directory: ${{runner.temp }} - run: | - git clone --depth 1 https://github.com/trilinos/Trilinos.git trilinos - - - name: build and install Trilinos - if: steps.cache-trilinos.outputs.cache-hit != 'true' - working-directory: ${{runner.temp }}/trilinos - run: | - mkdir build - cd build - cmake .. \ - -DCMAKE_INSTALL_PREFIX=install \ - -DBUILD_SHARED_LIBS:BOOL=ON \ - -DTPL_ENABLE_MPI:BOOL=ON \ - -DCMAKE_CXX_COMPILER:FILEPATH=mpicxx \ - -DCMAKE_C_COMPILER:FILEPATH=mpicc \ - -DTrilinos_ENABLE_Fortran=OFF \ - -DTrilinos_ENABLE_ALL_PACKAGES:BOOL=OFF \ - -DTrilinos_ENABLE_ALL_OPTIONAL_PACKAGES:BOOL=OFF \ - -DTrilinos_ENABLE_SEACAS:BOOL=ON \ - -DTrilinos_ENABLE_SEACASExodus:BOOL=ON \ - -DTrilinos_ENABLE_Kokkos:BOOL=ON - cmake --build . -j 4 --target install - - - name: cache ADIOS2 - id: cache-adios2 - uses: actions/cache@v3 - with: - path: ${{runner.temp}}/adios2 - key: build-adios2-${{ matrix.compiler }} - - - name: clone ADIOS2 - if: steps.cache-adios2.outputs.cache-hit != 'true' - working-directory: ${{runner.temp }} - run: | - git clone --depth 1 https://github.com/ornladios/ADIOS2.git adios2 - - - name: build and install ADIOS2 - if: steps.cache-adios2.outputs.cache-hit != 'true' - working-directory: ${{runner.temp }}/adios2 - run: | - mkdir build - cd build - cmake .. \ - -DCMAKE_INSTALL_PREFIX=install \ - -DADIOS2_USE_CUDA=OFF \ - -DCMAKE_CXX_COMPILER=mpicxx \ - -DCMAKE_C_COMPILER=mpicc \ - -DCMAKE_BUILD_TYPE=Release \ - -DADIOS2_USE_ZFP=OFF - cmake --build . -j 4 --target install - - - name: Set environment variables for gmsh - run: | - echo "CMAKE_PREFIX_PATH=${{runner.temp}}/gmsh/build/install:$CMAKE_PREFIX_PATH" >> $GITHUB_ENV - echo "LD_LIBRARY_PATH=${{runner.temp}}/gmsh/build/install/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV - echo "CMAKE_LIBRARY_PATH=${{runner.temp}}/adios2/build/install/lib:$CMAKE_LIBRARY_PATH" >> $GITHUB_ENV - - - name: build and install omega_h - working-directory: omega_h - run: | - ls ${{runner.temp}}/adios2/build/install/lib/cmake/adios2 - ls ${{runner.temp}}/adios2/build/install - ls ${{runner.temp}}/adios2/build/install/include - mkdir build - cd build - cmake .. \ - -DCMAKE_BUILD_TYPE="Release" \ - -DCMAKE_C_COMPILER_LAUNCHER=ccache \ - -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ - -DCMAKE_INSTALL_PREFIX=install \ - -DOmega_h_USE_MPI=on \ - -DOmega_h_USE_Kokkos=on \ - -DKokkos_PREFIX=${{runner.temp}}/kokkos/build/install \ - -DBUILD_TESTING=off \ - -DBUILD_SHARED_LIBS=on \ - -DOmega_h_USE_ADIOS2=ON \ - -DADIOS2_DIR=${{runner.temp}}/adios2/build/install/lib/cmake/adios2 \ - -DOmega_h_USE_Gmsh=ON \ - -DGmsh_INCLUDE_DIRS=${{runner.temp}}/gmsh/build/install/include \ - -DGmsh_LIBRARIES=${{runner.temp}}/gmsh/build/install/lib/libgmsh.so \ - -DOmega_h_USE_libMeshb=on \ - -DlibMeshb_PREFIX=${{runner.temp}}/libmeshb/build/install \ - -DOmega_h_USE_OpenMP=OFF \ - -DCMAKE_CXX_EXTENSIONS=OFF - cmake --build . -j 8 --target install - - - name: Print ccache statistics - run: ccache -s - - - name: test omega_h install - working-directory: omega_h/example/external_installation - run: | - mkdir build - cd build - cmake .. \ - -DOmega_h_DIR=${{github.workspace}}/omega_h/build/install/lib/cmake/Omega_h - cmake --build . -j 8 - - \ No newline at end of file