Trilinos: Add more variants (~netcdf ~matio ~glm) (#15483)

* Trilinos: Add more variants

+ Provide three new variants to allow building trilinos without netcdf, matio,
  or glm.
+ No change to defaults.

* Fix style issue.
This commit is contained in:
Kelly (KT) Thompson 2020-03-18 16:05:51 -06:00 committed by GitHub
parent 432bdeee85
commit 1bcc80ec5d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -86,18 +86,24 @@ class Trilinos(CMakePackage):
description='Compile with Boost') description='Compile with Boost')
variant('cgns', default=False, variant('cgns', default=False,
description='Enable CGNS') description='Enable CGNS')
variant('adios2', default=False, variant('adios2', default=False,
description='Enable ADIOS2') description='Enable ADIOS2')
variant('glm', default=True,
description='Compile with GLM')
variant('gtest', default=True, variant('gtest', default=True,
description='Compile with Gtest') description='Compile with Gtest')
variant('hdf5', default=True, variant('hdf5', default=True,
description='Compile with HDF5') description='Compile with HDF5')
variant('hypre', default=True, variant('hypre', default=True,
description='Compile with Hypre preconditioner') description='Compile with Hypre preconditioner')
variant('matio', default=True,
description='Compile with Matio')
variant('metis', default=True, variant('metis', default=True,
description='Compile with METIS and ParMETIS') description='Compile with METIS and ParMETIS')
variant('mumps', default=True, variant('mumps', default=True,
description='Compile with support for MUMPS solvers') description='Compile with support for MUMPS solvers')
variant('netcdf', default=True,
description='Compile with netcdf')
variant('pnetcdf', default=False, variant('pnetcdf', default=False,
description='Compile with parallel-netcdf') description='Compile with parallel-netcdf')
variant('suite-sparse', default=True, variant('suite-sparse', default=True,
@ -312,6 +318,8 @@ class Trilinos(CMakePackage):
# ADIOS2 was only added after v12.14.1 # ADIOS2 was only added after v12.14.1
conflicts('+adios2', when='@:12.14.1') conflicts('+adios2', when='@:12.14.1')
conflicts('+adios2', when='@xsdk-0.2.0') conflicts('+adios2', when='@xsdk-0.2.0')
conflicts('+pnetcdf', when='~netcdf')
# ###################### Dependencies ########################## # ###################### Dependencies ##########################
# Everything should be compiled position independent (-fpic) # Everything should be compiled position independent (-fpic)
@ -319,17 +327,17 @@ class Trilinos(CMakePackage):
depends_on('lapack') depends_on('lapack')
depends_on('boost', when='+boost') depends_on('boost', when='+boost')
depends_on('boost', when='+dtk') depends_on('boost', when='+dtk')
depends_on('matio') depends_on('matio', when='+matio')
depends_on('glm') depends_on('glm', when='+glm')
depends_on('metis@5:', when='+metis') depends_on('metis@5:', when='+metis')
depends_on('suite-sparse', when='+suite-sparse') depends_on('suite-sparse', when='+suite-sparse')
depends_on('zlib', when="+zlib") depends_on('zlib', when="+zlib")
# MPI related dependencies # MPI related dependencies
depends_on('mpi') depends_on('mpi')
depends_on('netcdf-c+mpi', when="~pnetcdf") depends_on('netcdf-c+mpi', when="+netcdf~pnetcdf")
depends_on('netcdf-c+mpi+parallel-netcdf', when="+pnetcdf@master,12.12.1:") depends_on('netcdf-c+mpi+parallel-netcdf', when="+netcdf+pnetcdf@master,12.12.1:")
depends_on('parallel-netcdf', when="+pnetcdf@master,12.12.1:") depends_on('parallel-netcdf', when="+netcdf+pnetcdf@master,12.12.1:")
depends_on('parmetis', when='+metis') depends_on('parmetis', when='+metis')
depends_on('cgns', when='+cgns') depends_on('cgns', when='+cgns')
depends_on('adios2', when='+adios2') depends_on('adios2', when='+adios2')
@ -537,14 +545,23 @@ def cmake_args(self):
'-DTPL_ENABLE_LAPACK=ON', '-DTPL_ENABLE_LAPACK=ON',
'-DLAPACK_LIBRARY_NAMES=%s' % ';'.join(lapack.names), '-DLAPACK_LIBRARY_NAMES=%s' % ';'.join(lapack.names),
'-DLAPACK_LIBRARY_DIRS=%s' % ';'.join(lapack.directories), '-DLAPACK_LIBRARY_DIRS=%s' % ';'.join(lapack.directories),
'-DTPL_ENABLE_Netcdf:BOOL=ON', '-DTPL_ENABLE_GLM:BOOL=%s' % ('ON' if '+glm' in spec else 'OFF'),
'-DNetCDF_ROOT:PATH=%s' % spec['netcdf-c'].prefix, '-DTPL_ENABLE_Matio:BOOL=%s' % (
'ON' if '+matio' in spec else 'OFF'),
'-DTPL_ENABLE_X11:BOOL=%s' % ( '-DTPL_ENABLE_X11:BOOL=%s' % (
'ON' if '+x11' in spec else 'OFF'), 'ON' if '+x11' in spec else 'OFF'),
'-DTrilinos_ENABLE_Gtest:BOOL=%s' % ( '-DTrilinos_ENABLE_Gtest:BOOL=%s' % (
'ON' if '+gtest' in spec else 'OFF'), 'ON' if '+gtest' in spec else 'OFF'),
]) ])
if '+netcdf' in spec:
options.extend([
'-DTPL_ENABLE_Netcdf:BOOL=ON',
'-DNetCDF_ROOT:PATH=%s' % spec['netcdf-c'].prefix
])
else:
options.extend(['-DTPL_ENABLE_Netcdf:BOOL=OFF'])
if '+hypre' in spec: if '+hypre' in spec:
options.extend([ options.extend([
'-DTPL_ENABLE_HYPRE:BOOL=ON', '-DTPL_ENABLE_HYPRE:BOOL=ON',