From 388bbf4e732acc58c7923f228b1bc39328aeb856 Mon Sep 17 00:00:00 2001 From: Scot Breitenfeld Date: Mon, 11 Jan 2021 09:48:04 -0600 Subject: [PATCH] Allow for the HDF5 file format to be compatible with features greater than HDF5 1.8. This will allow for HDF5 features (VDS, SWMR, new references, etc...) which may require to have a superblock greater than v2. See for discussion Ref: Update HDF5 format compatibility Unidata#951 --- libhdf5/hdf5create.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/libhdf5/hdf5create.c b/libhdf5/hdf5create.c index 73bfda70bf..4238df2e95 100644 --- a/libhdf5/hdf5create.c +++ b/libhdf5/hdf5create.c @@ -167,10 +167,16 @@ nc4_create_file(const char *path, int cmode, size_t initialsz, } #ifdef HAVE_H5PSET_LIBVER_BOUNDS -#if H5_VERSION_GE(1,10,2) - if (H5Pset_libver_bounds(fapl_id, H5F_LIBVER_V18, H5F_LIBVER_LATEST) < 0) +#if H5_VERSION_LT(1,10,0) + /* all HDF5 1.8 lib versions */ + if (H5Pset_libver_bounds(fapl_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0); #else - if (H5Pset_libver_bounds(fapl_id, H5F_LIBVER_EARLIEST, H5F_LIBVER_LATEST) < 0) +#if H5_VERSION_LE(1,10,1) + /* lib versions 1.10.0, 1.10.1 */ + if (H5Pset_libver_bounds(fapl_id, H5F_LIBVER_EARLIEST, H5F_LIBVER_LATEST) < 0); +#else + /* lib versions 1.10.2 and higher */ + if (H5Pset_libver_bounds(fapl_id, H5F_LIBVER_V18, H5F_LIBVER_LATEST) < 0); #endif BAIL(NC_EHDFERR); #endif