py-netcdf4: enable non-MPI build agains MPI-enabled HDF5 (#50186)
This commit is contained in:
parent
8e948c03fc
commit
3e3cb73446
@ -1,3 +1,27 @@
|
||||
--- a/include/netCDF4.pxi
|
||||
+++ b/include/netCDF4.pxi
|
||||
@@ -4,8 +4,8 @@
|
||||
ctypedef long ptrdiff_t
|
||||
|
||||
# hdf5 version info.
|
||||
-cdef extern from "H5public.h":
|
||||
- ctypedef int herr_t
|
||||
+ctypedef int herr_t
|
||||
+cdef extern \
|
||||
int H5get_libversion( unsigned int *majnum, unsigned int *minnum, unsigned int *relnum ) nogil
|
||||
|
||||
cdef extern from *:
|
||||
--- a/include/netcdf-compat.h
|
||||
+++ b/include/netcdf-compat.h
|
||||
@@ -95,7 +95,7 @@
|
||||
#define HAS_CDF5_FORMAT 0
|
||||
#endif
|
||||
|
||||
-#if defined(NC_HAS_PARALLEL) && NC_HAS_PARALLEL
|
||||
+#if 0
|
||||
#include <netcdf_par.h>
|
||||
#define HAS_PARALLEL_SUPPORT 1
|
||||
#else
|
||||
--- a/setup.py
|
||||
+++ b/setup.py
|
||||
@@ -392,7 +392,7 @@
|
||||
|
@ -55,8 +55,6 @@ class PyNetcdf4(PythonPackage):
|
||||
with when("+mpi"):
|
||||
depends_on("netcdf-c+mpi")
|
||||
depends_on("hdf5+mpi")
|
||||
# We cannot build py-netcdf4~mpi ^netcdf-c~mpi ^hdf5+mpi
|
||||
conflicts("hdf5+mpi", when="~mpi ^netcdf-c~mpi")
|
||||
|
||||
# The installation script tries to find hdf5 using pkg-config. However, the
|
||||
# version of hdf5 installed with Spack does not have pkg-config files.
|
||||
@ -72,6 +70,7 @@ class PyNetcdf4(PythonPackage):
|
||||
# See also: https://github.com/Unidata/netcdf4-python/issues/1389
|
||||
with when("@1.7:~mpi"):
|
||||
patch("disable_parallel_support.patch", when="^netcdf-c+mpi")
|
||||
patch("disable_parallel_support.patch", when="^hdf5+mpi")
|
||||
|
||||
# https://github.com/Unidata/netcdf4-python/pull/1322
|
||||
patch(
|
||||
|
Loading…
Reference in New Issue
Block a user