From d6e6ef40d6406b7af2488a032f88719190f3c8cf Mon Sep 17 00:00:00 2001 From: Matthew McCall Date: Tue, 7 Nov 2023 14:01:01 -0500 Subject: [PATCH] Add support for building with kokkos in actions --- .github/workflows/cmake.yml | 37 ++++++++++++++++++++++++++++++------- 1 file changed, 30 insertions(+), 7 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 4c3649e50..37ac90049 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -11,29 +11,52 @@ jobs: strategy: matrix: compiler: [g++, clang++] + kokkos: [on, off] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 + with: + path: omega_h - - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + - uses: actions/checkout@v4 + if: ${{ matrix.kokkos == 'on' }} + with: + repository: kokkos/kokkos + path: kokkos + + - name: Configure Kokkos + if: ${{ matrix.kokkos == 'on' }} + shell: bash + working-directory: ${{runner.workspace}}/omega_h/kokkos + run: cmake . + -Bbuild + -DCMAKE_CXX_COMPILER=${{ matrix.compiler }} + -DCMAKE_INSTALL_PREFIX=build/install + + - name: Build Kokkos + if: ${{ matrix.kokkos == 'on' }} + shell: bash + run: cmake --build $GITHUB_WORKSPACE/kokkos/build --target install - name: Configure CMake shell: bash - working-directory: ${{runner.workspace}}/build - run: cmake $GITHUB_WORKSPACE + working-directory: ${{runner.workspace}}/omega_h/omega_h + run: cmake . + -Bbuild -DCMAKE_CXX_COMPILER=${{ matrix.compiler }} -DCMAKE_VERBOSE_MAKEFILE=on -DOmega_h_USE_MPI=off -DOmega_h_USE_CUDA=off + -DOmega_h_USE_Kokkos=${{ matrix.kokkos }} + -DKokkos_PREFIX=$GITHUB_WORKSPACE/kokkos/build/install -DBUILD_TESTING=ON - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{runner.workspace}}/omega_h/omega_h/build shell: bash run: cmake --build . - name: Test - working-directory: ${{runner.workspace}}/build + working-directory: ${{runner.workspace}}/omega_h/omega_h/build shell: bash run: ctest