diff --git a/CMakeLists.txt b/CMakeLists.txt index e0fdc29c40..b56224299c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -767,7 +767,6 @@ IF(USE_HDF5) #Check to see if HDF5 library has collective metadata APIs, (HDF5 >= 1.10.0) CHECK_LIBRARY_EXISTS(${HDF5_C_LIBRARY_hdf5} H5Pset_all_coll_metadata_ops "" HDF5_HAS_COLL_METADATA_OPS) - CHECK_LIBRARY_EXISTS(${HDF5_C_LIBRARY_hdf5} H5Pset_libver_bounds "" HAVE_H5PSET_LIBVER_BOUNDS) CHECK_LIBRARY_EXISTS(${HDF5_C_LIBRARY_hdf5} H5free_memory "" HAVE_H5FREE_MEMORY) CHECK_LIBRARY_EXISTS(${HDF5_C_LIBRARY_hdf5} H5allocate_memory "" HAVE_H5ALLOCATE_MEMORY) CHECK_LIBRARY_EXISTS(${HDF5_C_LIBRARY_hdf5} H5resize_memory "" HAVE_H5RESIZE_MEMORY) diff --git a/config.h.cmake.in b/config.h.cmake.in index 16acff835a..a6cd6bb79b 100644 --- a/config.h.cmake.in +++ b/config.h.cmake.in @@ -253,9 +253,6 @@ are set when opening a binary file on Windows. */ /* Define to 1 if you have the `gettimeofday' function. */ #cmakedefine HAVE_STRUCT_TIMESPEC 1 -/* if true, netcdf4 file properties will be set using H5Pset_libver_bounds */ -#cmakedefine HAVE_H5PSET_LIBVER_BOUNDS 1 - /* Define to 1 if you have the `H5Z_SZIP' function. */ #cmakedefine HAVE_H5Z_SZIP 1 diff --git a/configure.ac b/configure.ac index 77406dd346..720db94622 100644 --- a/configure.ac +++ b/configure.ac @@ -1196,7 +1196,7 @@ if test "x$enable_hdf5" = xyes; then # H5Pset_fapl_mpiposix and H5Pget_fapl_mpiposix have been removed since HDF5 1.8.12. # Use H5Pset_fapl_mpio and H5Pget_fapl_mpio, instead. - AC_CHECK_FUNCS([H5Pget_fapl_mpio H5Pset_deflate H5Z_SZIP H5free_memory H5resize_memory H5allocate_memory H5Pset_libver_bounds H5Pset_all_coll_metadata_ops]) + AC_CHECK_FUNCS([H5Pget_fapl_mpio H5Pset_deflate H5Z_SZIP H5free_memory H5resize_memory H5allocate_memory H5Pset_all_coll_metadata_ops]) # Check to see if HDF5 library has collective metadata APIs, (HDF5 >= 1.10.0) if test "x$ac_cv_func_H5Pset_all_coll_metadata_ops" = xyes; then diff --git a/libhdf5/hdf5create.c b/libhdf5/hdf5create.c index 27a99405c9..76595116e4 100644 --- a/libhdf5/hdf5create.c +++ b/libhdf5/hdf5create.c @@ -166,15 +166,19 @@ nc4_create_file(const char *path, int cmode, size_t initialsz, nc4_chunk_cache_preemption)); } -#ifdef HAVE_H5PSET_LIBVER_BOUNDS #if H5_VERSION_GE(1,10,2) - if (H5Pset_libver_bounds(fapl_id, H5F_LIBVER_EARLIEST, H5F_LIBVER_V18) < 0) + /* lib versions 1.10.2 and higher */ + if (H5Pset_libver_bounds(fapl_id, H5F_LIBVER_V18, H5F_LIBVER_LATEST) < 0) #else - if (H5Pset_libver_bounds(fapl_id, H5F_LIBVER_EARLIEST, - H5F_LIBVER_LATEST) < 0) +#if H5_VERSION_GE(1,10,0) + /* lib versions 1.10.0, 1.10.1 */ + if (H5Pset_libver_bounds(fapl_id, H5F_LIBVER_EARLIEST, H5F_LIBVER_LATEST) < 0) +#else + /* all HDF5 1.8 lib versions */ + if (H5Pset_libver_bounds(fapl_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) #endif - BAIL(NC_EHDFERR); #endif + BAIL(NC_EHDFERR); /* Create the property list. */ if ((fcpl_id = H5Pcreate(H5P_FILE_CREATE)) < 0) diff --git a/ncdump/tst_netcdf4.sh b/ncdump/tst_netcdf4.sh index d3737e3592..d13464587c 100755 --- a/ncdump/tst_netcdf4.sh +++ b/ncdump/tst_netcdf4.sh @@ -14,7 +14,7 @@ cleanncprops() { rm -f $dst cat $src \ | sed -e '/:_Endianness/d' \ - | sed -e 's/_SuperblockVersion = 1/_SuperblockVersion = 0/' \ + | sed -e 's/_SuperblockVersion = [12]/_SuperblockVersion = 0/' \ | sed -e 's/\(netcdflibversion\|netcdf\)=.*|/\1=NNNN|/' \ | sed -e 's/\(hdf5libversion\|hdf5\)=.*"/\1=HHHH"/' \ | grep -v '_NCProperties' \ diff --git a/ncdump/tst_netcdf4_4.sh b/ncdump/tst_netcdf4_4.sh index dd9fb88362..620d7c6638 100755 --- a/ncdump/tst_netcdf4_4.sh +++ b/ncdump/tst_netcdf4_4.sh @@ -14,7 +14,7 @@ cleanncprops() { rm -f $dst cat $src \ | sed -e '/:_Endianness/d' \ - | sed -e 's/_SuperblockVersion = 1/_SuperblockVersion = 0/' \ + | sed -e 's/_SuperblockVersion = [12]/_SuperblockVersion = 0/' \ | sed -e 's/\(netcdflibversion\|netcdf\)=.*|/\1=NNNN|/' \ | sed -e 's/\(hdf5libversion\|hdf5\)=.*"/\1=HHHH"/' \ | grep -v '_NCProperties' \