xdmf3: fix compilation with hdf5@1.10 and above (#37551)

This commit is contained in:
Thomas-Ulrich 2023-11-03 14:23:49 +01:00 committed by GitHub
parent db16335aec
commit 0f1898c82a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 45 additions and 3 deletions

View file

@ -0,0 +1,40 @@
diff --git a/core/XdmfHDF5Controller.hpp b/core/XdmfHDF5Controller.hpp
index c5c15d0a..496cc80d 100644
--- a/core/XdmfHDF5Controller.hpp
+++ b/core/XdmfHDF5Controller.hpp
@@ -27,13 +27,14 @@
// C Compatible Includes
#include "XdmfCore.hpp"
#include "XdmfHeavyDataController.hpp"
+#include <cstdint>
// So that hdf5 does not need to be included in the header files
// It would add a dependancy to programs that use Xdmf
#ifndef _H5Ipublic_H
#ifndef XDMF_HID_T
#define XDMF_HID_T
- typedef int hid_t;
+ typedef int64_t hid_t;
#endif
#endif
diff --git a/core/XdmfHDF5Writer.hpp b/core/XdmfHDF5Writer.hpp
index cfbec6f4..f83aa0de 100644
--- a/core/XdmfHDF5Writer.hpp
+++ b/core/XdmfHDF5Writer.hpp
@@ -28,13 +28,14 @@
#include "XdmfCore.hpp"
#include "XdmfHeavyDataWriter.hpp"
#include "XdmfHeavyDataController.hpp"
+#include <cstdint>
// So that hdf5 does not need to be included in the header files
// It would add a dependancy to programs that use Xdmf
#ifndef _H5Ipublic_H
#ifndef XDMF_HID_T
#define XDMF_HID_T
- typedef int hid_t;
+ typedef int64_t hid_t;
#endif
#endif

View file

@ -30,8 +30,10 @@ class Xdmf3(CMakePackage):
# See https://github.com/spack/spack/pull/22303 for reference
depends_on(Boost.with_default_variants)
depends_on("mpi", when="+mpi")
depends_on("hdf5+mpi", when="+mpi")
depends_on("hdf5~mpi", when="~mpi")
depends_on("hdf5@1.10:+mpi", when="+mpi")
depends_on("hdf5@1.10:~mpi", when="~mpi")
# motivated by discussion in https://gitlab.kitware.com/xdmf/xdmf/-/issues/28
patch("fix_hdf5_hid_t.diff")
def cmake_args(self):
"""Populate cmake arguments for XDMF."""
@ -42,7 +44,7 @@ def cmake_args(self):
"-DXDMF_BUILD_UTILS=ON",
"-DXDMF_WRAP_JAVA=OFF",
"-DXDMF_WRAP_PYTHON=OFF",
"-DXDMF_BUILD_TESTING=ON",
"-DXDMF_BUILD_TESTING=OFF",
]
return cmake_args