From fefab26f01640c476d21ab444db46647f6edc121 Mon Sep 17 00:00:00 2001 From: Eric Brugger Date: Fri, 5 Aug 2022 09:25:56 -0700 Subject: Add vtkm variant to visit spack package. (#31887) --- .../packages/visit/cmake-findvtkh-3.3.patch | 31 ++++++++++++++++++++++ var/spack/repos/builtin/packages/visit/package.py | 14 ++++++++++ .../vtk-m_transport_tag_topology_field_in.patch | 12 +++++++++ 3 files changed, 57 insertions(+) create mode 100644 var/spack/repos/builtin/packages/visit/cmake-findvtkh-3.3.patch create mode 100644 var/spack/repos/builtin/packages/visit/vtk-m_transport_tag_topology_field_in.patch diff --git a/var/spack/repos/builtin/packages/visit/cmake-findvtkh-3.3.patch b/var/spack/repos/builtin/packages/visit/cmake-findvtkh-3.3.patch new file mode 100644 index 0000000000..f1e45f0334 --- /dev/null +++ b/var/spack/repos/builtin/packages/visit/cmake-findvtkh-3.3.patch @@ -0,0 +1,31 @@ +--- a/src/CMake/FindVTKh.cmake 2022-07-21 15:39:17.991222000 -0700 ++++ b/src/CMake/FindVTKh.cmake 2022-07-21 15:42:12.326207000 -0700 +@@ -15,6 +15,10 @@ + # Kathleen Biagas, Tue Jan 21 10:46:31 PST 2020 + # Set VTKm_INCLUDE_DIRS. + # ++# Eric Brugger, Thu 21 Jul 2022 06:39:36 PM EDT ++# Modified the logic to handle the case where a RELWITHDEBINFO build of ++# VTKh was created. Modified the logic not to install static libraries. ++# + #****************************************************************************/ + + IF (DEFINED VISIT_VTKH_DIR) +@@ -47,13 +51,16 @@ + # all interface link dependencies + function(get_lib_loc_and_install _lib) + get_target_property(ttype ${_lib} TYPE) +- if (ttype STREQUAL "INTERFACE_LIBRARY") ++ if (ttype STREQUAL "INTERFACE_LIBRARY" OR ttype STREQUAL "STATIC_LIBRARY") + return() + endif() + get_target_property(i_loc ${_lib} IMPORTED_LOCATION) + if (NOT i_loc) + get_target_property(i_loc ${_lib} IMPORTED_LOCATION_RELEASE) + endif() ++ if (NOT i_loc) ++ get_target_property(i_loc ${_lib} IMPORTED_LOCATION_RELWITHDEBINFO) ++ endif() + if(i_loc) + THIRD_PARTY_INSTALL_LIBRARY(${i_loc}) + endif() diff --git a/var/spack/repos/builtin/packages/visit/package.py b/var/spack/repos/builtin/packages/visit/package.py index 18bb289ec5..dc7ce3c564 100644 --- a/var/spack/repos/builtin/packages/visit/package.py +++ b/var/spack/repos/builtin/packages/visit/package.py @@ -78,12 +78,14 @@ class Visit(CMakePackage): variant("silo", default=True, description="Enable Silo file format") variant("python", default=True, description="Enable Python support") variant("mpi", default=True, description="Enable parallel engine") + variant("vtkm", default=False, description="Enable VTK-m support") patch("spack-changes-3.1.patch", when="@3.1.0:3.2.2") patch("spack-changes-3.0.1.patch", when="@3.0.1") patch("nonframework-qwt.patch", when="^qt~framework platform=darwin") patch("parallel-hdf5.patch", when="@3.0.1:3.2.2+hdf5+mpi") patch("parallel-hdf5-3.3.patch", when="@3.3.0:+hdf5+mpi") + patch("cmake-findvtkh-3.3.patch", when="@3.3.0:+vtkm") # Fix pthread and librt link errors patch("visit32-missing-link-libs.patch", when="@3.2") @@ -145,6 +147,14 @@ class Visit(CMakePackage): depends_on("adios2+python", when="+adios2+python") depends_on("adios2~python", when="+adios2~python") + # vtk-m also requires vtk-h. Disabling cuda since that requires + # later versions of vtk-m and vtk-h. The patch prevents vtk-m from + # throwing an exception whenever any vtk-m operations are performed. + depends_on("vtk-m@1.7.0+testlib~cuda", when="+vtkm") + depends_on("vtk-h@0.8.1+shared~mpi~openmp~cuda", when="+vtkm") + + depends_on("vtk-m", patches=[patch("vtk-m_transport_tag_topology_field_in.patch")]) + depends_on("zlib") @when("@3:,develop") @@ -268,6 +278,10 @@ class Visit(CMakePackage): else: args.append(self.define("VISIT_PARALLEL", False)) + if "+vtkm" in spec: + args.append(self.define("VISIT_VTKM_DIR", spec["vtk-m"].prefix)) + args.append(self.define("VISIT_VTKH_DIR", spec["vtk-h"].prefix)) + return args # https://spack.readthedocs.io/en/latest/packaging_guide.html?highlight=executables#making-a-package-discoverable-with-spack-external-find diff --git a/var/spack/repos/builtin/packages/visit/vtk-m_transport_tag_topology_field_in.patch b/var/spack/repos/builtin/packages/visit/vtk-m_transport_tag_topology_field_in.patch new file mode 100644 index 0000000000..2428411589 --- /dev/null +++ b/var/spack/repos/builtin/packages/visit/vtk-m_transport_tag_topology_field_in.patch @@ -0,0 +1,12 @@ +--- a/vtkm/cont/arg/TransportTagTopologyFieldIn.h 2022-07-18 19:02:03.153633000 -0400 ++++ b/vtkm/cont/arg/TransportTagTopologyFieldIn.h 2022-07-18 19:02:51.538743000 -0400 +@@ -90,7 +90,9 @@ + { + if (object.GetNumberOfValues() != detail::TopologyDomainSize(inputDomain, TopologyElementTag())) + { ++#if 0 + throw vtkm::cont::ErrorBadValue("Input array to worklet invocation the wrong size."); ++#endif + } + + return object.PrepareForInput(Device(), token); -- cgit v1.2.3-70-g09d2