Skip to content

Commit 6e0be8d

Browse files
committed
Github action: add CI for HDF5+MPICH only
1 parent 57d74e8 commit 6e0be8d

File tree

1 file changed

+155
-0
lines changed

1 file changed

+155
-0
lines changed

.github/workflows/hdf5_mpich.yml

Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
name: HDF5 and MPICH
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
paths-ignore:
7+
- '**/*.md'
8+
- '**/*.txt'
9+
- '**/*.jpg'
10+
- '**/*.png'
11+
- 'tests/*'
12+
pull_request:
13+
branches: [ master ]
14+
paths-ignore:
15+
- '**/*.md'
16+
- '**/*.txt'
17+
- '**/*.jpg'
18+
- '**/*.png'
19+
- 'tests/*'
20+
21+
env:
22+
MPICH_VERSION: 4.3.0
23+
HDF5_VERSION: 1.14.6
24+
25+
jobs:
26+
build:
27+
runs-on: ubuntu-latest
28+
timeout-minutes: 60
29+
steps:
30+
- uses: actions/checkout@v4
31+
- name: Set up dependencies
32+
run: |
33+
set -x
34+
sudo apt-get update
35+
sudo apt-get -y install automake autoconf libtool libtool-bin m4 cmake
36+
# The MPICH installed on github actions is too slow
37+
# sudo apt-get install mpich
38+
# mpicc -v
39+
# zlib
40+
sudo apt-get -y install zlib1g-dev
41+
- name: Add global env variables into GITHUB_ENV
42+
run: |
43+
set -x
44+
echo "MPICH_DIR=${GITHUB_WORKSPACE}/MPICH" >> $GITHUB_ENV
45+
echo "HDF5_ROOT=${GITHUB_WORKSPACE}/HDF5" >> $GITHUB_ENV
46+
- name: Build MPICH ${{ env.MPICH_VERSION }}
47+
if: ${{ success() }}
48+
run: |
49+
set -x
50+
cd ${GITHUB_WORKSPACE}
51+
rm -rf ${MPICH_DIR} ; mkdir ${MPICH_DIR} ; cd ${MPICH_DIR}
52+
curl -LO https://www.mpich.org/static/downloads/${MPICH_VERSION}/mpich-${MPICH_VERSION}.tar.gz
53+
gzip -dc mpich-${MPICH_VERSION}.tar.gz | tar -xf -
54+
cd mpich-${MPICH_VERSION}
55+
./configure --prefix=${MPICH_DIR} \
56+
--silent \
57+
--enable-romio \
58+
--with-file-system=ufs \
59+
--with-device=ch3:sock \
60+
--disable-fortran \
61+
CC=gcc
62+
make -s LIBTOOLFLAGS=--silent V=1 -j 8 install > qout 2>&1
63+
make -s -j 8 distclean >> qout 2>&1
64+
- name: Dump MPICH log file
65+
if: ${{ failure() }}
66+
run: |
67+
set -x
68+
cat ${MPICH_DIR}/mpich-${MPICH_VERSION}/qout
69+
cat ${MPICH_DIR}/mpich-${MPICH_VERSION}/config.log
70+
- name: Install HDF5 ${{ env.HDF5_VERSION }}
71+
if: ${{ success() }}
72+
run: |
73+
set -x
74+
cd ${GITHUB_WORKSPACE}
75+
rm -rf ${HDF5_ROOT} ; mkdir ${HDF5_ROOT} ; cd ${HDF5_ROOT}
76+
VER_MAJOR=${HDF5_VERSION%.*}
77+
VER_MAJOR=${VER_MAJOR/./_} # replace . with _
78+
VER_NOPATCH=${HDF5_VERSION%-*} # remove patch version
79+
VER_NOPATCH=${VER_NOPATCH//./_}
80+
# curl -LO https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-${VER_MAJOR}/hdf5-${VER_NOPATCH}/src/hdf5-${HDF5_VERSION}.tar.gz
81+
curl -LO https://support.hdfgroup.org/releases/hdf5/v${VER_MAJOR}/v${VER_NOPATCH}/downloads/hdf5-${HDF5_VERSION}.tar.gz
82+
tar -zxf hdf5-${HDF5_VERSION}.tar.gz
83+
cd hdf5-${HDF5_VERSION}
84+
./configure --prefix=${HDF5_ROOT} \
85+
--silent \
86+
--enable-parallel \
87+
--enable-build-mode=production \
88+
--enable-unsupported \
89+
--enable-threadsafe \
90+
--disable-doxygen-doc \
91+
--disable-doxygen-man \
92+
--disable-doxygen-html \
93+
--disable-tests \
94+
--disable-fortran \
95+
--disable-cxx \
96+
CC=${MPICH_DIR}/bin/mpicc
97+
make -s LIBTOOLFLAGS=--silent V=1 -j 8 install > qout 2>&1
98+
make -s -j 8 distclean >> qout 2>&1
99+
- name: Dump config.log file if build HDF5 failed
100+
if: ${{ failure() }}
101+
run: |
102+
set -x
103+
cd ${GITHUB_WORKSPACE}
104+
cat ${HDF5_ROOT}/hdf5-${HDF5_VERSION}/qout
105+
cat ${HDF5_ROOT}/hdf5-${HDF5_VERSION}/config.log
106+
- name: Build E3SM_IO with HDF5
107+
if: ${{ success() }}
108+
run: |
109+
set -x
110+
cd ${GITHUB_WORKSPACE}
111+
rm -rf ./test_output
112+
autoreconf -i
113+
./configure --with-mpi=${MPICH_DIR} \
114+
--with-hdf5=${HDF5_ROOT} \
115+
CFLAGS=-fno-var-tracking-assignments \
116+
CXXFLAGS=-fno-var-tracking-assignments
117+
make -j 8
118+
- name: Print config.log if error
119+
if: ${{ failure() }}
120+
run: |
121+
set -x
122+
cat ${GITHUB_WORKSPACE}/config.log
123+
- name: Test - make check
124+
if: ${{ success() }}
125+
run: |
126+
set -x
127+
cd ${GITHUB_WORKSPACE}
128+
make -s check
129+
- name: Print log files
130+
if: ${{ always() }}
131+
run: |
132+
set -x
133+
cd ${GITHUB_WORKSPACE}
134+
cat test.sh.log
135+
cat utils/*.log
136+
- name: Test - make ptest
137+
if: ${{ success() }}
138+
run: |
139+
set -x
140+
cd ${GITHUB_WORKSPACE}
141+
make -s ptest
142+
- name: Print log files
143+
if: ${{ always() }}
144+
run: |
145+
set -x
146+
cd ${GITHUB_WORKSPACE}
147+
cat test.sh.log
148+
cat utils/*.log
149+
- name: make distclean
150+
if: ${{ always() }}
151+
run: |
152+
set -x
153+
cd ${GITHUB_WORKSPACE}
154+
make -s distclean
155+

0 commit comments

Comments
 (0)