Skip to content

Add const correctness to Model_2 #739

Add const correctness to Model_2

Add const correctness to Model_2 #739

Workflow file for this run

name: OpenTurbine-CI
on: push
env:
CMAKE_BUILD_PARALLEL_LEVEL: 4
CTEST_PARALLEL_LEVEL: 2
jobs:
Correctness:
runs-on: ${{matrix.os}}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-13]
compiler: [gcc-10, llvm]
build_type: [Release, Debug]
exclude:
- os: macos-13
compiler: gcc-10
include:
- os: ubuntu-latest
install_deps: sudo apt-get install gfortran libgtest-dev libblas-dev liblapack-dev liblapacke-dev
- os: macos-13
install_deps: brew install gfortran gcc googletest openblas lapack
steps:
- name: Setup Cpp
uses: aminya/[email protected]
with:
compiler: ${{ matrix.compiler }}
cmake: true
ninja: true
clangtidy: ${{matrix.os != 'macos-latest' }}
cppcheck: ${{matrix.os != 'macos-latest' }}
ccache: ${{matrix.os != 'macos-latest' }}
- name: Install dependencies
run: |
${{matrix.install_deps}}
- name: Cache install Kokkos
id: cache-kokkos
uses: actions/cache@v3
with:
path: ~/dependencies/kokkos
key: ${{runner.os}}-kokkos
- name: Install Kokkos
if: steps.cache-kokkos.outputs.cache-hit != 'true'
run: |
sudo mkdir -p ~/dependencies/kokkos
git clone --depth 1 --branch develop https://github.com/kokkos/kokkos
cd kokkos
mkdir build
cd build
cmake .. \
-DCMAKE_INSTALL_PREFIX:PATH=~/dependencies/kokkos \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DKokkos_ENABLE_DEBUG=${{ matrix.build_type == 'Debug' }} \
-DKokkos_ENABLE_DEBUG_BOUNDS_CHECK=${{ matrix.build_type == 'Debug' }}
sudo cmake --build . --target install
- name: Cache install Kokkos-Kernels
id: cache-kokkos-kernels
uses: actions/cache@v3
with:
path: ~/dependencies/kokkos_kernels
key: ${{runner.os}}-kokkos-kernels
- name: Install Kokkos-Kernels
if: steps.cache-kokkos-kernels.outputs.cache-hit != 'true'
run: |
sudo mkdir -p ~/dependencies/kokkos_kernels
export Kokkos_DIR=~/dependencies/kokkos
if [ ${{matrix.os}} = 'ubuntu-latest' ]; then
git clone --depth 1 --branch develop https://github.com/kokkos/kokkos-kernels
fi
if [ ${{matrix.os}} = 'macos-13' ]; then
export FC=gfortran-13
git clone --depth 1 --branch develop https://github.com/kokkos/kokkos-kernels
fi
cd kokkos-kernels
mkdir build
cd build
cmake ../ \
-DCMAKE_INSTALL_PREFIX:PATH=~/dependencies/kokkos_kernels \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DKokkosKernels_ENABLE_TPL_BLAS=ON \
-DKokkosKernels_ENABLE_TPL_LAPACK=ON
sudo cmake --build . --target install
- name: Clone
uses: actions/checkout@v4
with:
submodules: true
- name: Test OpenTurbine
run: |
export KokkosKernels_DIR=~/dependencies/kokkos_kernels
mkdir build
cd build
cmake .. \
-DOTURB_ENABLE_TESTS:BOOL=ON \
-DOTURB_ENABLE_BASIC_SANITIZERS=ON \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
cmake --build .
ctest -C ${{ matrix.build_type }} --output-on-failure
- name: Run CppCheck
if: matrix.os == 'ubuntu-latest' && matrix.compiler == 'llvm'
run: |
mkdir build-cppcheck
cd build-cppcheck
cmake .. \
-DOTURB_ENABLE_TESTS:BOOL=ON \
-DOTURB_ENABLE_BASIC_SANITIZERS=ON \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DKokkosKernels_DIR=/home/runner/dependencies/kokkos_kernels/lib/cmake/KokkosKernels/ \
-DCMAKE_CXX_CPPCHECK="cppcheck;--enable=all;--error-exitcode=0;--suppress=missingInclude;--library=googletest"
cmake --build . -j 1
- name: Run Clang-Tidy
if: matrix.os == 'ubuntu-latest' && matrix.compiler == 'llvm'
run: |
export KokkosKernels_DIR=~/dependencies/kokkos_kernels
mkdir build-clangtidy
cd build-clangtidy
cmake .. \
-DOTURB_ENABLE_TESTS:BOOL=ON \
-DOTURB_ENABLE_BASIC_SANITIZERS=ON \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DCMAKE_CXX_CLANG_TIDY="clang-tidy"
cmake --build . -j 1
Formatting:
runs-on: ubuntu-latest
steps:
- name: Clone
uses: actions/checkout@v4
- name: Check formatting
uses: DoozyX/[email protected]
with:
source: './src ./tests/unit_tests'
exclude: '.'
extensions: 'H,h,cpp'
clangFormatVersion: 16