ParaView/VTK: Patch xdmf2 for HDF5 1.13 (#33930)

* ParaView/VTK: Patch xdmf2 for HDF5 1.13

* Meson: update meson build system for 0.64

* ParaView: Change HDF5 1.13 patch to 1.13.1/2 patchs

* Mesa: Remove legacy mesa option from meson_args

* Use append to assemble meson args
This commit is contained in:
kwryankrattiger 2023-01-23 21:22:21 -06:00 committed by GitHub
parent c5086a5d0e
commit cd2d6a6397
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 151 additions and 2 deletions

View File

@ -120,6 +120,7 @@ def std_meson_args(self):
of package writers. of package writers.
""" """
# standard Meson arguments # standard Meson arguments
std_meson_args = MesonBuilder.std_args(self.pkg) std_meson_args = MesonBuilder.std_args(self.pkg)
std_meson_args += getattr(self, "meson_flag_args", []) std_meson_args += getattr(self, "meson_flag_args", [])
return std_meson_args return std_meson_args
@ -182,7 +183,10 @@ def meson_args(self):
def meson(self, pkg, spec, prefix): def meson(self, pkg, spec, prefix):
"""Run ``meson`` in the build directory""" """Run ``meson`` in the build directory"""
options = [os.path.abspath(self.root_mesonlists_dir)] options = []
if self.spec["meson"].satisfies("@0.64:"):
options.append("setup")
options.append(os.path.abspath(self.root_mesonlists_dir))
options += self.std_meson_args options += self.std_meson_args
options += self.meson_args() options += self.meson_args()
with fs.working_dir(self.build_directory, create=True): with fs.working_dir(self.build_directory, create=True):

View File

@ -118,6 +118,7 @@ class Mesa(MesonPackage):
depends_on("libllvm@6:") depends_on("libllvm@6:")
depends_on("libllvm@:11", when="@:20") depends_on("libllvm@:11", when="@:20")
depends_on("libllvm@:12", when="@:21") depends_on("libllvm@:12", when="@:21")
depends_on("libx11", when="+glx") depends_on("libx11", when="+glx")
depends_on("libxcb", when="+glx") depends_on("libxcb", when="+glx")
depends_on("libxext", when="+glx") depends_on("libxext", when="+glx")
@ -202,8 +203,10 @@ def meson_args(self):
"-Dbuild-tests=false", "-Dbuild-tests=false",
"-Dglvnd=false", "-Dglvnd=false",
] ]
if spec.satisfies("@:22.2"): # gallium-xvmc was removed in @main and @2.23:
if self.spec.satisfies("@:22.2"):
args.append("-Dgallium-xvmc=disabled") args.append("-Dgallium-xvmc=disabled")
args_platforms = [] args_platforms = []
args_gallium_drivers = ["swrast"] args_gallium_drivers = ["swrast"]
args_dri_drivers = [] args_dri_drivers = []

View File

@ -268,6 +268,11 @@ class Paraview(CMakePackage, CudaPackage, ROCmPackage):
# intel oneapi doesn't compile some code in catalyst # intel oneapi doesn't compile some code in catalyst
patch("catalyst-etc_oneapi_fix.patch", when="@5.10.0:5.10.1%oneapi") patch("catalyst-etc_oneapi_fix.patch", when="@5.10.0:5.10.1%oneapi")
# Patch for paraview 5.10: +hdf5 ^hdf5@1.13.2:
# https://gitlab.kitware.com/vtk/vtk/-/merge_requests/9690
patch("vtk-xdmf2-hdf51.13.1.patch", when="@5.10.0:5.10 +hdf5")
patch("vtk-xdmf2-hdf51.13.2.patch", when="@5.10: +hdf5")
@property @property
def generator(self): def generator(self):
# https://gitlab.kitware.com/paraview/paraview/-/issues/21223 # https://gitlab.kitware.com/paraview/paraview/-/issues/21223

View File

@ -0,0 +1,61 @@
From 3a536a3c6b949cb1c9dd147c3a395c3ff31856e8 Mon Sep 17 00:00:00 2001
From: Ben Boeckel <ben.boeckel@kitware.com>
Date: Thu, 14 Apr 2022 12:53:36 -0400
Subject: [PATCH 1/6] xdmf2: install `XdmfExport.h`
---
VTK/ThirdParty/xdmf2/vtkxdmf2/libsrc/CMakeLists.txt | 1 +
1 file changed, 1 insertion(+)
diff --git a/VTK/ThirdParty/xdmf2/vtkxdmf2/libsrc/CMakeLists.txt b/VTK/ThirdParty/xdmf2/vtkxdmf2/libsrc/CMakeLists.txt
index 274dbc4423c..a47bf4ee4d9 100644
--- a/VTK/ThirdParty/xdmf2/vtkxdmf2/libsrc/CMakeLists.txt
+++ b/VTK/ThirdParty/xdmf2/vtkxdmf2/libsrc/CMakeLists.txt
@@ -276,6 +276,7 @@ vtk_module_add_module(VTK::xdmf2
${XdmfModelSource}
SOURCES ${XdmfExtraSource}
HEADERS Xdmf.h
+ XdmfExport.h
"${CMAKE_CURRENT_BINARY_DIR}/XdmfConfig.h"
HEADERS_SUBDIR "vtkxdmf2/libsrc")
set_target_properties(xdmf2
--
GitLab
From 1456c9e6ab2b244d225dcfc0a7f985933c09d5f3 Mon Sep 17 00:00:00 2001
From: Ben Boeckel <ben.boeckel@kitware.com>
Date: Thu, 14 Apr 2022 15:20:13 -0400
Subject: [PATCH 6/6] xdmf2: support HDF5 1.13.1
---
VTK/ThirdParty/xdmf2/vtkxdmf2/libsrc/XdmfH5Driver.cxx | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/VTK/ThirdParty/xdmf2/vtkxdmf2/libsrc/XdmfH5Driver.cxx b/VTK/ThirdParty/xdmf2/vtkxdmf2/libsrc/XdmfH5Driver.cxx
index 6a4966bb231..1a412b56d02 100644
--- a/VTK/ThirdParty/xdmf2/vtkxdmf2/libsrc/XdmfH5Driver.cxx
+++ b/VTK/ThirdParty/xdmf2/vtkxdmf2/libsrc/XdmfH5Driver.cxx
@@ -156,6 +156,9 @@ static herr_t H5FD_dsm_write(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, hadd
}
static const H5FD_class_t H5FD_dsm_g = {
+#if (H5_VERS_MAJOR>1)||((H5_VERS_MAJOR==1)&&(H5_VERS_MINOR>=13))
+ H5_VFD_RESERVED + 0xd3f2, /*value */
+#endif
"dsm", /*name */
MAXADDR, /*maxaddr */
H5F_CLOSE_WEAK, /*fc_degree */
@@ -193,6 +196,10 @@ static const H5FD_class_t H5FD_dsm_g = {
#endif
NULL, /*lock */
NULL, /*unlock */
+#if (H5_VERS_MAJOR>1)||((H5_VERS_MAJOR==1)&&(H5_VERS_MINOR>=13))
+ NULL, /*del */
+ NULL, /*ctl */
+#endif
H5FD_FLMAP_SINGLE /*fl_map */
};
--
GitLab

View File

@ -0,0 +1,36 @@
From 2cc0d020359f714587d14b2f25a2c5f235f829c9 Mon Sep 17 00:00:00 2001
From: Ryan Krattiger <ryan.krattiger@kitware.com>
Date: Tue, 15 Nov 2022 15:00:36 -0600
Subject: [PATCH] Xdmf2: Update HDF5 driver for 1.13.2
---
VTK/ThirdParty/xdmf2/vtkxdmf2/libsrc/XdmfH5Driver.cxx | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/VTK/ThirdParty/xdmf2/vtkxdmf2/libsrc/XdmfH5Driver.cxx b/VTK/ThirdParty/xdmf2/vtkxdmf2/libsrc/XdmfH5Driver.cxx
index 1a412b56d02..ff4427d0265 100644
--- a/VTK/ThirdParty/xdmf2/vtkxdmf2/libsrc/XdmfH5Driver.cxx
+++ b/VTK/ThirdParty/xdmf2/vtkxdmf2/libsrc/XdmfH5Driver.cxx
@@ -157,6 +157,7 @@ static herr_t H5FD_dsm_write(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, hadd
static const H5FD_class_t H5FD_dsm_g = {
#if (H5_VERS_MAJOR>1)||((H5_VERS_MAJOR==1)&&(H5_VERS_MINOR>=13))
+ 0, /*version */
H5_VFD_RESERVED + 0xd3f2, /*value */
#endif
"dsm", /*name */
@@ -190,6 +191,12 @@ static const H5FD_class_t H5FD_dsm_g = {
NULL, /*get_handle */
H5FD_dsm_read, /*read */
H5FD_dsm_write, /*write */
+#if (H5_VERS_MAJOR>1)||((H5_VERS_MAJOR==1)&&(H5_VERS_MINOR>=13))
+ NULL, /*read_vector */
+ NULL, /*write_vector */
+ NULL, /*read_selection */
+ NULL, /*write_selection */
+#endif
NULL, /*flush */
#if (H5_VERS_MAJOR>1)||((H5_VERS_MAJOR==1)&&(H5_VERS_MINOR>=8))
NULL, /* truncate */
--
GitLab

View File

@ -55,6 +55,10 @@ class Vtk(CMakePackage):
sha256="0546696bd02f3a99fccb9b7c49533377bf8179df16d901cefe5abf251173716d", sha256="0546696bd02f3a99fccb9b7c49533377bf8179df16d901cefe5abf251173716d",
) )
# Patch for paraview 5.10: +hdf5 ^hdf5@1.13.2:
# https://gitlab.kitware.com/vtk/vtk/-/merge_requests/9690
patch("xdmf2-hdf51.13.2.patch", when="@9:9.2 +xdmf")
# We cannot build with both osmesa and qt in spack # We cannot build with both osmesa and qt in spack
conflicts("+osmesa", when="+qt") conflicts("+osmesa", when="+qt")

View File

@ -0,0 +1,36 @@
--- a/ThirdParty/xdmf2/vtkxdmf2/libsrc/XdmfH5Driver.cxx 2022-11-15 15:37:37.242113202 -0600
+++ b/ThirdParty/xdmf2/vtkxdmf2/libsrc/XdmfH5Driver.cxx 2022-11-15 14:51:30.849230122 -0600
@@ -156,6 +156,10 @@
}
static const H5FD_class_t H5FD_dsm_g = {
+#if (H5_VERS_MAJOR>1)||((H5_VERS_MAJOR==1)&&(H5_VERS_MINOR>=13))
+ 0, /*version */
+ H5_VFD_RESERVED + 0xd3f2, /*value */
+#endif
"dsm", /*name */
MAXADDR, /*maxaddr */
H5F_CLOSE_WEAK, /*fc_degree */
@@ -187,12 +191,22 @@
NULL, /*get_handle */
H5FD_dsm_read, /*read */
H5FD_dsm_write, /*write */
+#if (H5_VERS_MAJOR>1)||((H5_VERS_MAJOR==1)&&(H5_VERS_MINOR>=13))
+ NULL, /*read_vector */
+ NULL, /*write_vector */
+ NULL, /*read_selection */
+ NULL, /*write_selection */
+#endif
NULL, /*flush */
#if (H5_VERS_MAJOR>1)||((H5_VERS_MAJOR==1)&&(H5_VERS_MINOR>=8))
NULL, /* truncate */
#endif
NULL, /*lock */
NULL, /*unlock */
+#if (H5_VERS_MAJOR>1)||((H5_VERS_MAJOR==1)&&(H5_VERS_MINOR>=13))
+ NULL, /*del */
+ NULL, /*ctl */
+#endif
H5FD_FLMAP_SINGLE /*fl_map */
};