Jthies/xsdk add phist (#8980)
* packages/phist: add variant 'fortran' to enable/disable building the Fortran bindings * xsdk: add phist * packages/xsdk: add a comment reg. updating phist dependency * packages/phist: +fortran variant is only for versions 1.7: * packages/phist: update comments * xsdk: forgot to specify kernel library for phist (picked tpetra, assuming trilinos+tpetra will be installed) * packages/phist: add variant 'openmp' to allow disabling OpenMP * phist: fix compile error due to missing -lm * flake8: fix warnings * packages/phist: fix cmake flag: XSDK_ENABLE_Fortran (rather than XSDK_BUILD_Fortran) * packages/phist: allow disabling building the scamac matrix generator (which causes trouble on some systems) * packages/xsdk: disable scamac within phist because it caused problems for @balay and is not essential for now * packages/phist: actually disable scamac via cmake if ~scamac * phist: disable openmp from xsdk
This commit is contained in:
parent
930d6af815
commit
38a1732c5a
@ -38,6 +38,7 @@ class Phist(CMakePackage):
|
|||||||
'petsc',
|
'petsc',
|
||||||
'eigen',
|
'eigen',
|
||||||
'ghost'])
|
'ghost'])
|
||||||
|
|
||||||
variant(name='outlev', default='2', values=['0', '1', '2', '3', '4', '5'],
|
variant(name='outlev', default='2', values=['0', '1', '2', '3', '4', '5'],
|
||||||
description='verbosity. 0: errors 1: +warnings 2: +info '
|
description='verbosity. 0: errors 1: +warnings 2: +info '
|
||||||
'3: +verbose 4: +extreme 5; +debug')
|
'3: +verbose 4: +extreme 5; +debug')
|
||||||
@ -48,9 +49,18 @@ class Phist(CMakePackage):
|
|||||||
variant('mpi', default=True,
|
variant('mpi', default=True,
|
||||||
description='enable/disable MPI (note that the kernel library may '
|
description='enable/disable MPI (note that the kernel library may '
|
||||||
'not support this choice)')
|
'not support this choice)')
|
||||||
|
|
||||||
|
variant('openmp', default=True,
|
||||||
|
description='enable/disable OpenMP')
|
||||||
|
|
||||||
variant('parmetis', default=False,
|
variant('parmetis', default=False,
|
||||||
description='enable/disable ParMETIS partitioning (only actually '
|
description='enable/disable ParMETIS partitioning (only actually '
|
||||||
'used with kernel_lib=builtin)')
|
'used with kernel_lib=builtin)')
|
||||||
|
|
||||||
|
variant('scamac', default=True,
|
||||||
|
description='enable/disable building the "SCAlable MAtrix '
|
||||||
|
'Collection" matrix generators.')
|
||||||
|
|
||||||
variant('trilinos', default=False,
|
variant('trilinos', default=False,
|
||||||
description='enable/disable Trilinos third-party libraries. '
|
description='enable/disable Trilinos third-party libraries. '
|
||||||
'For all kernel_libs, we can use Belos and Anasazi '
|
'For all kernel_libs, we can use Belos and Anasazi '
|
||||||
@ -58,12 +68,19 @@ class Phist(CMakePackage):
|
|||||||
'(kernel_lib=epetra|tpetra) we can use preconditioner '
|
'(kernel_lib=epetra|tpetra) we can use preconditioner '
|
||||||
'packages such as Ifpack, Ifpack2 and ML.')
|
'packages such as Ifpack, Ifpack2 and ML.')
|
||||||
|
|
||||||
|
variant('fortran', default=True,
|
||||||
|
description='generate Fortran 2003 bindings (requires Python3 and '
|
||||||
|
'a Fortran compiler)')
|
||||||
|
|
||||||
# ###################### Dependencies ##########################
|
# ###################### Dependencies ##########################
|
||||||
|
|
||||||
depends_on('cmake@3.8:', type='build')
|
depends_on('cmake@3.8:', type='build')
|
||||||
depends_on('blas')
|
depends_on('blas')
|
||||||
depends_on('lapack')
|
depends_on('lapack')
|
||||||
depends_on('python@3:', when='@1.7:', type='build')
|
# Python 3 or later is required for generating the Fortran 2003 bindings
|
||||||
|
# since version 1.7, you can get rid of the dependency by switching off
|
||||||
|
# the feature (e.g. use the '~fortran' variant)
|
||||||
|
depends_on('python@3:', when='@1.7: +fortran', type='build')
|
||||||
depends_on('mpi', when='+mpi')
|
depends_on('mpi', when='+mpi')
|
||||||
depends_on('trilinos+anasazi+belos+teuchos', when='+trilinos')
|
depends_on('trilinos+anasazi+belos+teuchos', when='+trilinos')
|
||||||
depends_on('trilinos@12:+tpetra', when='kernel_lib=tpetra')
|
depends_on('trilinos@12:+tpetra', when='kernel_lib=tpetra')
|
||||||
@ -76,14 +93,18 @@ class Phist(CMakePackage):
|
|||||||
depends_on('trilinos', when='+trilinos')
|
depends_on('trilinos', when='+trilinos')
|
||||||
depends_on('parmetis ^metis+int64', when='+parmetis')
|
depends_on('parmetis ^metis+int64', when='+parmetis')
|
||||||
|
|
||||||
|
# Fortran 2003 bindings were included in version 1.7, previously they
|
||||||
|
# required a separate package
|
||||||
|
conflicts('+fortran', when='@:1.6.99')
|
||||||
|
|
||||||
def cmake_args(self):
|
def cmake_args(self):
|
||||||
spec = self.spec
|
spec = self.spec
|
||||||
|
|
||||||
kernel_lib = spec.variants['kernel_lib'].value
|
kernel_lib = spec.variants['kernel_lib'].value
|
||||||
outlev = spec.variants['outlev'].value
|
outlev = spec.variants['outlev'].value
|
||||||
|
|
||||||
lapacke_libs = \
|
lapacke_libs = (spec['lapack:c'].libs + spec['blas:c'].libs +
|
||||||
(spec['lapack:c'].libs + spec['blas:c'].libs).joined(';')
|
find_system_libraries(['libm'])).joined(';')
|
||||||
lapacke_include_dir = spec['lapack:c'].headers.directories[0]
|
lapacke_include_dir = spec['lapack:c'].headers.directories[0]
|
||||||
|
|
||||||
args = ['-DPHIST_KERNEL_LIB=%s' % kernel_lib,
|
args = ['-DPHIST_KERNEL_LIB=%s' % kernel_lib,
|
||||||
@ -92,14 +113,20 @@ def cmake_args(self):
|
|||||||
'-DTPL_LAPACKE_INCLUDE_DIRS=%s' % lapacke_include_dir,
|
'-DTPL_LAPACKE_INCLUDE_DIRS=%s' % lapacke_include_dir,
|
||||||
'-DPHIST_ENABLE_MPI:BOOL=%s'
|
'-DPHIST_ENABLE_MPI:BOOL=%s'
|
||||||
% ('ON' if '+mpi' in spec else 'OFF'),
|
% ('ON' if '+mpi' in spec else 'OFF'),
|
||||||
|
'-DPHIST_ENABLE_OPENMP=%s'
|
||||||
|
% ('ON' if '+openmp' in spec else 'OFF'),
|
||||||
'-DBUILD_SHARED_LIBS:BOOL=%s'
|
'-DBUILD_SHARED_LIBS:BOOL=%s'
|
||||||
% ('ON' if '+shared' in spec else 'OFF'),
|
% ('ON' if '+shared' in spec else 'OFF'),
|
||||||
|
'-DPHIST_ENABLE_SCAMAC:BOOL=%s'
|
||||||
|
% ('ON' if '+scamac' in spec else 'OFF'),
|
||||||
'-DPHIST_USE_TRILINOS_TPLS:BOOL=%s'
|
'-DPHIST_USE_TRILINOS_TPLS:BOOL=%s'
|
||||||
% ('ON' if '+trilinos' in spec else 'OFF'),
|
% ('ON' if '+trilinos' in spec else 'OFF'),
|
||||||
'-DPHIST_USE_SOLVER_TPLS:BOOL=%s'
|
'-DPHIST_USE_SOLVER_TPLS:BOOL=%s'
|
||||||
% ('ON' if '+trilinos' in spec else 'OFF'),
|
% ('ON' if '+trilinos' in spec else 'OFF'),
|
||||||
'-DPHIST_USE_PRECON_TPLS:BOOL=%s'
|
'-DPHIST_USE_PRECON_TPLS:BOOL=%s'
|
||||||
% ('ON' if '+trilinos' in spec else 'OFF'),
|
% ('ON' if '+trilinos' in spec else 'OFF'),
|
||||||
|
'-DXSDK_ENABLE_Fortran:BOOL=%s'
|
||||||
|
% ('ON' if '+fortran' in spec else 'OFF'),
|
||||||
]
|
]
|
||||||
|
|
||||||
return args
|
return args
|
||||||
|
@ -75,6 +75,13 @@ class Xsdk(Package):
|
|||||||
|
|
||||||
depends_on('slepc@develop', when='@develop')
|
depends_on('slepc@develop', when='@develop')
|
||||||
|
|
||||||
|
# the Fortran 2003 bindings of phist require python@3:, but this
|
||||||
|
# creates a conflict with other packages like petsc@develop. Actually
|
||||||
|
# these are type='build' dependencies, but spack reports a conflict anyway.
|
||||||
|
# This will be fixed once the new concretizer becomes available
|
||||||
|
# (says @adamjsteward)
|
||||||
|
depends_on('phist@develop kernel_lib=tpetra ~fortran ~scamac ~openmp', when='@develop')
|
||||||
|
|
||||||
# xSDKTrilinos depends on the version of Trilinos built with
|
# xSDKTrilinos depends on the version of Trilinos built with
|
||||||
# +tpetra which is turned off for faster xSDK
|
# +tpetra which is turned off for faster xSDK
|
||||||
# depends_on('xsdktrilinos@xsdk-0.2.0', when='@xsdk-0.2.0')
|
# depends_on('xsdktrilinos@xsdk-0.2.0', when='@xsdk-0.2.0')
|
||||||
|
Loading…
Reference in New Issue
Block a user