Skip to content

Commit

Permalink
Merge pull request #1364 from Unidata/issue1363
Browse files Browse the repository at this point in the history
fix for compiling with netcdf-c 4.7.4 (issue #1363)
  • Loading branch information
jswhit authored Sep 24, 2024
2 parents f4c33a9 + 91d6e98 commit 188cc6c
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build_latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
pushd pnetcdf-${PNETCDF_VERSION}
./configure --prefix $NETCDF_DIR --enable-shared --disable-fortran --disable-cxx
make -j 2
make install
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
Expand All @@ -46,7 +46,7 @@ jobs:
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
sudo make install
popd
# - name: The job has failed
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
autoreconf -i
./configure --prefix $NETCDF_DIR --enable-netcdf-4 --enable-shared --enable-dap --enable-parallel4
make -j 2
make install
sudo make install
popd
# - name: The job has failed
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/build_old.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
runs-on: ubuntu-latest
env:
PNETCDF_VERSION: 1.12.1
NETCDF_VERSION: 4.8.1
NETCDF_VERSION: 4.7.4
NETCDF_DIR: ${{ github.workspace }}/..
NETCDF_EXTRA_CONFIG: --enable-pnetcdf
CC: mpicc.mpich
Expand Down Expand Up @@ -35,18 +35,19 @@ jobs:
pushd pnetcdf-${PNETCDF_VERSION}
./configure --prefix $NETCDF_DIR --enable-shared --disable-fortran --disable-cxx
make -j 2
make install
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
#wget https://downloads.unidata.ucar.edu/netcdf-c/${NETCDF_VERSION}/netcdf-c-${NETCDF_VERSION}.tar.gz
wget https://www.gfd-dennou.org/arch/netcdf/unidata-mirror/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
sudo make install
popd
# - name: The job has failed
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/miniconda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ jobs:
init-shell: bash
create-args: >-
python=${{ matrix.python-version }}
numpy cython pip pytest mpi4py hdf5=*=mpi* libnetcdf=*=mpi* cftime zlib certifi
numpy cython pip pytest openmpi mpi4py hdf5=*=mpi* libnetcdf=*=mpi* cftime zlib certifi
--channel conda-forge
- name: Install netcdf4-python with mpi
Expand Down
5 changes: 5 additions & 0 deletions external/nc_complex/src/nc_complex.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@

#include "nc_complex_version.h"

// to enable compilation with older versions of netcdf-c
#ifndef NC_FORMATX_NCZARR
#define NC_FORMATX_NCZARR (10)
#endif

// NOLINTBEGIN(bugprone-assignment-in-if-condition)
#define CHECK(func) \
do { \
Expand Down

0 comments on commit 188cc6c

Please sign in to comment.