Adding OpenMP variant to Trilinos. Also building NetCDF with PNetCDF directly, for Trilinos. (#4687)
* Adding OpenMP variant to Trilinos. Also building NetCDF with PNetCDF in Trilinos when necessary. * Adding runtime error for PNetCDF variant in Trilinos when necessary. Omitting unnecessary openmp variant for Trilinos in Nalu. * Changing variant checks to conflicts statements. * Adding comments to Trilinos package.
This commit is contained in:
parent
bde58a319b
commit
47fe9e7aad
@ -151,6 +151,8 @@ class Trilinos(CMakePackage):
|
|||||||
description='Enable DataTransferKit')
|
description='Enable DataTransferKit')
|
||||||
variant('fortrilinos', default=False,
|
variant('fortrilinos', default=False,
|
||||||
description='Enable ForTrilinos')
|
description='Enable ForTrilinos')
|
||||||
|
variant('openmp', default=False,
|
||||||
|
description='Enable OpenMP')
|
||||||
|
|
||||||
resource(name='dtk',
|
resource(name='dtk',
|
||||||
git='https://github.com/ornl-cees/DataTransferKit',
|
git='https://github.com/ornl-cees/DataTransferKit',
|
||||||
@ -167,6 +169,13 @@ class Trilinos(CMakePackage):
|
|||||||
conflicts('+fortrilinos', when='~fortran')
|
conflicts('+fortrilinos', when='~fortran')
|
||||||
conflicts('+fortrilinos', when='@:99')
|
conflicts('+fortrilinos', when='@:99')
|
||||||
conflicts('+fortrilinos', when='@master')
|
conflicts('+fortrilinos', when='@master')
|
||||||
|
# Can only use one type of SuperLU
|
||||||
|
conflicts('+superlu-dist', when='+superlu')
|
||||||
|
# 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.14.3')
|
||||||
|
# PnetCDF was only added after v12.10.1
|
||||||
|
conflicts('+pnetcdf', when='@:12.10.1')
|
||||||
|
|
||||||
# ###################### Dependencies ##########################
|
# ###################### Dependencies ##########################
|
||||||
|
|
||||||
@ -183,9 +192,9 @@ class Trilinos(CMakePackage):
|
|||||||
|
|
||||||
# MPI related dependencies
|
# MPI related dependencies
|
||||||
depends_on('mpi')
|
depends_on('mpi')
|
||||||
depends_on('netcdf+mpi')
|
depends_on('netcdf+mpi', when="~pnetcdf")
|
||||||
depends_on('parallel-netcdf', when="+pnetcdf@master")
|
depends_on('netcdf+mpi+parallel-netcdf', when="+pnetcdf@master")
|
||||||
depends_on('parallel-netcdf', when="+pnetcdf@12.10.2:")
|
depends_on('netcdf+mpi+parallel-netcdf', when="+pnetcdf@12.10.2:")
|
||||||
depends_on('parmetis', when='+metis')
|
depends_on('parmetis', when='+metis')
|
||||||
# Trilinos' Tribits config system is limited which makes it very tricky to
|
# Trilinos' Tribits config system is limited which makes it very tricky to
|
||||||
# link Amesos with static MUMPS, see
|
# link Amesos with static MUMPS, see
|
||||||
@ -218,23 +227,8 @@ def url_for_version(self, version):
|
|||||||
url = "https://github.com/trilinos/Trilinos/archive/trilinos-release-{0}.tar.gz"
|
url = "https://github.com/trilinos/Trilinos/archive/trilinos-release-{0}.tar.gz"
|
||||||
return url.format(version.dashed)
|
return url.format(version.dashed)
|
||||||
|
|
||||||
# check that the combination of variants makes sense
|
|
||||||
def variants_check(self):
|
|
||||||
if ('+superlu-dist' in self.spec and
|
|
||||||
self.spec.satisfies('@11.14.1:11.14.3')):
|
|
||||||
# For Trilinos v11 we need to force SuperLUDist=OFF, since only the
|
|
||||||
# deprecated SuperLUDist v3.3 together with an Amesos patch is
|
|
||||||
# working.
|
|
||||||
raise RuntimeError('The superlu-dist variant can only be used' +
|
|
||||||
' with Trilinos @12.0.1:')
|
|
||||||
if '+superlu-dist' in self.spec and '+superlu' in self.spec:
|
|
||||||
# Only choose one type of superlu
|
|
||||||
raise RuntimeError('The superlu-dist and superlu variant' +
|
|
||||||
' cannot be used together')
|
|
||||||
|
|
||||||
def cmake_args(self):
|
def cmake_args(self):
|
||||||
spec = self.spec
|
spec = self.spec
|
||||||
self.variants_check()
|
|
||||||
|
|
||||||
cxx_flags = []
|
cxx_flags = []
|
||||||
options = []
|
options = []
|
||||||
@ -346,7 +340,8 @@ def cmake_args(self):
|
|||||||
'-DTrilinos_ENABLE_SEACASEpu:BOOL=ON',
|
'-DTrilinos_ENABLE_SEACASEpu:BOOL=ON',
|
||||||
'-DTrilinos_ENABLE_SEACASExodiff:BOOL=ON',
|
'-DTrilinos_ENABLE_SEACASExodiff:BOOL=ON',
|
||||||
'-DTrilinos_ENABLE_SEACASNemspread:BOOL=ON',
|
'-DTrilinos_ENABLE_SEACASNemspread:BOOL=ON',
|
||||||
'-DTrilinos_ENABLE_SEACASNemslice:BOOL=ON'
|
'-DTrilinos_ENABLE_SEACASNemslice:BOOL=ON',
|
||||||
|
'-DTrilinos_ENABLE_SEACASIoss:BOOL=ON'
|
||||||
])
|
])
|
||||||
else:
|
else:
|
||||||
options.extend([
|
options.extend([
|
||||||
@ -527,6 +522,17 @@ def cmake_args(self):
|
|||||||
|
|
||||||
# ################# Miscellaneous Stuff ######################
|
# ################# Miscellaneous Stuff ######################
|
||||||
|
|
||||||
|
# OpenMP
|
||||||
|
if '+openmp' in spec:
|
||||||
|
options.extend([
|
||||||
|
'-DTrilinos_ENABLE_OpenMP:BOOL=ON',
|
||||||
|
'-DKokkos_ENABLE_OpenMP:BOOL=ON'
|
||||||
|
])
|
||||||
|
if '+tpetra' in spec:
|
||||||
|
options.extend([
|
||||||
|
'-DTpetra_INST_OPENMP:BOOL=ON'
|
||||||
|
])
|
||||||
|
|
||||||
# Fortran lib
|
# Fortran lib
|
||||||
if '+fortran' in spec:
|
if '+fortran' in spec:
|
||||||
if spec.satisfies('%gcc') or spec.satisfies('%clang'):
|
if spec.satisfies('%gcc') or spec.satisfies('%clang'):
|
||||||
|
Loading…
Reference in New Issue
Block a user