openPMD-api: HDF5 1.12.0 Support (#15530)

Fix API breakage in HDF5 1.12.0 for released versions.
This commit is contained in:
Axel Huebl 2020-03-18 08:47:01 -05:00 committed by GitHub
parent 586609102b
commit 958f26073e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 27 additions and 0 deletions

View File

@ -0,0 +1,23 @@
From 61ccc18cdd478c6281466f1f77de416559234dd8 Mon Sep 17 00:00:00 2001
From: Axel Huebl <axel.huebl@plasma.ninja>
Date: Tue, 17 Mar 2020 10:51:20 -0700
Subject: [PATCH] HDF5: H5Oget_info Compatibility
Update to work with HDF5 1.12.0 signature.
Macro for older releases.
---
src/IO/HDF5/HDF5IOHandler.cpp | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/IO/HDF5/HDF5IOHandler.cpp b/src/IO/HDF5/HDF5IOHandler.cpp
index 7043861b..c125e1f4 100644
--- a/src/IO/HDF5/HDF5IOHandler.cpp
+++ b/src/IO/HDF5/HDF5IOHandler.cpp
@@ -1535,3 +1535,7 @@ void HDF5IOHandlerImpl::listAttributes(Writable* writable,
H5O_info_t object_info;
herr_t status;
+#if H5_VERSION_GE(1,12,0)
+ status = H5Oget_info(node_id, &object_info, H5O_INFO_NUM_ATTRS);
+#else
status = H5Oget_info(node_id, &object_info);
+#endif

View File

@ -55,6 +55,10 @@ class OpenpmdApi(CMakePackage):
extends('python', when='+python')
# Fix breaking HDF5 1.12.0 API
# https://github.com/openPMD/openPMD-api/pull/696
patch('hdf5-1.12.0.patch', when='@:0.11.0 +hdf5')
def cmake_args(self):
spec = self.spec