-
Notifications
You must be signed in to change notification settings - Fork 3
180 lines (157 loc) · 5.88 KB
/
CI.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
name: TSMP2 Build
# Controls when the action will run.
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
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
CXX: mpicxx
FC: mpifort
F77: mpif77
BUILD_DIR: bld
INSTALL_DIR: install
MODEL_DIR: ${{ github.workspace }}/component-models
OASIS_TAG: tsmp-patches-v0.1
eCLM_TAG: beta-0.1
PARFLOW_TAG: oasis3-ubuntu22.04 #v3.13.0
HYPRE_TAG: 2.26.0
CMAKE_PREFIX_PATH: ${{ github.workspace }}/dependencies
SYSTEMNAME: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Install TSMP2 dependencies on Ubuntu
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: libxml2-utils pylint wget cmake 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: Introspect netcdf-mpi
run: |
NETCDF_P_PREFIX=$(pkg-config --variable=prefix netcdf-mpi)
echo "NETCDF_P_PREFIX=${NETCDF_P_PREFIX}" && ls ${NETCDF_P_PREFIX}/include
NETCDF_PREFIX=$(pkg-config --variable=prefix netcdf)
echo "NETCDF_PREFIX=${NETCDF_PREFIX}" && ls ${NETCDF_PREFIX}/include
#
# OASIS3-MCT
#
- name: Restore cached OASIS3-MCT ${{ env.OASIS_TAG }}
uses: actions/cache/restore@v4
id: cache-oasis-restore
with:
path: ${{ env.MODEL_DIR }}/oasis3-mct
key: cache-${{ matrix.config.name }}-${{ env.OASIS_TAG }}
- if: steps.cache-oasis-restore.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)"
- if: steps.cache-oasis-restore.outputs.cache-hit != 'true'
name: Cache OASIS3-MCT ${{ env.OASIS_TAG }}
uses: actions/cache/save@v4
with:
path: ${{ env.MODEL_DIR }}/oasis3-mct
key: cache-${{ matrix.config.name }}-${{ env.OASIS_TAG }}
#
# eCLM
#
- name: Restore cached eCLM ${{ env.eCLM_TAG }}
uses: actions/cache/restore@v4
id: cache-eclm-restore
with:
path: ${{ env.MODEL_DIR }}/eCLM
key: cache-${{ matrix.config.name }}-${{ env.eCLM_TAG }}
- if: steps.cache-eclm-restore.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)"
- if: steps.cache-eclm-restore.outputs.cache-hit != 'true'
name: Cache eCLM ${{ env.eCLM_TAG }}
uses: actions/cache/save@v4
with:
path: ${{ env.MODEL_DIR }}/eCLM
key: cache-${{ matrix.config.name }}-${{ env.eCLM_TAG }}
#
# ParFlow
#
- name: Restore cached ParFlow ${{ env.PARFLOW_TAG }}
uses: actions/cache/restore@v4
id: cache-parflow-restore
with:
path: ${{ env.MODEL_DIR }}/parflow
key: cache-${{ matrix.config.name }}-${{ env.PARFLOW_TAG }}
# TODO: Must use upstream repo https://github.com/parflow/parflow.git
- if: steps.cache-parflow-restore.outputs.cache-hit != 'true'
name: Download ParFlow ${{ env.PARFLOW_TAG }}
working-directory: ${{ env.MODEL_DIR }}
run: |
git clone -b $PARFLOW_TAG https://github.com/kvrigor/parflow.git
echo "ParFlow version: $(cd parflow && git describe --tags --always)"
- if: steps.cache-parflow-restore.outputs.cache-hit != 'true'
name: Cache ParFlow ${{ env.PARFLOW_TAG }}
uses: actions/cache/save@v4
with:
path: ${{ env.MODEL_DIR }}/parflow
key: cache-${{ matrix.config.name }}-${{ env.PARFLOW_TAG }}
#
# Hypre
#
- name: Restore cached Hypre ${{ env.HYPRE_TAG }}
uses: actions/cache/restore@v4
id: cache-hypre-restore
with:
path: ${{ env.CMAKE_PREFIX_PATH }}
key: cache-${{ matrix.config.name }}-${{ env.HYPRE_TAG }}
- if: steps.cache-hypre-restore.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 -j4 install
- if: steps.cache-hypre-restore.outputs.cache-hit != 'true'
name: Cache Hypre ${{ env.HYPRE_TAG }}
uses: actions/cache/save@v4
with:
path: ${{ env.CMAKE_PREFIX_PATH }}
key: cache-${{ matrix.config.name }}-${{ env.HYPRE_TAG }}
#
# TSMP2
#
- 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}