Add and propagate CUDA variants for DAV SDK (#26476)

This commit is contained in:
kwryankrattiger 2021-11-02 16:31:50 -05:00 committed by GitHub
parent c9f8dd93f3
commit f1afd5ff27
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -6,7 +6,7 @@
from spack import * from spack import *
class EcpDataVisSdk(BundlePackage): class EcpDataVisSdk(BundlePackage, CudaPackage):
"""ECP Data & Vis SDK""" """ECP Data & Vis SDK"""
homepage = "https://github.com/chuckatkins/ecp-data-viz-sdk" homepage = "https://github.com/chuckatkins/ecp-data-viz-sdk"
@ -67,16 +67,29 @@ def dav_sdk_depends_on(spec, when=None, propagate=None):
if when: if when:
base_variant = when base_variant = when
def is_boolean(variant):
return '=' not in variant
# Propagate variants to dependecy # Propagate variants to dependecy
for v_when, v_then in propagate.items(): for v_when, v_then in propagate.items():
depends_on('{0} +{1}'.format(spec, v_then), if is_boolean(v_when):
when='{0} +{1}'.format(base_variant, v_when)) depends_on('{0} +{1}'.format(spec, v_then),
depends_on('{0} ~{1}'.format(spec, v_then), when='{0} +{1}'.format(base_variant, v_when))
when='{0} ~{1}'.format(base_variant, v_when)) depends_on('{0} ~{1}'.format(spec, v_then),
when='{0} ~{1}'.format(base_variant, v_when))
else:
depends_on('{0} {1}'.format(spec, v_then),
when='{0} {1}'.format(base_variant, v_when))
def exclude_variants(variants, exclude):
return [variant for variant in variants if variant not in exclude]
############################################################ ############################################################
# Dependencies # Dependencies
############################################################ ############################################################
cuda_arch_variants = ['cuda_arch={0}'.format(x)
for x in CudaPackage.cuda_arch_values]
dav_sdk_depends_on('adios2+shared+mpi+fortran+python+blosc+sst+ssc+dataman', dav_sdk_depends_on('adios2+shared+mpi+fortran+python+blosc+sst+ssc+dataman',
when='+adios2', when='+adios2',
propagate=['hdf5', 'sz', 'zfp']) propagate=['hdf5', 'sz', 'zfp'])
@ -98,18 +111,27 @@ def dav_sdk_depends_on(spec, when=None, propagate=None):
dav_sdk_depends_on('ascent+shared+mpi+fortran+openmp+python+vtkh+dray', dav_sdk_depends_on('ascent+shared+mpi+fortran+openmp+python+vtkh+dray',
when='+ascent') when='+ascent')
dav_sdk_depends_on('catalyst', when='+catalyst') dav_sdk_depends_on('catalyst', when='+catalyst')
depends_on('py-cinemasci', when='+cinema') depends_on('py-cinemasci', when='+cinema')
# +adios2 is not yet enabled in the paraview package # +adios2 is not yet enabled in the paraview package
dav_sdk_depends_on('paraview+shared+mpi+python3+kits', paraview_base_spec = 'paraview+mpi+python3+kits'
when='+paraview', # Want +shared when not using cuda
dav_sdk_depends_on(paraview_base_spec + '+shared ~cuda',
when='+paraview ~cuda',
propagate=['hdf5']) propagate=['hdf5'])
# Can't have +shared when using cuda, propagate cuda_arch_variants
dav_sdk_depends_on(paraview_base_spec + '~shared +cuda',
when='+paraview +cuda',
propagate=cuda_arch_variants)
dav_sdk_depends_on('visit', when='+visit') dav_sdk_depends_on('visit', when='+visit')
dav_sdk_depends_on('vtk-m+shared+mpi+openmp+rendering', when='+vtkm') dav_sdk_depends_on('vtk-m+shared+mpi+openmp+rendering',
when='+vtkm',
propagate=['cuda'] + cuda_arch_variants)
# +python is currently broken in sz # +python is currently broken in sz
# dav_sdk_depends_on('sz+shared+fortran+python+random_access', # dav_sdk_depends_on('sz+shared+fortran+python+random_access',
@ -117,4 +139,6 @@ def dav_sdk_depends_on(spec, when=None, propagate=None):
when='+sz', when='+sz',
propagate=['hdf5']) propagate=['hdf5'])
dav_sdk_depends_on('zfp', when='+zfp') dav_sdk_depends_on('zfp',
when='+zfp',
propagate=['cuda'] + cuda_arch_variants)