Skip to content

Add Support for Building with Kokkos in Actions #170

Add Support for Building with Kokkos in Actions

Add Support for Building with Kokkos in Actions #170

Workflow file for this run

name: CMake test matrix
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
runs-on: ubuntu-22.04
strategy:
matrix:
compiler: [g++, clang++]
kokkos: [on, off]
steps:
- uses: actions/checkout@v4
with:
path: omega_h
- 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: $GITHUB_WORKSPACE/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: $GITHUB_WORKSPACE/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}}/omega_h/build
shell: bash
run: cmake --build .
- name: Test
working-directory: ${{runner.workspace}}/omega_h/build
shell: bash
run: ctest