Experimenting with building using Spack or APT packages #12
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: [develop] | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
build-with-spack-packages: | |
name: Build (Spack) | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Check out | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Set up Spack | |
uses: spack/setup-spack@v2 | |
with: | |
ref: releases/v0.21 | |
buildcache: true | |
color: true | |
path: spack | |
- name: Find compilers | |
run: spack compiler find --mixed-toolchain | |
- name: Install dependencies | |
run: spack install --no-check-signature [email protected]%gcc@13 | |
- name: Configure | |
run: | | |
spack load [email protected]%gcc@13 | |
spack load --list | |
cmake -S . -B build | |
- name: Build | |
run: cmake --build build | |
build-with-apt-packages: | |
name: Build (APT) | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Check out | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Install dependencies | |
run: sudo apt-get install -y libnetcdf-dev libnetcdff-dev | |
liblapack-dev libopenblas-dev mpi-default-dev mpi-default-bin | |
- name: Build ESMF | |
run: | | |
v="8.3.1" # ESMF | |
gcc="12" | |
esmf_base=$HOME/esmf | |
export ESMF_DIR=${esmf_base}/${v}-gcc-${gcc} | |
mkdir -p $ESMF_DIR | |
cd $esmf_base | |
wget https://github.com/esmf-org/esmf/archive/refs/tags/v${v}.tar.gz | |
tar xzvf v${v}.tar.gz --directory=/tmp && mv /tmp/esmf-${v}/* $ESMF_DIR | |
export ESMF_COMPILER=gfortran | |
export ESMF_LAPACK=netlib | |
export ESMF_COMM=mpi | |
export ESMF_PIO=internal | |
export ESMF_NETCDF=nc-config | |
export OMPI_FC=gfortran-${gcc} | |
export OMPI_CC=gcc-${gcc} | |
export OMPI_CXX=g++-${gcc} | |
export ESMF_F90COMPILER=mpifort | |
export ESMF_CCOMPILER=mpicc | |
export ESMF_CXXCOMPILER=mpic++ | |
export ESMF_F90LINKER=/usr/bin/ld | |
export ESMF_CLINKER=/usr/bin/ld | |
export ESMF_CXXLINKER=/usr/bin/ld | |
cd $ESMF_DIR | |
make -j lib | |
echo "ESMFMKFILE=${ESMF_DIR}/lib/libO/Linux.gfortran.64.mpi.default/esmf.mk" >> "$GITHUB_ENV" | |
- name: Configure | |
run: cmake -S . -B build | |
- name: Build | |
run: cmake --build build | |
build-with-apt-packages-nompi: | |
name: Build (APT, no MPI) | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Check out | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Install dependencies | |
run: sudo apt-get install -y libnetcdf-dev libnetcdff-dev | |
liblapack-dev libopenblas-dev | |
- name: Build ESMF | |
run: | | |
v="8.3.1" # ESMF | |
gcc="12" | |
esmf_base=$HOME/esmf | |
export ESMF_DIR=${esmf_base}/${v}-gcc-${gcc} | |
mkdir -p $ESMF_DIR | |
cd $esmf_base | |
wget https://github.com/esmf-org/esmf/archive/refs/tags/v${v}.tar.gz | |
tar xzvf v${v}.tar.gz --directory=/tmp && mv /tmp/esmf-${v}/* $ESMF_DIR | |
export ESMF_COMPILER=gfortran | |
export ESMF_LAPACK=netlib | |
export ESMF_COMM=mpiuni | |
export ESMF_NETCDF=nc-config | |
export ESMF_F90COMPILER=gfortran-${gcc} | |
export ESMF_CCOMPILER=gcc-${gcc} | |
export ESMF_CXXCOMPILER=g++-${gcc} | |
export ESMF_F90LINKER=/usr/bin/ld | |
export ESMF_CLINKER=/usr/bin/ld | |
export ESMF_CXXLINKER=/usr/bin/ld | |
cd $ESMF_DIR | |
make -j lib | |
echo "ESMFMKFILE=${ESMF_DIR}/lib/libO/Linux.gfortran.64.mpiuni.default/esmf.mk" >> "$GITHUB_ENV" | |
- name: Configure | |
run: cmake -S . -B build | |
- name: Build | |
run: cmake --build build |