Set absolute path to Hypre install dir #24
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: TSMP2 Build | |
# Controls when the action will run. | |
on: [push, pull_request] | |
jobs: | |
eclm_build_job: | |
name: ${{ matrix.config.name }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ ubuntu-22.04 ] | |
config: | |
- { | |
name: "eCLM-ParFlow", | |
} | |
env: | |
CC: mpicc | |
FC: mpifort | |
BUILD_DIR: bld | |
INSTALL_DIR: install | |
MODEL_DIR: component-models | |
OASIS_TAG: tsmp-patches-v0.1 | |
eCLM_TAG: beta-0.1 | |
PARFLOW_TAG: v3.13.0 | |
HYPRE_TAG: 2.26.0 | |
CMAKE_BUILD_PARALLEL_LEVEL: 4 | |
CMAKE_PREFIX_PATH: dependencies | |
SYSTEMNAME: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: awalsh128/cache-apt-pkgs-action@latest | |
with: | |
packages: libxml2-utils pylint wget cmake netcdf-bin libnetcdf-mpi-dev libnetcdff-dev libpnetcdf-dev tcl-dev tk-dev | |
version: 1.0 | |
execute_install_scripts: true | |
- name: Download MPI Fortran compiler | |
run: sudo apt-get install gfortran openmpi-bin libopenmpi-dev | |
- name: Create directories for component model and dependencies | |
run: | | |
mkdir -p ${CMAKE_PREFIX_PATH} ${MODEL_DIR} | |
- name: Restore cached OASIS3-MCT ${{ env.OASIS_TAG }} | |
uses: actions/cache@v4 | |
id: cache-oasis | |
env: | |
cache-name: cache-oasis | |
with: | |
path: ${{ env.MODEL_DIR }}/oasis3-mct | |
key: cache-${{ matrix.config.name }}-${{ env.OASIS_TAG }} | |
- if: steps.cache-oasis.outputs.cache-hit != 'true' | |
name: Download OASIS3-MCT ${{ env.OASIS_TAG }} | |
working-directory: ${{ env.MODEL_DIR }} | |
run: | | |
git clone -b $OASIS_TAG https://icg4geo.icg.kfa-juelich.de/ExternalReposPublic/oasis3-mct.git | |
echo "OASIS3-MCT version: $(cd oasis3-mct && git describe --tags --always)" | |
- name: Restore cached eCLM ${{ env.eCLM_TAG }} | |
uses: actions/cache@v4 | |
id: cache-eclm | |
env: | |
cache-name: cache-eclm | |
with: | |
path: ${{ env.MODEL_DIR }}/eCLM | |
key: cache-${{ matrix.config.name }} | |
- if: steps.cache-eclm.outputs.cache-hit != 'true' | |
name: Download eCLM ${{ env.eCLM_TAG }} | |
working-directory: ${{ env.MODEL_DIR }} | |
run: | | |
git clone -b $eCLM_TAG https://github.com/HPSCTerrSys/eCLM.git | |
echo "eCLM version: $(cd eCLM && git describe --tags --always)" | |
- name: Restore cached ParFlow ${{ env.PARFLOW_TAG }} | |
uses: actions/cache@v4 | |
id: cache-parflow | |
env: | |
cache-name: cache-parflow | |
with: | |
path: ${{ env.MODEL_DIR }}/parflow | |
key: cache-${{ matrix.config.name }}-${{ env.PARFLOW_TAG }} | |
- if: steps.cache-parflow.outputs.cache-hit != 'true' | |
name: Download ParFlow ${{ env.PARFLOW_TAG }} | |
working-directory: ${{ env.MODEL_DIR }} | |
run: | | |
git clone -b $PARFLOW_TAG https://github.com/parflow/parflow.git | |
echo "ParFlow version: $(cd parflow && git describe --tags --always)" | |
- name: Restore cached Hypre ${{ env.HYPRE_TAG }} | |
uses: actions/cache@v4 | |
id: cache-hypre | |
env: | |
cache-name: cache-hypre | |
with: | |
path: ${{ env.CMAKE_PREFIX_PATH }} | |
key: cache-${{ matrix.config.name }}-${{ env.HYPRE_TAG }} | |
- if: steps.cache-hypre.outputs.cache-hit != 'true' | |
name: Install Hypre ${{ env.HYPRE_TAG }} | |
run: | | |
wget https://github.com/hypre-space/hypre/archive/v${HYPRE_TAG}.tar.gz | |
tar xf v${HYPRE_TAG}.tar.gz | |
cd hypre-${HYPRE_TAG}/src | |
./configure --prefix=$(realpath $CMAKE_PREFIX_PATH) | |
make -j${CMAKE_BUILD_PARALLEL_LEVEL} install | |
- name: Configure TSMP2 | |
run: >- | |
cmake -S . -B ${BUILD_DIR} | |
-DCMAKE_BUILD_TYPE="RELEASE" | |
-DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} | |
-DOASIS_SRC=${MODEL_DIR}/oasis3-mct | |
-DeCLM="ON" | |
-DeCLM_SRC=${MODEL_DIR}/eCLM | |
-DParFlow="ON" | |
-DPARFLOW_SRC=${MODEL_DIR}/parflow | |
- name: Build TSMP2 | |
run: | | |
cmake --build ${BUILD_DIR} | |
- name: Install TSMP2 | |
run: | | |
cmake --install ${BUILD_DIR} |