From e9088e5dfa22ea4cf93c854751a7fa4c60eee0eb Mon Sep 17 00:00:00 2001 From: Greg Sjaardema Date: Thu, 19 Apr 2018 13:26:56 -0600 Subject: [PATCH] Use hdf5-1.8 compatible output format if possible In hdf5-1.10.2, THG added a new enumeration for use in the `H5Pset_libver_bounds` function which makes it easier to maintain compatibility with hdf5-1.8.X clients. An explanation is provided at https://www.hdfgroup.org/2018/04/why-should-i-care-about-the-hdf5-1-10-2-release/ In particular, the section "What does this change mean to an HDF5 application?" discusses its use with NetCDF --- libsrc4/nc4file.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libsrc4/nc4file.c b/libsrc4/nc4file.c index 225f6a708b..e689f4521e 100644 --- a/libsrc4/nc4file.c +++ b/libsrc4/nc4file.c @@ -997,7 +997,11 @@ nc4_create_file(const char *path, int cmode, MPI_Comm comm, MPI_Info info, #endif /* USE_PARALLEL4 */ #ifdef HDF5_HAS_LIBVER_BOUNDS +#if H5_VERSION_GE(1,10,2) + if (H5Pset_libver_bounds(fapl_id, H5F_LIBVER_EARLIEST, H5F_LIBVER_V18) < 0) +#else if (H5Pset_libver_bounds(fapl_id, H5F_LIBVER_EARLIEST, H5F_LIBVER_LATEST) < 0) +#endif BAIL(NC_EHDFERR); #endif