forked from NOAA-GFDL/FMS
-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (39 loc) · 1.37 KB
/
github_cmake_gnu.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
name: Build libFMS with cmake
on: [push, pull_request]
# cancel running jobs if theres a newer push
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
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"
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Generate makefiles with CMake
run: cmake $CMAKE_FLAGS -DNetCDF_ROOT=/opt/view -DLIBYAML_ROOT=/opt/view
- 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 -L/opt/view/lib -fopenmp `nf-config --flibs` -Iinclude_r4 -Iinclude_r8 test.F90 libfms_r4.a libfms_r8.a -o test.x
touch input.nml
- name: Run executable
run: ./test.x