1 name: Build libFMS with cmake
3 on: [push, pull_request]
5 # cancel running jobs if theres a newer push
7 group: ${{ github.workflow }}-${{ github.ref }}
8 cancel-in-progress: true
12 runs-on: ubuntu-latest
15 omp-flags: [ -DOPENMP=on, -DOPENMP=off ]
16 libyaml-flag: [ "", -DWITH_YAML=on ]
17 io-flag: [ "", -DUSE_DEPRECATED_IO=on ]
18 build-type: [ "-DCMAKE_BUILD_TYPE=Release", "-DCMAKE_BUILD_TYPE=Debug" ]
20 image: ghcr.io/noaa-gfdl/fms/fms-ci-rocky-gnu:13.2.0
22 CMAKE_FLAGS: "${{ matrix.build-type }} ${{ matrix.omp-flags }} ${{ matrix.io-flag }} ${{ matrix.libyaml-flag }} -D64BIT=on"
25 uses: actions/checkout@v4
26 - name: Generate makefiles with CMake
27 run: cmake $CMAKE_FLAGS -DNetCDF_ROOT=/opt/view -DLIBYAML_ROOT=/opt/view
28 - name: Build the library
30 - name: Link with basic executable
32 echo "program test" > test.F90
33 echo " use fms_mod" >> test.F90
34 echo " call fms_init" >> test.F90
35 echo " call fms_end" >> test.F90
36 echo "end program" >> test.F90
37 mpifort -L/opt/view/lib -fopenmp `nf-config --flibs` -Iinclude_r4 -Iinclude_r8 test.F90 libfms_r4.a libfms_r8.a -o test.x
39 - name: Run executable