add variants
This commit is contained in:
parent
df995c4ef8
commit
0fc9326a4c
@ -22,8 +22,15 @@ class Trilinos(Package):
|
|||||||
version('11.14.2', 'a43590cf896c677890d75bfe75bc6254')
|
version('11.14.2', 'a43590cf896c677890d75bfe75bc6254')
|
||||||
version('11.14.1', '40febc57f76668be8b6a77b7607bb67f')
|
version('11.14.1', '40febc57f76668be8b6a77b7607bb67f')
|
||||||
|
|
||||||
variant('shared', default=True, description='Enables the build of shared libraries')
|
variant('metis', default=True, description='Compile with METIS')
|
||||||
variant('debug', default=False, description='Builds a debug version of the libraries')
|
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')
|
||||||
|
|
||||||
# Everything should be compiled with -fpic
|
# Everything should be compiled with -fpic
|
||||||
depends_on('blas')
|
depends_on('blas')
|
||||||
@ -49,7 +56,23 @@ class Trilinos(Package):
|
|||||||
|
|
||||||
patch('umfpack_from_suitesparse.patch')
|
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):
|
def install(self, spec, prefix):
|
||||||
|
self.variants_check()
|
||||||
|
|
||||||
options = []
|
options = []
|
||||||
options.extend(std_cmake_args)
|
options.extend(std_cmake_args)
|
||||||
|
|
||||||
@ -93,35 +116,38 @@ def install(self, spec, prefix):
|
|||||||
# ])
|
# ])
|
||||||
|
|
||||||
# suite-sparse related
|
# suite-sparse related
|
||||||
options.extend([
|
if '+suite-sparse' in spec:
|
||||||
'-DTPL_ENABLE_Cholmod:BOOL=OFF', # FIXME: Trilinos seems to be looking for static libs only, patch CMake TPL file?
|
options.extend([
|
||||||
#'-DTPL_ENABLE_Cholmod:BOOL=ON',
|
'-DTPL_ENABLE_Cholmod:BOOL=OFF', # FIXME: Trilinos seems to be looking for static libs only, patch CMake TPL file?
|
||||||
#'-DCholmod_LIBRARY_DIRS:PATH=%s' % spec['suite-sparse'].prefix.lib,
|
#'-DTPL_ENABLE_Cholmod:BOOL=ON',
|
||||||
#'-DCholmod_INCLUDE_DIRS:PATH=%s' % spec['suite-sparse'].prefix.include,
|
#'-DCholmod_LIBRARY_DIRS:PATH=%s' % spec['suite-sparse'].prefix.lib,
|
||||||
'-DTPL_ENABLE_UMFPACK:BOOL=ON',
|
#'-DCholmod_INCLUDE_DIRS:PATH=%s' % spec['suite-sparse'].prefix.include,
|
||||||
'-DUMFPACK_LIBRARY_DIRS:PATH=%s' % spec['suite-sparse'].prefix.lib,
|
'-DTPL_ENABLE_UMFPACK:BOOL=ON',
|
||||||
'-DUMFPACK_INCLUDE_DIRS:PATH=%s' % spec['suite-sparse'].prefix.include,
|
'-DUMFPACK_LIBRARY_DIRS:PATH=%s' % spec['suite-sparse'].prefix.lib,
|
||||||
'-DUMFPACK_LIBRARY_NAMES=umfpack;amd;colamd;cholmod;suitesparseconfig'
|
'-DUMFPACK_INCLUDE_DIRS:PATH=%s' % spec['suite-sparse'].prefix.include,
|
||||||
])
|
'-DUMFPACK_LIBRARY_NAMES=umfpack;amd;colamd;cholmod;suitesparseconfig'
|
||||||
|
])
|
||||||
|
|
||||||
# metis / parmetis
|
# metis / parmetis
|
||||||
options.extend([
|
if '+parmetis' in spec: # metis is required, see variants_check()
|
||||||
'-DTPL_ENABLE_METIS:BOOL=ON',
|
options.extend([
|
||||||
'-DMETIS_LIBRARY_DIRS=%s' % spec['metis'].prefix.lib,
|
'-DTPL_ENABLE_METIS:BOOL=ON',
|
||||||
'-DMETIS_LIBRARY_NAMES=metis',
|
'-DMETIS_LIBRARY_DIRS=%s' % spec['metis'].prefix.lib,
|
||||||
'-DTPL_METIS_INCLUDE_DIRS=%s' % spec['metis'].prefix.include,
|
'-DMETIS_LIBRARY_NAMES=metis',
|
||||||
'-DTPL_ENABLE_ParMETIS:BOOL=ON',
|
'-DTPL_METIS_INCLUDE_DIRS=%s' % spec['metis'].prefix.include,
|
||||||
'-DParMETIS_LIBRARY_DIRS=%s;%s' % (spec['parmetis'].prefix.lib,spec['metis'].prefix.lib),
|
'-DTPL_ENABLE_ParMETIS:BOOL=ON',
|
||||||
'-DParMETIS_LIBRARY_NAMES=parmetis;metis',
|
'-DParMETIS_LIBRARY_DIRS=%s;%s' % (spec['parmetis'].prefix.lib,spec['metis'].prefix.lib),
|
||||||
'-DTPL_ParMETIS_INCLUDE_DIRS=%s' % spec['parmetis'].prefix.include
|
'-DParMETIS_LIBRARY_NAMES=parmetis;metis',
|
||||||
])
|
'-DTPL_ParMETIS_INCLUDE_DIRS=%s' % spec['parmetis'].prefix.include
|
||||||
|
])
|
||||||
|
|
||||||
# mumps
|
# mumps
|
||||||
options.extend([
|
if '+mumps' in spec:
|
||||||
'-DTPL_ENABLE_MUMPS:BOOL=ON',
|
options.extend([
|
||||||
'-DMUMPS_LIBRARY_DIRS=%s' % spec['mumps'].prefix.lib,
|
'-DTPL_ENABLE_MUMPS:BOOL=ON',
|
||||||
'-DMUMPS_LIBRARY_NAMES=dmumps;mumps_common;pord' # order is important!
|
'-DMUMPS_LIBRARY_DIRS=%s' % spec['mumps'].prefix.lib,
|
||||||
])
|
'-DMUMPS_LIBRARY_NAMES=dmumps;mumps_common;pord' # order is important!
|
||||||
|
])
|
||||||
|
|
||||||
# scalapack
|
# scalapack
|
||||||
options.extend([
|
options.extend([
|
||||||
@ -129,23 +155,24 @@ def install(self, spec, prefix):
|
|||||||
#'-DSCALAPACK_LIBRARY_NAMES=scalapack' # FIXME: for MKL it's mkl_scalapack_lp64;mkl_blacs_mpich_lp64
|
#'-DSCALAPACK_LIBRARY_NAMES=scalapack' # FIXME: for MKL it's mkl_scalapack_lp64;mkl_blacs_mpich_lp64
|
||||||
])
|
])
|
||||||
|
|
||||||
# superlu_dist:
|
# superlu-dist:
|
||||||
# Amesos, conflicting types of double and complex SLU_D
|
if '+superlu-dist' in spec:
|
||||||
# see https://trilinos.org/pipermail/trilinos-users/2015-March/004731.html
|
# Amesos, conflicting types of double and complex SLU_D
|
||||||
# and https://trilinos.org/pipermail/trilinos-users/2015-March/004802.html
|
# see https://trilinos.org/pipermail/trilinos-users/2015-March/004731.html
|
||||||
options.extend([
|
# and https://trilinos.org/pipermail/trilinos-users/2015-March/004802.html
|
||||||
'-DTeuchos_ENABLE_COMPLEX:BOOL=OFF',
|
|
||||||
'-DKokkosTSQR_ENABLE_Complex:BOOL=OFF'
|
|
||||||
])
|
|
||||||
options.extend([
|
|
||||||
'-DTPL_ENABLE_SuperLUDist:BOOL=ON',
|
|
||||||
'-DSuperLUDist_LIBRARY_DIRS=%s' % spec['superlu-dist'].prefix.lib,
|
|
||||||
'-DSuperLUDist_INCLUDE_DIRS=%s/superlu_dist' % spec['superlu-dist'].prefix.include # superlu_dist and superlu have the same header names :-( In order to avoid conflicts, try to keep "dist" version headers in a subfolder
|
|
||||||
])
|
|
||||||
if spec.satisfies('^superlu-dist@4.0:'):
|
|
||||||
options.extend([
|
options.extend([
|
||||||
'-DHAVE_SUPERLUDIST_LUSTRUCTINIT_2ARG:BOOL=ON'
|
'-DTeuchos_ENABLE_COMPLEX:BOOL=OFF',
|
||||||
|
'-DKokkosTSQR_ENABLE_Complex:BOOL=OFF'
|
||||||
])
|
])
|
||||||
|
options.extend([
|
||||||
|
'-DTPL_ENABLE_SuperLUDist:BOOL=ON',
|
||||||
|
'-DSuperLUDist_LIBRARY_DIRS=%s' % spec['superlu-dist'].prefix.lib,
|
||||||
|
'-DSuperLUDist_INCLUDE_DIRS=%s/superlu_dist' % spec['superlu-dist'].prefix.include # superlu_dist and superlu have the same header names :-( In order to avoid conflicts, try to keep "dist" version headers in a subfolder
|
||||||
|
])
|
||||||
|
if spec.satisfies('^superlu-dist@4.0:'):
|
||||||
|
options.extend([
|
||||||
|
'-DHAVE_SUPERLUDIST_LUSTRUCTINIT_2ARG:BOOL=ON'
|
||||||
|
])
|
||||||
|
|
||||||
# disable due to compiler / config errors:
|
# disable due to compiler / config errors:
|
||||||
options.extend([
|
options.extend([
|
||||||
|
Loading…
Reference in New Issue
Block a user