summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Davydov <davydden@gmail.com>2018-10-09 21:07:13 +0200
committerPeter Scheibel <scheibel1@llnl.gov>2018-10-09 12:07:13 -0700
commitab099e9ba341918ade51863abaec4d5abaca5ddc (patch)
treee11f342fc2b6819470a364e82883c571c82e5695
parent5ebdc6076f7031dd3bbde98768e50d931092ce8a (diff)
downloadspack-ab099e9ba341918ade51863abaec4d5abaca5ddc.tar.gz
spack-ab099e9ba341918ade51863abaec4d5abaca5ddc.tar.bz2
spack-ab099e9ba341918ade51863abaec4d5abaca5ddc.tar.xz
spack-ab099e9ba341918ade51863abaec4d5abaca5ddc.zip
trilinos: extend TPetra explicit instantiations and fix missing Teuchos counterparts (#9448)
-rw-r--r--var/spack/repos/builtin/packages/trilinos/package.py63
1 files changed, 41 insertions, 22 deletions
diff --git a/var/spack/repos/builtin/packages/trilinos/package.py b/var/spack/repos/builtin/packages/trilinos/package.py
index 319e4bc977..4efb3b6d29 100644
--- a/var/spack/repos/builtin/packages/trilinos/package.py
+++ b/var/spack/repos/builtin/packages/trilinos/package.py
@@ -77,12 +77,14 @@ class Trilinos(CMakePackage):
description='Build python wrappers')
# Build options
+ variant('complex', default=False,
+ description='Enable complex numbers in Trilinos')
+ variant('explicit_template_instantiation', default=True,
+ description='Enable explicit template instantiation (ETI)')
+ variant('float', default=False,
+ description='Enable single precision (float) numbers in Trilinos')
variant('fortran', default=True,
description='Compile with Fortran support')
- variant('instantiate', default=True,
- description='Compile with explicit instantiation')
- variant('instantiate_cmplx', default=False,
- description='Compile with explicit instantiation for complex')
variant('openmp', default=False,
description='Enable OpenMP')
variant('shared', default=True,
@@ -261,6 +263,14 @@ class Trilinos(CMakePackage):
# For Trilinos v11 we need to force SuperLUDist=OFF, since only the
# deprecated SuperLUDist v3.3 together with an Amesos patch is working.
conflicts('+superlu-dist', when='@11.4.1:11.14.3')
+ # see https://github.com/trilinos/Trilinos/issues/3566
+ conflicts('+superlu-dist', when='+float+amesos2+explicit_template_instantiation^superlu-dist@5.3.0:')
+ # Amesos, conflicting types of double and complex SLU_D
+ # see
+ # https://trilinos.org/pipermail/trilinos-users/2015-March/004731.html
+ # and
+ # https://trilinos.org/pipermail/trilinos-users/2015-March/004802.html
+ conflicts('+superlu-dist', when='+complex+amesos2')
# PnetCDF was only added after v12.10.1
conflicts('+pnetcdf', when='@0:12.10.1')
@@ -581,13 +591,7 @@ class Trilinos(CMakePackage):
])
if '+superlu-dist' in spec:
- # Amesos, conflicting types of double and complex SLU_D
- # see
- # https://trilinos.org/pipermail/trilinos-users/2015-March/004731.html
- # and
- # https://trilinos.org/pipermail/trilinos-users/2015-March/004802.html
options.extend([
- '-DTeuchos_ENABLE_COMPLEX:BOOL=OFF',
'-DKokkosTSQR_ENABLE_Complex:BOOL=OFF'
])
options.extend([
@@ -649,7 +653,7 @@ class Trilinos(CMakePackage):
])
else:
options.extend([
- '-DTPL_ENABLE_GGNS:BOOL=OFF'
+ '-DTPL_ENABLE_CGNS:BOOL=OFF'
])
# ################# Miscellaneous Stuff ######################
@@ -677,19 +681,34 @@ class Trilinos(CMakePackage):
'-DTrilinos_ENABLE_Fortran=ON'
])
- # Explicit instantiation
- if '+instantiate' in spec:
+ float_s = 'ON' if '+float' in spec else 'OFF'
+ complex_s = 'ON' if '+complex' in spec else 'OFF'
+ complex_float_s = 'ON' if ('+complex' in spec and
+ '+float' in spec) else 'OFF'
+ if '+teuchos' in spec:
options.extend([
- '-DTrilinos_ENABLE_EXPLICIT_INSTANTIATION:BOOL=ON'
+ '-DTeuchos_ENABLE_COMPLEX=%s' % complex_s,
+ '-DTeuchos_ENABLE_FLOAT=%s' % float_s
+ ])
+
+ # Explicit Template Instantiation (ETI) in Tpetra
+ # NOTE: Trilinos will soon move to fixed std::uint64_t for GO and
+ # std::int32_t or std::int64_t for local.
+ options.append(
+ '-DTrilinos_ENABLE_EXPLICIT_INSTANTIATION:BOOL=%s' % (
+ 'ON' if '+explicit_template_instantiation' in spec else 'OFF'
+ )
+ )
+
+ if '+explicit_template_instantiation' in spec and '+tpetra' in spec:
+ options.extend([
+ '-DTpetra_INST_DOUBLE:BOOL=ON',
+ '-DTpetra_INST_INT_LONG:BOOL=ON',
+ '-DTpetra_INST_COMPLEX_DOUBLE=%s' % complex_s,
+ '-DTpetra_INST_COMPLEX_FLOAT=%s' % complex_float_s,
+ '-DTpetra_INST_FLOAT=%s' % float_s,
+ '-DTpetra_INST_SERIAL=ON'
])
- if '+tpetra' in spec:
- options.extend([
- '-DTpetra_INST_DOUBLE:BOOL=ON',
- '-DTpetra_INST_INT_LONG:BOOL=ON'
- '-DTpetra_INST_COMPLEX_DOUBLE=%s' % (
- 'ON' if '+instantiate_cmplx' in spec else 'OFF'
- )
- ])
# disable due to compiler / config errors:
if spec.satisfies('%xl') or spec.satisfies('%xl_r'):