add variants
This commit is contained in:
parent
df995c4ef8
commit
0fc9326a4c
@ -22,6 +22,13 @@ class Trilinos(Package):
|
||||
version('11.14.2', 'a43590cf896c677890d75bfe75bc6254')
|
||||
version('11.14.1', '40febc57f76668be8b6a77b7607bb67f')
|
||||
|
||||
variant('metis', default=True, description='Compile with METIS')
|
||||
variant('parmetis', default=True, description='Compile with ParMETIS')
|
||||
variant('mumps', default=True, description='Compile with support for MUMPS solvers')
|
||||
variant('superlu-dist', default=True, description='Compile with SuperluDist solvers')
|
||||
variant('hypre', default=True, description='Compile with Hypre preconditioner')
|
||||
variant('hdf5', default=True, description='Compile with HDF5')
|
||||
variant('suite-sparse', default=True, description='Compile with SuiteSparse solvers')
|
||||
variant('shared', default=True, description='Enables the build of shared libraries')
|
||||
variant('debug', default=False, description='Builds a debug version of the libraries')
|
||||
|
||||
@ -49,7 +56,23 @@ class Trilinos(Package):
|
||||
|
||||
patch('umfpack_from_suitesparse.patch')
|
||||
|
||||
# check that the combination of variants makes sense
|
||||
def variants_check(self):
|
||||
if '+parmetis' in self.spec and '+metis' not in self.spec:
|
||||
raise RuntimeError('You cannot use the variant parmetis without metis')
|
||||
|
||||
if '+mumps' in self.spec and '+parmetis' not in self.spec:
|
||||
raise RuntimeError('You cannot use the variant mumps without parmetis')
|
||||
|
||||
if '+superlu-dist' in self.spec and self.spec.satisfies('@:11.4.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:')
|
||||
|
||||
def install(self, spec, prefix):
|
||||
self.variants_check()
|
||||
|
||||
options = []
|
||||
options.extend(std_cmake_args)
|
||||
|
||||
@ -93,6 +116,7 @@ def install(self, spec, prefix):
|
||||
# ])
|
||||
|
||||
# suite-sparse related
|
||||
if '+suite-sparse' in spec:
|
||||
options.extend([
|
||||
'-DTPL_ENABLE_Cholmod:BOOL=OFF', # FIXME: Trilinos seems to be looking for static libs only, patch CMake TPL file?
|
||||
#'-DTPL_ENABLE_Cholmod:BOOL=ON',
|
||||
@ -105,6 +129,7 @@ def install(self, spec, prefix):
|
||||
])
|
||||
|
||||
# metis / parmetis
|
||||
if '+parmetis' in spec: # metis is required, see variants_check()
|
||||
options.extend([
|
||||
'-DTPL_ENABLE_METIS:BOOL=ON',
|
||||
'-DMETIS_LIBRARY_DIRS=%s' % spec['metis'].prefix.lib,
|
||||
@ -117,6 +142,7 @@ def install(self, spec, prefix):
|
||||
])
|
||||
|
||||
# mumps
|
||||
if '+mumps' in spec:
|
||||
options.extend([
|
||||
'-DTPL_ENABLE_MUMPS:BOOL=ON',
|
||||
'-DMUMPS_LIBRARY_DIRS=%s' % spec['mumps'].prefix.lib,
|
||||
@ -129,7 +155,8 @@ def install(self, spec, prefix):
|
||||
#'-DSCALAPACK_LIBRARY_NAMES=scalapack' # FIXME: for MKL it's mkl_scalapack_lp64;mkl_blacs_mpich_lp64
|
||||
])
|
||||
|
||||
# superlu_dist:
|
||||
# superlu-dist:
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user