trilinos: improve behavior of gotype
(#24565)
* trilinos: add teko conflict * trilinos: improve gotype variant Instead of 'none' and 'long' typically being the same (but not for older trilinos versions), add an explicit 'all' variant that only works for older trilinos which supports multiple simultaneous tpetra instantiations. * trilinos: add self as maintainer * trilinos: disable vendored gtest by default
This commit is contained in:
parent
e6700d47aa
commit
406117148d
@ -5,6 +5,7 @@
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
||||
from spack import *
|
||||
from spack.operating_systems.mac_os import macos_version
|
||||
from spack.pkg.builtin.kokkos import Kokkos
|
||||
@ -29,7 +30,7 @@ class Trilinos(CMakePackage, CudaPackage):
|
||||
url = "https://github.com/trilinos/Trilinos/archive/trilinos-release-12-12-1.tar.gz"
|
||||
git = "https://github.com/trilinos/Trilinos.git"
|
||||
|
||||
maintainers = ['keitat']
|
||||
maintainers = ['keitat', 'sethrj']
|
||||
|
||||
# ###################### Versions ##########################
|
||||
|
||||
@ -70,7 +71,7 @@ class Trilinos(CMakePackage, CudaPackage):
|
||||
variant('float', default=False,
|
||||
description='Enable single precision (float) numbers in Trilinos')
|
||||
variant('gotype', default='long',
|
||||
values=('none', 'int', 'long', 'long_long'),
|
||||
values=('int', 'long', 'long_long', 'all'),
|
||||
multi=False,
|
||||
description='global ordinal type for Tpetra')
|
||||
variant('fortran', default=True,
|
||||
@ -100,7 +101,7 @@ class Trilinos(CMakePackage, CudaPackage):
|
||||
description='Enable ADIOS2')
|
||||
variant('glm', default=True,
|
||||
description='Compile with GLM')
|
||||
variant('gtest', default=True,
|
||||
variant('gtest', default=False,
|
||||
description='Compile with Gtest')
|
||||
variant('hdf5', default=True,
|
||||
description='Compile with HDF5')
|
||||
@ -306,6 +307,7 @@ class Trilinos(CMakePackage, CudaPackage):
|
||||
conflicts('+teko', when='~ml')
|
||||
conflicts('+teko', when='~teuchos')
|
||||
conflicts('+teko', when='~tpetra')
|
||||
conflicts('+teko', when='gotype=long')
|
||||
conflicts('+tempus', when='~nox')
|
||||
conflicts('+tempus', when='~teuchos')
|
||||
conflicts('+tpetra', when='~kokkos')
|
||||
@ -369,12 +371,15 @@ class Trilinos(CMakePackage, CudaPackage):
|
||||
conflicts('+scorec', when='~stk')
|
||||
conflicts('+scorec', when='~zoltan')
|
||||
|
||||
# Multi-value gotype only applies to trilinos through 12.14
|
||||
conflicts('gotype=all', when='@12.15:')
|
||||
|
||||
# All compilers except for pgi are in conflict:
|
||||
for __compiler in spack.compilers.supported_compilers():
|
||||
if __compiler != 'clang':
|
||||
conflicts('+cuda', when='~wrapper %{0}'.format(__compiler),
|
||||
msg='trilinos~wrapper+cuda can only be built with the\
|
||||
Clang compiler')
|
||||
msg='trilinos~wrapper+cuda can only be built with the '
|
||||
'Clang compiler')
|
||||
|
||||
# ###################### Dependencies ##########################
|
||||
|
||||
@ -875,21 +880,13 @@ def define_prefix_enable(prefix, cmake_var, spec_var=None):
|
||||
])
|
||||
|
||||
gotype = spec.variants['gotype'].value
|
||||
# default in older Trilinos versions to enable multiple GOs
|
||||
if ((gotype == 'none') and spec.satisfies('@:12.14.1')):
|
||||
if gotype == 'all':
|
||||
# default in older Trilinos versions to enable multiple GOs
|
||||
options.extend([
|
||||
'-DTpetra_INST_INT_INT:BOOL=ON',
|
||||
'-DTpetra_INST_INT_LONG:BOOL=ON',
|
||||
'-DTpetra_INST_INT_LONG_LONG:BOOL=ON'
|
||||
define('Tpetra_INST_INT_INT', True),
|
||||
define('Tpetra_INST_INT_LONG', True),
|
||||
define('Tpetra_INST_INT_LONG_LONG', True),
|
||||
])
|
||||
# set default GO in newer versions to long
|
||||
elif (gotype == 'none'):
|
||||
options.extend([
|
||||
'-DTpetra_INST_INT_INT:BOOL=OFF',
|
||||
'-DTpetra_INST_INT_LONG:BOOL=ON',
|
||||
'-DTpetra_INST_INT_LONG_LONG:BOOL=OFF'
|
||||
])
|
||||
# if another GO is specified, use this
|
||||
else:
|
||||
options.extend([
|
||||
define('Tpetra_INST_INT_INT', gotype == 'int'),
|
||||
|
Loading…
Reference in New Issue
Block a user