Skip to content

Commit

Permalink
Update libhdf5 requirement to 1.10 and do associated cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
rouault committed Dec 6, 2023
1 parent d7e62e7 commit 69bc4b4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 24 deletions.
7 changes: 4 additions & 3 deletions cmake/helpers/CheckDependentLibraries.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ macro (gdal_check_package name purpose)
find_package2(${name} QUIET OUT_DEPENDENCY _find_dependency)
else()
set(_find_package_args)
if (_GCP_VERSION AND NOT ("${name}" STREQUAL "TileDB"))
# For some reason passing the HDF5 version requirement cause a linking error of the libkea driver on Conda Windows builds...
if (_GCP_VERSION AND NOT ("${name}" STREQUAL "TileDB") AND NOT ("${name}" STREQUAL "HDF5"))
list(APPEND _find_package_args ${_GCP_VERSION})
endif ()
if (_GCP_CONFIG)
Expand Down Expand Up @@ -581,9 +582,9 @@ gdal_check_package(KEA "Enable KEA driver" CAN_DISABLE)

if(HAVE_KEA)
# CXX is only needed for KEA driver
gdal_check_package(HDF5 "Enable HDF5" COMPONENTS "C" "CXX" CAN_DISABLE)
gdal_check_package(HDF5 "Enable HDF5" COMPONENTS "C" "CXX" CAN_DISABLE VERSION 1.10)
else()
gdal_check_package(HDF5 "Enable HDF5" COMPONENTS "C" CAN_DISABLE)
gdal_check_package(HDF5 "Enable HDF5" COMPONENTS "C" CAN_DISABLE VERSION 1.10)
endif()

gdal_check_package(WebP "WebP compression" CAN_DISABLE)
Expand Down
27 changes: 6 additions & 21 deletions frmts/hdf5/hdf5vfl.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@
#include <algorithm>
#include <mutex>

#ifdef H5FD_FEAT_SUPPORTS_SWMR_IO
#define HDF5_1_10_OR_LATER
#endif

#ifdef H5FD_FEAT_MEMMANAGE
#define HDF5_1_13_OR_LATER
#endif
Expand All @@ -63,12 +59,7 @@ static herr_t HDF5_vsil_close(H5FD_t *_file);
static herr_t HDF5_vsil_query(const H5FD_t *_f1, unsigned long *flags);
static haddr_t HDF5_vsil_get_eoa(const H5FD_t *_file, H5FD_mem_t type);
static herr_t HDF5_vsil_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr);
static haddr_t HDF5_vsil_get_eof(const H5FD_t *_file
#ifdef HDF5_1_10_OR_LATER
,
H5FD_mem_t type
#endif
);
static haddr_t HDF5_vsil_get_eof(const H5FD_t *_file, H5FD_mem_t type);
static herr_t HDF5_vsil_read(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id,
haddr_t addr, size_t size, void *buf);
static herr_t HDF5_vsil_write(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id,
Expand All @@ -90,12 +81,10 @@ static const H5FD_class_t HDF5_vsil_g = {
* https://portal.hdfgroup.org/pages/viewpage.action?pageId=74188097 */
(H5FD_class_value_t)(513),
#endif
"vsil", /* name */
MAXADDR, /* maxaddr */
H5F_CLOSE_WEAK, /* fc_degree */
#ifdef HDF5_1_10_OR_LATER
nullptr, /* terminate */
#endif
"vsil", /* name */
MAXADDR, /* maxaddr */
H5F_CLOSE_WEAK, /* fc_degree */
nullptr, /* terminate */
nullptr, /* sb_size */
nullptr, /* sb_encode */
nullptr, /* sb_decode */
Expand Down Expand Up @@ -207,11 +196,7 @@ static herr_t HDF5_vsil_set_eoa(H5FD_t *_file, H5FD_mem_t /*type*/,
return 0;
}

static haddr_t HDF5_vsil_get_eof(const H5FD_t *_file
#ifdef HDF5_1_10_OR_LATER
,
H5FD_mem_t /* type */
#endif
static haddr_t HDF5_vsil_get_eof(const H5FD_t *_file, H5FD_mem_t /* type */
)
{
const HDF5_vsil_t *fh = reinterpret_cast<const HDF5_vsil_t *>(_file);
Expand Down

0 comments on commit 69bc4b4

Please sign in to comment.