Skip to content

Try NVHPC

Try NVHPC #210

Workflow file for this run

name: CI
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
container: ghcr.io/gridtools/gridtools-base:${{ matrix.compiler }}
strategy:
matrix:
compiler: [nvhpc-23.7]
build_type: [Debug, Release]
exclude:
- compiler: gcc-10
build_type: Debug
- compiler: gcc-11
build_type: Debug
- compiler: gcc-12
build_type: Debug
- compiler: clang-10
build_type: Debug
- compiler: clang-14
build_type: Debug
- compiler: clang-15
build_type: Debug
steps:
- uses: actions/checkout@v1
- name: Enable Fortran
if: startsWith(matrix.compiler, 'gcc') || startsWith(matrix.compiler, 'nvhpc')
run: echo "TEST_FORTRAN=ON" >> $GITHUB_ENV
- name: Install python modules
run: pip3 install --user nose-py3 numpy
- name: Cache pFUnit
id: cache-pfunit
uses: actions/cache@v3.2.4
with:
path: pfunit
key: ${{ matrix.compiler }}-pfunit
- name: Install pFUnit
if: (startsWith(matrix.compiler, 'gcc') || startsWith(matrix.compiler, 'nvhpc')) && steps.cache-pfunit.outputs.cache-hit != 'true'
env:
PFUNIT_VERSION: 4.7.3
run: |
apt-get update && apt-get -y install m4
git clone --branch v${PFUNIT_VERSION} --depth 1 https://github.com/Goddard-Fortran-Ecosystem/pFUnit.git
cd pFUnit
mkdir -p build && cd build
cmake .. -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/pfunit
make -j8 install
- name: Prepare ccache timestamp
id: ccache_cache_timestamp
shell: cmake -P {0}
run: |
string(TIMESTAMP current_date "%Y-%m-%d-%H-%M-%S" UTC)
message("echo \"timestamp=${current_date}\" >> $GITHUB_OUTPUT")
- name: Set ccache environment
run: |
echo "CCACHE_MAXSIZE=400M" >> $GITHUB_ENV
echo "CCACHE_BASEDIR=$GITHUB_WORKSPACE" >> $GITHUB_ENV
echo "CCACHE_DIR=$GITHUB_WORKSPACE/.ccache" >> $GITHUB_ENV
echo "CCACHE_COMPRESS=true" >> $GITHUB_ENV
echo "CCACHE_COMPRESSLEVEL=6" >> $GITHUB_ENV
- name: ccache cache files
uses: actions/cache@v3.2.4
with:
path: .ccache
key: ${{ matrix.compiler }}-${{ matrix.build_type }}-ccache-${{ steps.ccache_cache_timestamp.outputs.timestamp }}
restore-keys: |
${{ matrix.compiler }}-${{ matrix.build_type }}-ccache-
- name: Configure
run: |
ccache -s
mkdir build && cd build
cmake .. \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DPYTHON_EXECUTABLE=`which python3` \
-DSERIALBOX_TESTING=ON \
-DSERIALBOX_ENABLE_FORTRAN=${TEST_FORTRAN} \
-DSERIALBOX_TESTING_FORTRAN=${TEST_FORTRAN} \
-DSERIALBOX_TESTING_PYTHON=ON \
-DCMAKE_PREFIX_PATH=${GITHUB_WORKSPACE}/pfunit \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
- name: Build
run: cmake --build build --parallel 2
- name: Execute tests
run: cd build && ctest --output-on-failure