Skip to content

Remove local copy of FindESMF.cmake and rename esmf target to ESMF::ESMF #945

Remove local copy of FindESMF.cmake and rename esmf target to ESMF::ESMF

Remove local copy of FindESMF.cmake and rename esmf target to ESMF::ESMF #945

Workflow file for this run

# This is a workflow to compile the cdeps source without cime
name: extbuild
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the main branch
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build-cdeps:
runs-on: ubuntu-latest
env:
CC: mpicc
FC: mpifort
CXX: mpicxx
CPPFLAGS: "-I/usr/include -I/usr/local/include "
LDFLAGS: "-L/usr/lib/x86_64-linux-gnu "
# Versions of all dependencies can be updated here - these match tag names in the github repo
ESMF_VERSION: v8.6.1
ParallelIO_VERSION: pio2_6_2
steps:
- id: checkout-CDEPS
uses: actions/checkout@v4
with:
submodules: recursive
- id: load-env
run: |
sudo apt-get update
sudo apt-get install gfortran
sudo apt-get install wget
sudo apt-get install openmpi-bin libopenmpi-dev
sudo apt-get install netcdf-bin libnetcdf-dev libnetcdff-dev
sudo apt-get install pnetcdf-bin libpnetcdf-dev
sudo apt-get install autotools-dev autoconf
- name: Cache PARALLELIO
id: cache-PARALLELIO
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/pio
key: ${{ runner.os }}-${{ env.ParallelIO_VERSION }}-parallelio2
- name: Build ParallelIO
if: steps.cache-PARALLELIO.outputs.cache-hit != 'true'
uses: NCAR/ParallelIO/.github/actions/parallelio_cmake@9390e30e29d4ebbfbef0fc72162cacd9e8f25e4e
with:
parallelio_version: ${{ env.ParallelIO_VERSION }}
enable_fortran: True
install_prefix: ${{ github.workspace }}/pio
- name: Install ESMF
uses: esmf-org/install-esmf-action@v1
env:
ESMF_COMPILER: gfortran
ESMF_BOPT: g
ESMF_COMM: openmpi
ESMF_NETCDF: nc-config
ESMF_PNETCDF: pnetcdf-config
ESMF_INSTALL_PREFIX: ${{ github.workspace }}/ESMF
ESMF_PIO: external
ESMF_PIO_INCLUDE: ${{ github.workspace }}/pio/include
ESMF_PIO_LIBPATH: ${{ github.workspace }}/pio/lib
with:
version: ${{ env.ESMF_VERSION }}
esmpy: false
cache: true
# The build logic is moved directly into this step to avoid
# issues with variable scope and inheritance between actions.
- name: Build CDEPS
run: |
mkdir build-cdeps
pushd build-cdeps
# We need to explicitly point to the subdirectory where the
# ESMF and PIO CMake configuration files are located.
# The install actions put them in a subdirectory, not at the root.
cmake \
-D ESMF_DIR=${{ github.workspace }}/ESMF/lib/cmake/ESMF \
-D PIO_DIR=${{ github.workspace }}/pio/lib/cmake/pio \
-Wno-dev \
-DCMAKE_BUILD_TYPE=DEBUG \
-DWERROR=ON \
-DCMAKE_Fortran_FLAGS="-DCPRGNU -g -Wall -ffree-form -ffree-line-length-none -fallow-argument-mismatch" \
${{ github.workspace }}
make VERBOSE=1
popd
- name: Test CDEPS
run: |
cd build-cdeps
make VERBOSE=1