Update the VTK-m package with better defaults and cuda corrections (#12850)
This commit is contained in:
parent
3cb4547348
commit
b1cdf8bd57
@ -6,6 +6,7 @@
|
||||
|
||||
from spack import *
|
||||
import os
|
||||
import sys
|
||||
|
||||
|
||||
class Vtkm(CMakePackage, CudaPackage):
|
||||
@ -21,6 +22,7 @@ class Vtkm(CMakePackage, CudaPackage):
|
||||
git = "https://gitlab.kitware.com/vtk/vtk-m.git"
|
||||
|
||||
version('master', branch='master')
|
||||
version('1.4.0', "b0d76bbf5a69c18ec6f1fca4f7858047b65330bd")
|
||||
version('1.3.0', "d9f6e274dec2ea01273cccaba356d23ca88c5a25")
|
||||
version('1.2.0', "3295fed86012226c107e1f2605ca7cc583586b63")
|
||||
version('1.1.0', "6aab1c0885f6ffaaffcf07930873d0df")
|
||||
@ -29,15 +31,15 @@ class Vtkm(CMakePackage, CudaPackage):
|
||||
# can overwhelm compilers with too many symbols
|
||||
variant('build_type', default='Release', description='CMake build type',
|
||||
values=('Debug', 'Release', 'RelWithDebInfo', 'MinSizeRel'))
|
||||
variant("shared", default=True, description="build shared libs")
|
||||
variant("shared", default=False, description="build shared libs")
|
||||
variant("cuda", default=False, description="build cuda support")
|
||||
variant("doubleprecision", default=True,
|
||||
description='enable double precision')
|
||||
variant("logging", default=False, description="build logging support")
|
||||
variant("logging", default=True, description="build logging support")
|
||||
variant("mpi", default=False, description="build mpi support")
|
||||
variant("openmp", default=False, description="build openmp support")
|
||||
variant("openmp", default=(sys.platform != 'darwin'), description="build openmp support")
|
||||
variant("rendering", default=True, description="build rendering support")
|
||||
variant("tbb", default=True, description="build TBB support")
|
||||
variant("tbb", default=(sys.platform == 'darwin'), description="build TBB support")
|
||||
variant("64bitids", default=False,
|
||||
description="enable 64 bits ids")
|
||||
|
||||
@ -46,9 +48,16 @@ class Vtkm(CMakePackage, CudaPackage):
|
||||
depends_on("cuda", when="+cuda")
|
||||
depends_on("mpi", when="+mpi")
|
||||
|
||||
conflicts("~shared", when="~pic")
|
||||
|
||||
def cmake_args(self):
|
||||
spec = self.spec
|
||||
options = []
|
||||
gpu_name_table = {'20': 'fermi',
|
||||
'30': 'kepler', '32': 'kepler', '35': 'kepler',
|
||||
'50': 'maxwell', '52': 'maxwell', '53': 'maxwell',
|
||||
'60': 'pascal', '61': 'pascal', '62': 'pascal',
|
||||
'70': 'turing', '72': 'turing', '75': 'turing'}
|
||||
with working_dir('spack-build', create=True):
|
||||
options = ["-DVTKm_ENABLE_TESTING:BOOL=OFF"]
|
||||
# shared vs static libs
|
||||
@ -60,9 +69,10 @@ def cmake_args(self):
|
||||
if "+cuda" in spec:
|
||||
options.append("-DVTKm_ENABLE_CUDA:BOOL=ON")
|
||||
if 'cuda_arch' in spec.variants:
|
||||
cuda_arch = spec.variants['cuda_arch'].value
|
||||
cuda_value = spec.variants['cuda_arch'].value
|
||||
name = gpu_name_table[cuda_value[0]]
|
||||
options.append(
|
||||
'-DVTKm_CUDA_Architecture={0}'.format(cuda_arch[0]))
|
||||
'-DVTKm_CUDA_Architecture={0}'.format(name))
|
||||
else:
|
||||
# this fix is necessary if compiling platform has cuda, but
|
||||
# no devices (this's common for front end nodes on hpc clus
|
||||
|
Loading…
Reference in New Issue
Block a user