1- # Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
2- # Spack Project Developers. See the top-level COPYRIGHT file for details.
1+ # Copyright Spack Project Developers. See COPYRIGHT file for details.
32#
43# SPDX-License-Identifier: (Apache-2.0 OR MIT)
54
65
76import os
87import sys
98
9+ from spack .build_systems .cmake import CMakeBuilder
1010from spack .package import *
1111
1212
@@ -21,7 +21,7 @@ class VtkM(CMakePackage, CudaPackage, ROCmPackage):
2121 homepage = "https://m.vtk.org/"
2222 maintainers ("kmorel" , "vicentebolea" )
2323
24- url = "https://github.com/Kitware/VTK-m/archive/refs/tags/v2.3 .0.tar.gz"
24+ url = "https://github.com/Kitware/VTK-m/archive/refs/tags/v2.2 .0.tar.gz"
2525 git = "https://github.com/Kitware/VTK-m.git"
2626 tags = ["e4s" ]
2727
@@ -31,10 +31,10 @@ class VtkM(CMakePackage, CudaPackage, ROCmPackage):
3131 version ("release" , branch = "release" )
3232 version (
3333 "2.3.0" ,
34- sha256 = "f40d6b39ca1bcecd232571c92ce606627811909f4e21972d1823e605f686bcf5 " ,
34+ sha256 = "d105ee2de5cfa600f1b4b3d2061f97bebd581a0ae1c86c6174af4e8128f83c54 " ,
3535 preferred = True ,
3636 )
37- version ("2.2.0" , sha256 = "d105ee2de5cfa600f1b4b3d2061f97bebd581a0ae1c86c6174af4e8128f83c54 " )
37+ version ("2.2.0" , sha256 = "f40d6b39ca1bcecd232571c92ce606627811909f4e21972d1823e605f686bcf5 " )
3838 version ("2.1.0" , sha256 = "7b224f1f91e5ef140e193338bf091133b1e9f40d323bccdc8bb80bfc2675e6ea" )
3939 version ("2.0.0" , sha256 = "21c8b2cb8f3d4116a4f90c1d08c9f5e27b25c7a0951f7b403eced94576f84880" )
4040 version ("1.9.0" , sha256 = "f9862d9d24deae32063ba1ea3d9a42900ac0cdd7f98412d960249a7cac35d47f" )
@@ -53,8 +53,6 @@ class VtkM(CMakePackage, CudaPackage, ROCmPackage):
5353 version ("1.2.0" , sha256 = "44596e88b844e7626248fb8e96a38be25a0e585a22256b1c859208b23ef45171" )
5454 version ("1.1.0" , sha256 = "55f42c417d3a41893230b2fd3b5c192daeee689a2193de10bf22a1ef5c24c7ad" )
5555
56- depends_on ("cxx" , type = "build" ) # generated
57-
5856 variant ("shared" , default = False , description = "build shared libs" )
5957
6058 variant ("doubleprecision" , default = True , description = "enable double precision" )
@@ -88,6 +86,9 @@ class VtkM(CMakePackage, CudaPackage, ROCmPackage):
8886 variant ("tbb" , default = (sys .platform == "darwin" ), description = "build TBB support" )
8987 variant ("sycl" , default = False , description = "Build with SYCL backend" )
9088
89+ depends_on ("c" , type = "build" )
90+ depends_on ("cxx" , type = "build" )
91+
9192 depends_on (
"[email protected] :" ,
type = "build" )
# CMake >= 3.12 9293 depends_on (
"[email protected] :" ,
when = "+rocm" ,
type = "build" )
# CMake >= 3.18 9394
@@ -153,23 +154,23 @@ class VtkM(CMakePackage, CudaPackage, ROCmPackage):
153154
154155 # VTK-M PR#3215
155156 # https://gitlab.kitware.com/vtk/vtk-m/-/merge_requests/3215
156- patch ("vtkm-mr3215-ext-geom-fix.patch" , when = "@2.1:2.2 " )
157+ patch ("vtkm-mr3215-ext-geom-fix.patch" , when = "@2.1" )
157158
158159 # VTK-M PR#2972
159160 # https://gitlab.kitware.com/vtk/vtk-m/-/merge_requests/2972
160161 patch ("vtkm-cuda-swap-conflict-pr2972.patch" , when = "@1.9 +cuda ^cuda@12:" )
161162
162163 # VTK-M PR#3160
163164 # https://gitlab.kitware.com/vtk/vtk-m/-/merge_requests/3160
164- patch ("mr3160-rocthrust-fix.patch" , when = "@2.1:2.2 " )
165+ patch ("mr3160-rocthrust-fix.patch" , when = "@2.1" )
165166
166167 # VTK-M PR#3258
167168 # https://gitlab.kitware.com/vtk/vtk-m/-/merge_requests/3258
168- patch ("mr3258-fix-typo-thrust-dependency-with-rocm.patch" , when = "@: 2.2.0" )
169+ patch ("mr3258-fix-typo-thrust-dependency-with-rocm.patch" , when = "@2.2.0" )
169170
170171 # VTK-M PR#3259
171172 # https://gitlab.kitware.com/vtk/vtk-m/-/merge_requests/3259
172- patch (
"mr3259-thrust-is_arithmetic-fix.patch" ,
when = "@2.0.0:2.3 .0 +cuda ^[email protected] :" )
173+ patch (
"mr3259-thrust-is_arithmetic-fix.patch" ,
when = "@2.0.0:2.2 .0 +cuda ^[email protected] :" )
173174
174175 # VTK-m PR#3271
175176 # https://gitlab.kitware.com/vtk/vtk-m/-/merge_requests/3271
@@ -238,7 +239,7 @@ def cmake_args(self):
238239 os .environ ["TBB_ROOT" ] = spec ["tbb" ].prefix
239240
240241 if "+kokkos" in spec and "+rocm" in spec and spec .satisfies ("^kokkos@4:" ):
241- options .append (f"-DCMAKE_CXX_COMPILER:BOOL ={ spec ['hip' ].prefix .bin .hipcc } " )
242+ options .append (f"-DCMAKE_CXX_COMPILER:FILEPATH ={ spec ['hip' ].prefix .bin .hipcc } " )
242243
243244 # Support for relocatable code
244245 if "~shared" in spec and "+fpic" in spec :
@@ -250,7 +251,7 @@ def cmake_args(self):
250251 options .append ("-DCMAKE_CUDA_HOST_COMPILER={0}" .format (env ["SPACK_CXX" ]))
251252
252253 if spec .
satisfies (
"@1.9.0:" )
and spec .
satisfies (
"^[email protected] :" ):
253- options .append (self . builder .define_cuda_architectures (self ))
254+ options .append (CMakeBuilder .define_cuda_architectures (self ))
254255
255256 else :
256257 # VTKm_CUDA_Architecture only accepts a single CUDA arch
@@ -270,28 +271,24 @@ def cmake_args(self):
270271
271272 # hip support
272273 if "+rocm" in spec :
273- options .append (self . builder .define_hip_architectures (self ))
274+ options .append (CMakeBuilder .define_hip_architectures (self ))
274275
275276 return options
276277
277278 def test_smoke_test (self ):
278279 """Build and run ctests"""
279- spec = self .spec
280-
281- if "+examples" not in spec :
280+ if "+examples" not in self .spec :
282281 raise SkipTest ("Package must be installed with +examples" )
283282
284283 testdir = "smoke_test_build"
285284 with working_dir (testdir , create = True ):
286- cmake = Executable (spec ["cmake" ].prefix .bin .cmake )
287- ctest = Executable (spec ["cmake" ].prefix .bin .ctest )
288- cmakeExampleDir = spec ["vtk-m" ].prefix .share .doc .VTKm .examples .smoke_test
289-
290- cmake (* ([cmakeExampleDir , "-DVTKm_ROOT=" + spec ["vtk-m" ].prefix ]))
291- cmake (* (["--build" , "." ]))
292- ctest (* (["--verbose" ]))
285+ cmake = Executable (self .spec ["cmake" ].prefix .bin .cmake )
286+ ctest = Executable (self .spec ["cmake" ].prefix .bin .ctest )
287+ cmake (self .prefix .share .doc .VTKm .examples .smoke_test , f"-DVTKm_ROOT={ self .prefix } " )
288+ cmake ("--build" , "." )
289+ ctest ("--verbose" )
293290
294291 @run_after ("install" )
295292 @on_package_attributes (run_tests = True )
296293 def build_test (self ):
297- self .test_smoke_test ()
294+ self .test_smoke_test ()
0 commit comments