Skip to content

workaround?

workaround? #19

name: Continuous Integration
on: [push, pull_request]
jobs:
CI:
runs-on: ubuntu-20.04
defaults:
run:
shell: bash -l {0}
strategy:
matrix:
fortran-compiler: [gfortran-9, gfortran-10]
env:
FC: ${{ matrix.fortran-compiler }}
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
############################################################################
#
# 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
# 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 }}
- 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: |
echo ${TEST}
${FC} --version
git clone https://github.com/Unidata/netcdf-fortran.git --branch v4.5.3
cd netcdf-fortran
echo ${CPPFLAGS}
./configure --prefix=${NFHOME}
make -j
sudo make install
############################################################################
# Checks out repository under $GITHUB_WORKSPACE
- name: Check out host repo
uses: actions/checkout@v3
with:
path: rte-ecckd
- name: Check out RTE repo
uses: actions/checkout@v3
with:
repository: earth-system-radiation/rte-rrtmgp
path: rte-rrtmgp
- name: Environmental variables
run: echo "RRTMGP_ROOT=${GITHUB_WORKSPACE}/rte-rrtmgp" >> $GITHUB_ENV
- name: Make RTE library
run: |
ls
${FC} --version
cd ${RRTMGP_ROOT}
make libs
- name: Make RTE-ECCKD
env:
FCFLAGS: "-ffree-line-length-none -m64 -std=f2008 -march=native -fbounds-check -finit-real=nan -g -DRTE_USE_CBOOL -I/${RRTMGP_ROOT}/build"
run: |
cd rte-ecckd
make