Does it build? #1
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: 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.12.1 | |
NETCDF_VERSION: 4.9.2 | |
NETCDF_DIR: ${{ github.workspace }}/.. | |
NETCDF_EXTRA_CONFIG: --enable-pnetcdf | |
CC: mpicc.mpich | |
#NO_NET: 1 | |
strategy: | |
matrix: | |
python-version: ["3.11"] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
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 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 | |
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 LDFLAGS="-L${NETCDF_DIR}/lib" | |
export LIBS="-lhdf5_mpich_hl -lhdf5_mpich -lm -lz" | |
./configure --prefix $NETCDF_DIR --enable-netcdf-4 --enable-shared --enable-dap --enable-parallel4 $NETCDF_EXTRA_CONFIG | |
make -j 2 | |
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 | |
pip install numpy cython cftime pytest twine wheel check-manifest mpi4py | |
- name: Install netcdf4-python | |
run: | | |
export PATH=${NETCDF_DIR}/bin:${PATH} | |
export NETCDF_PLUGIN_DIR=${{ github.workspace }}/netcdf-c-${NETCDF_VERSION}/plugins/plugindir | |
python setup.py install | |
- name : Build | |
run: | | |
export PATH=${NETCDF_DIR}/bin:${PATH} | |
python setup.py build_ext --inplace | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v2 | |
with: | |
name: netcdf4-python | |
path: dist/ | |
# - 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/* |