Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update CI to Ubuntu 22.04, gfortran 10, 11, 12 #1

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 10 additions & 43 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,80 +3,47 @@ on: [push, pull_request]

jobs:
CI:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
defaults:
run:
shell: bash -l {0}
strategy:
matrix:
fortran-compiler: [gfortran-9, gfortran-10]
gnu-compiler-version: [10, 11, 12]
env:
FC: ${{ matrix.fortran-compiler }}
FC: gfortran-${{ matrix.gnu-compiler-version }}
CC: gcc-${{ matrix.gnu-compiler-version }}
FCFLAGS: "-ffree-line-length-none -m64 -std=f2008 -march=native -fbounds-check -finit-real=nan -g -DRTE_USE_CBOOL"
CC: gcc
NCHOME: /home/runner/netcdf-c
NFHOME: /home/runner/netcdf-fortran
RFMIP_DIR: /home/runner/rfmip-files
steps:
- name: Update system packages
run: sudo apt-get update
############################################################################
#
# Compilers....
#
# Gfortran 10 not available in Github CI stack, so install
#
- name: gfortran-10 setup compiler
if: contains(matrix.fortran-compiler, 'gfortran-10')
run: |
sudo apt-get install gfortran-10 gcc-10
echo "CC=gcc-10" >> $GITHUB_ENV
# #
- name: install compilers
run: sudo apt-get install gfortran-${{ matrix.gnu-compiler-version }} gcc-${{ matrix.gnu-compiler-version }}

############################################################################
#
# Netcdf C and Fortran
#
- name: Install HDF5 library
run: |
sudo apt-get install libhdf5-dev libcurl4-gnutls-dev hdf5-helpers
dpkg -L libhdf5-dev

# Skipping this for now - netCDF configure doesn't see the HDF libararies
- name: cache-netcdf-c
id: cache-netcdf-c
uses: actions/cache@v3
with:
path: /home/runner/netcdf-c
key: netcdf-c-4.7.4a-${{ runner.os }}-${{ matrix.fortran-compiler }}

- name: Install netcdf C library from source
if: steps.cache-netcdf-c.outputs.cache-hit != 'true'
env:
CPPFLAGS: -I/usr/include/hdf5/serial
LDFLAGS: -L/usr/lib/x86_64-linux-gnu/hdf5/serial/
run: |
${CC} --version
git clone https://github.com/Unidata/netcdf-c.git --branch v4.7.4
cd netcdf-c
ls /usr/include
./configure --prefix=${NCHOME}
make -j
sudo make install
sudo apt-get install libhdf5-dev libcurl4-gnutls-dev hdf5-helpers libnetcdf-dev
dpkg -L libhdf5-dev libnetcdf-dev

# Would be great to encode version info
- name: cache-netcdf-fortran
id: cache-netcdf-fortran
uses: actions/cache@v3
with:
path: /home/runner/netcdf-fortran
key: netcdf-fortran-4.5.3-${{ runner.os }}-${{ matrix.fortran-compiler }}
key: netcdf-fortran-4.5.3-${{ runner.os }}-${{ matrix.fortran-compiler }}-1

- name: Build NetCDF Fortran library
# Here too it would be nice to use the environment to specify netcdf-c location
env:
CPPFLAGS: -I/home/runner/netcdf-c/include
LDFLAGS: -L/home/runner/netcdf-c/lib
LD_LIBRARY_PATH: /home/runner/netcdf-c/lib
FCFLAGS: -fPIC
if: steps.cache-netcdf-fortran.outputs.cache-hit != 'true'
run: |
Expand Down