move containers to new registry and add basic link+run test for cmake #21
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build libFMS with cmake | |
on: [push, pull_request] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
omp-flags: [ -DOPENMP=on, -DOPENMP=off ] | |
libyaml-flag: [ "", -DWITH_YAML=on ] | |
io-flag: [ "", -DUSE_DEPRECATED_IO=on ] | |
container: | |
image: ghcr.io/noaa-gfdl/fms/fms-ci-rocky-gnu:12.3.0 | |
credentials: | |
username: ${{ github.actor }} | |
password: ${{ secrets.github_token }} | |
env: | |
CMAKE_FLAGS: "${{ matrix.omp-flags }} ${{ matrix.io-flag }} ${{ matrix.libyaml-flag }} -D64BIT=on" | |
LIBYAML_ROOT: "/opt/deps/linux-rocky9-haswell/gcc-12.3.0/libyaml-0.2.5-yiouvafr3qwcdrwdpumepit4wmqvh642/" # TODO should find better way for cmake to find this | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Generate makefiles with CMake | |
run: cmake -DNetCDF_INCLUDE_DIR=/opt/view/include/ -DCMAKE_Fortran_FLAGS="-fallow-argument-mismatch" $CMAKE_FLAGS . | |
- name: Build the library | |
run: make | |
- name: Link with basic executable | |
run: | | |
echo "program test" > test.F90 | |
echo " use fms_mod" >> test.F90 | |
echo " call fms_init" >> test.F90 | |
echo " call fms_end" >> test.F90 | |
echo "end program" >> test.F90 | |
mpifort `nf-config --flibs` -Iinclude_r4 -Iinclude_r8 test.F90 libfms_r4.a libfms_r8.a -o test.x | |
- name: Run executable | |
run: ./test.x |