-
Notifications
You must be signed in to change notification settings - Fork 271
115 lines (107 loc) · 4.17 KB
/
build_latest.yml
File metadata and controls
115 lines (107 loc) · 4.17 KB
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
name: Build and Test Linux with latest netcdf-c
on: [push, pull_request]
jobs:
build-linux:
name: Python (${{ matrix.python-version }})
runs-on: ubuntu-latest
env:
PNETCDF_VERSION: 1.14.1
NETCDF_VERSION: 4.9.3
NETCDF_DIR: ${{ github.workspace }}/..
NETCDF_EXTRA_CONFIG: --enable-pnetcdf
#CC: mpicc.mpich
CC: mpicc
#NO_NET: 1
strategy:
matrix:
python-version: ["3.14"]
steps:
- uses: actions/checkout@v6
with:
submodules: true
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install Ubuntu Dependencies
run: |
sudo apt-get update
#sudo apt-get install mpich libmpich-dev libhdf5-mpich-dev openmpi-bin openmpi-common libopenmpi-dev libhdf5-openmpi-dev libcurl4-openssl-dev bzip2 libsnappy-dev libblosc-dev libzstd-dev
sudo apt-get install openmpi-common libopenmpi-dev openmpi-bin libhdf5-openmpi-dev libcurl4-openssl-dev bzip2 libsnappy-dev libblosc-dev libzstd-dev
echo "Download and build PnetCDF version ${PNETCDF_VERSION}"
wget https://parallel-netcdf.github.io/Release/pnetcdf-${PNETCDF_VERSION}.tar.gz
tar -xzf pnetcdf-${PNETCDF_VERSION}.tar.gz
pushd pnetcdf-${PNETCDF_VERSION}
./configure --prefix $NETCDF_DIR --enable-shared --disable-fortran --disable-cxx
make -j 2
sudo make install
popd
echo "Download and build netCDF version ${NETCDF_VERSION}"
wget https://downloads.unidata.ucar.edu/netcdf-c/${NETCDF_VERSION}/netcdf-c-${NETCDF_VERSION}.tar.gz
tar -xzf netcdf-c-${NETCDF_VERSION}.tar.gz
pushd netcdf-c-${NETCDF_VERSION}
#export CPPFLAGS="-I/usr/include/hdf5/mpich -I${NETCDF_DIR}/include"
export CPPFLAGS="-I/usr/include/hdf5/openmpi -I${NETCDF_DIR}/include"
export LDFLAGS="-L${NETCDF_DIR}/lib"
#export LIBS="-lhdf5_mpich_hl -lhdf5_mpich -lm -lz"
export LIBS="-lhdf5_openmpi_hl -lhdf5_openmpi -lm -lz"
which $CC
./configure --prefix $NETCDF_DIR --enable-netcdf-4 --enable-shared --enable-dap --enable-parallel4 $NETCDF_EXTRA_CONFIG
make -j 2
sudo make install
popd
# - name: The job has failed
# if: ${{ failure() }}
# run: |
# cd netcdf-c-${NETCDF_VERSION}
# cat config.log
- name: Install python dependencies via pip
run: |
python -m pip install --upgrade pip
python -m pip install numpy cython cftime pytest twine wheel check-manifest mpi4py typing-extensions
- name: Install netcdf4-python
run: |
export PATH=${NETCDF_DIR}/bin:${PATH}
export NETCDF_PLUGIN_DIR=${{ github.workspace }}/netcdf-c-${NETCDF_VERSION}/plugins/plugindir
python -m pip install . --no-build-isolation
- name: Test
run: |
export PATH=${NETCDF_DIR}/bin:${PATH}
python checkversion.py
# serial
cd test
python run_all.py
# parallel (hdf5 for netcdf4, pnetcdf for netcdf3)
cd ../examples
#mpirun.mpich -np 4 python mpi_example.py
mpirun -np 4 --oversubscribe python mpi_example.py
if [ $? -ne 0 ] ; then
echo "hdf5 mpi test failed!"
exit 1
else
echo "hdf5 mpi test passed!"
fi
#mpirun.mpich -np 4 python mpi_example_compressed.py
mpirun -np 4 --oversubscribe python mpi_example_compressed.py
if [ $? -ne 0 ] ; then
echo "hdf5 compressed mpi test failed!"
exit 1
else
echo "hdf5 compressed mpi test passed!"
fi
#mpirun.mpich -np 4 python mpi_example.py NETCDF3_64BIT_DATA
mpirun -np 4 --oversubscribe python mpi_example.py NETCDF3_64BIT_DATA
if [ $? -ne 0 ] ; then
echo "pnetcdf mpi test failed!"
exit 1
else
echo "pnetcdf mpi test passed!"
fi
# - name: Tarball
# run: |
# export PATH=${NETCDF_DIR}/bin:${PATH}
# python setup.py --version
# check-manifest --version
# check-manifest --verbose
# pip wheel . -w dist --no-deps
# twine check dist/*