Skip to content

fix case and libyaml for cmake #18

fix case and libyaml for cmake

fix case and libyaml for cmake #18

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 "program end" >> 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