fix: improve modern diag manager performance (#1634)
[FMS.git] / .github / workflows / github_cmake_gnu.yml
blob8512d5fa8a51ea1c50be98c4b42973f8930862c9
1 name: Build libFMS with cmake
3 on: [push, pull_request]
5 # cancel running jobs if theres a newer push
6 concurrency:
7   group: ${{ github.workflow }}-${{ github.ref }}
8   cancel-in-progress: true
10 jobs:
11   build:
12     runs-on: ubuntu-latest
13     strategy:
14       matrix:
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" ]
19     container:
20       image: ghcr.io/noaa-gfdl/fms/fms-ci-rocky-gnu:13.2.0
21       env:
22         CMAKE_FLAGS: "${{ matrix.build-type }} ${{ matrix.omp-flags }} ${{ matrix.io-flag  }} ${{ matrix.libyaml-flag }} -D64BIT=on"
23     steps:
24     - name: Checkout code
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
29       run: make
30     - name: Link with basic executable
31       run: |
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
38         touch input.nml
39     - name: Run executable
40       run: ./test.x