trilinos: explicitly use variants instead of spec for TPLs (#27221)
Fixes https://github.com/spack/spack/pull/27188#issuecomment-961212214
This commit is contained in:
parent
d2c26fef46
commit
42d8e9eeb5
@ -78,8 +78,8 @@ class Trilinos(CMakePackage, CudaPackage):
|
|||||||
variant('wrapper', default=False, description="Use nvcc-wrapper for CUDA build")
|
variant('wrapper', default=False, description="Use nvcc-wrapper for CUDA build")
|
||||||
|
|
||||||
# TPLs (alphabet order)
|
# TPLs (alphabet order)
|
||||||
variant('boost', default=False, description='Compile with Boost')
|
|
||||||
variant('adios2', default=False, description='Enable ADIOS2')
|
variant('adios2', default=False, description='Enable ADIOS2')
|
||||||
|
variant('boost', default=False, description='Compile with Boost')
|
||||||
variant('hdf5', default=False, description='Compile with HDF5')
|
variant('hdf5', default=False, description='Compile with HDF5')
|
||||||
variant('hypre', default=False, description='Compile with Hypre preconditioner')
|
variant('hypre', default=False, description='Compile with Hypre preconditioner')
|
||||||
variant('mpi', default=True, description='Compile with MPI parallelism')
|
variant('mpi', default=True, description='Compile with MPI parallelism')
|
||||||
@ -556,48 +556,57 @@ def define_enable(suffix, value=None):
|
|||||||
|
|
||||||
# ######################### TPLs #############################
|
# ######################### TPLs #############################
|
||||||
|
|
||||||
# Enable TPLs based on whether they're in our spec, not whether they're
|
def define_tpl(trilinos_name, spack_name, have_dep):
|
||||||
# variant names: packages/features should disable availability
|
options.append(define('TPL_ENABLE_' + trilinos_name, have_dep))
|
||||||
tpl_dep_map = [
|
if not have_dep:
|
||||||
|
return
|
||||||
|
depspec = spec[spack_name]
|
||||||
|
libs = depspec.libs
|
||||||
|
options.extend([
|
||||||
|
define(trilinos_name + '_INCLUDE_DIRS', depspec.prefix.include),
|
||||||
|
define(trilinos_name + '_ROOT', depspec.prefix),
|
||||||
|
define(trilinos_name + '_LIBRARY_NAMES', libs.names),
|
||||||
|
define(trilinos_name + '_LIBRARY_DIRS', libs.directories),
|
||||||
|
])
|
||||||
|
|
||||||
|
# Enable these TPLs explicitly from variant options.
|
||||||
|
tpl_variant_map = [
|
||||||
('ADIOS2', 'adios2'),
|
('ADIOS2', 'adios2'),
|
||||||
('BLAS', 'blas'),
|
|
||||||
('Boost', 'boost'),
|
('Boost', 'boost'),
|
||||||
('CGNS', 'cgns'),
|
|
||||||
('CUDA', 'cuda'),
|
('CUDA', 'cuda'),
|
||||||
('HDF5', 'hdf5'),
|
('HDF5', 'hdf5'),
|
||||||
('HYPRE', 'hypre'),
|
('HYPRE', 'hypre'),
|
||||||
|
('MUMPS', 'mumps'),
|
||||||
|
('UMFPACK', 'suite-sparse'),
|
||||||
|
('SuperLU', 'superlu'),
|
||||||
|
('SuperLUDist', 'superlu-dist'),
|
||||||
|
('X11', 'x11'),
|
||||||
|
]
|
||||||
|
if spec.satisfies('@13.0.2:'):
|
||||||
|
tpl_variant_map.append(('STRUMPACK', 'strumpack'))
|
||||||
|
|
||||||
|
for tpl_name, var_name in tpl_variant_map:
|
||||||
|
define_tpl(tpl_name, var_name, spec.variants[var_name].value)
|
||||||
|
|
||||||
|
# Enable these TPLs based on whether they're in our spec; prefer to
|
||||||
|
# require this way so that packages/features disable availability
|
||||||
|
tpl_dep_map = [
|
||||||
|
('BLAS', 'blas'),
|
||||||
|
('CGNS', 'cgns'),
|
||||||
('LAPACK', 'lapack'),
|
('LAPACK', 'lapack'),
|
||||||
('Matio', 'matio'),
|
('Matio', 'matio'),
|
||||||
('METIS', 'metis'),
|
('METIS', 'metis'),
|
||||||
('MUMPS', 'mumps'),
|
|
||||||
('Netcdf', 'netcdf-c'),
|
('Netcdf', 'netcdf-c'),
|
||||||
('SCALAPACK', 'scalapack'),
|
('SCALAPACK', 'scalapack'),
|
||||||
('SuperLU', 'superlu'),
|
|
||||||
('SuperLUDist', 'superlu-dist'),
|
|
||||||
('UMFPACK', 'suite-sparse'),
|
|
||||||
('X11', 'libx11'),
|
|
||||||
('Zlib', 'zlib'),
|
('Zlib', 'zlib'),
|
||||||
]
|
]
|
||||||
if spec.satisfies('@12.12.1:'):
|
if spec.satisfies('@12.12.1:'):
|
||||||
tpl_dep_map.append(('Pnetcdf', 'parallel-netcdf'))
|
tpl_dep_map.append(('Pnetcdf', 'parallel-netcdf'))
|
||||||
if spec.satisfies('@13:'):
|
if spec.satisfies('@13:'):
|
||||||
tpl_dep_map.append(('HWLOC', 'hwloc'))
|
tpl_dep_map.append(('HWLOC', 'hwloc'))
|
||||||
if spec.satisfies('@13.0.2:'):
|
|
||||||
tpl_dep_map.append(('STRUMPACK', 'strumpack'))
|
|
||||||
|
|
||||||
for tpl_name, dep_name in tpl_dep_map:
|
for tpl_name, dep_name in tpl_dep_map:
|
||||||
have_dep = (dep_name in spec)
|
define_tpl(tpl_name, dep_name, dep_name in spec)
|
||||||
options.append(define('TPL_ENABLE_' + tpl_name, have_dep))
|
|
||||||
if not have_dep:
|
|
||||||
continue
|
|
||||||
depspec = spec[dep_name]
|
|
||||||
libs = depspec.libs
|
|
||||||
options.extend([
|
|
||||||
define(tpl_name + '_INCLUDE_DIRS', depspec.prefix.include),
|
|
||||||
define(tpl_name + '_ROOT', depspec.prefix),
|
|
||||||
define(tpl_name + '_LIBRARY_NAMES', libs.names),
|
|
||||||
define(tpl_name + '_LIBRARY_DIRS', libs.directories),
|
|
||||||
])
|
|
||||||
|
|
||||||
# MPI settings
|
# MPI settings
|
||||||
options.append(define_tpl_enable('MPI'))
|
options.append(define_tpl_enable('MPI'))
|
||||||
|
Loading…
Reference in New Issue
Block a user