Skip to content

Commit fefab26

Browse files
authored
Add vtkm variant to visit spack package. (#31887)
1 parent e30a8e7 commit fefab26

File tree

3 files changed

+57
-0
lines changed

3 files changed

+57
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
--- a/src/CMake/FindVTKh.cmake 2022-07-21 15:39:17.991222000 -0700
2+
+++ b/src/CMake/FindVTKh.cmake 2022-07-21 15:42:12.326207000 -0700
3+
@@ -15,6 +15,10 @@
4+
# Kathleen Biagas, Tue Jan 21 10:46:31 PST 2020
5+
# Set VTKm_INCLUDE_DIRS.
6+
#
7+
+# Eric Brugger, Thu 21 Jul 2022 06:39:36 PM EDT
8+
+# Modified the logic to handle the case where a RELWITHDEBINFO build of
9+
+# VTKh was created. Modified the logic not to install static libraries.
10+
+#
11+
#****************************************************************************/
12+
13+
IF (DEFINED VISIT_VTKH_DIR)
14+
@@ -47,13 +51,16 @@
15+
# all interface link dependencies
16+
function(get_lib_loc_and_install _lib)
17+
get_target_property(ttype ${_lib} TYPE)
18+
- if (ttype STREQUAL "INTERFACE_LIBRARY")
19+
+ if (ttype STREQUAL "INTERFACE_LIBRARY" OR ttype STREQUAL "STATIC_LIBRARY")
20+
return()
21+
endif()
22+
get_target_property(i_loc ${_lib} IMPORTED_LOCATION)
23+
if (NOT i_loc)
24+
get_target_property(i_loc ${_lib} IMPORTED_LOCATION_RELEASE)
25+
endif()
26+
+ if (NOT i_loc)
27+
+ get_target_property(i_loc ${_lib} IMPORTED_LOCATION_RELWITHDEBINFO)
28+
+ endif()
29+
if(i_loc)
30+
THIRD_PARTY_INSTALL_LIBRARY(${i_loc})
31+
endif()

var/spack/repos/builtin/packages/visit/package.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,14 @@ class Visit(CMakePackage):
7878
variant("silo", default=True, description="Enable Silo file format")
7979
variant("python", default=True, description="Enable Python support")
8080
variant("mpi", default=True, description="Enable parallel engine")
81+
variant("vtkm", default=False, description="Enable VTK-m support")
8182

8283
patch("spack-changes-3.1.patch", when="@3.1.0:3.2.2")
8384
patch("spack-changes-3.0.1.patch", when="@3.0.1")
8485
patch("nonframework-qwt.patch", when="^qt~framework platform=darwin")
8586
patch("parallel-hdf5.patch", when="@3.0.1:3.2.2+hdf5+mpi")
8687
patch("parallel-hdf5-3.3.patch", when="@3.3.0:+hdf5+mpi")
88+
patch("cmake-findvtkh-3.3.patch", when="@3.3.0:+vtkm")
8789

8890
# Fix pthread and librt link errors
8991
patch("visit32-missing-link-libs.patch", when="@3.2")
@@ -145,6 +147,14 @@ class Visit(CMakePackage):
145147
depends_on("adios2+python", when="+adios2+python")
146148
depends_on("adios2~python", when="+adios2~python")
147149

150+
# vtk-m also requires vtk-h. Disabling cuda since that requires
151+
# later versions of vtk-m and vtk-h. The patch prevents vtk-m from
152+
# throwing an exception whenever any vtk-m operations are performed.
153+
depends_on("[email protected]+testlib~cuda", when="+vtkm")
154+
depends_on("[email protected]+shared~mpi~openmp~cuda", when="+vtkm")
155+
156+
depends_on("vtk-m", patches=[patch("vtk-m_transport_tag_topology_field_in.patch")])
157+
148158
depends_on("zlib")
149159

150160
@when("@3:,develop")
@@ -268,6 +278,10 @@ def cmake_args(self):
268278
else:
269279
args.append(self.define("VISIT_PARALLEL", False))
270280

281+
if "+vtkm" in spec:
282+
args.append(self.define("VISIT_VTKM_DIR", spec["vtk-m"].prefix))
283+
args.append(self.define("VISIT_VTKH_DIR", spec["vtk-h"].prefix))
284+
271285
return args
272286

273287
# https://spack.readthedocs.io/en/latest/packaging_guide.html?highlight=executables#making-a-package-discoverable-with-spack-external-find
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
--- a/vtkm/cont/arg/TransportTagTopologyFieldIn.h 2022-07-18 19:02:03.153633000 -0400
2+
+++ b/vtkm/cont/arg/TransportTagTopologyFieldIn.h 2022-07-18 19:02:51.538743000 -0400
3+
@@ -90,7 +90,9 @@
4+
{
5+
if (object.GetNumberOfValues() != detail::TopologyDomainSize(inputDomain, TopologyElementTag()))
6+
{
7+
+#if 0
8+
throw vtkm::cont::ErrorBadValue("Input array to worklet invocation the wrong size.");
9+
+#endif
10+
}
11+
12+
return object.PrepareForInput(Device(), token);

0 commit comments

Comments
 (0)