Add a dune-testtools resource to the package
This commit is contained in:
@ -73,6 +73,7 @@ class Dune(CMakePackage):
|
||||
variant('istl', default=True, description='Build with dune-istl module')
|
||||
variant('localfunctions', default=True, description='Build with dune-localfunctions module')
|
||||
variant('spgrid', default=False, description='Build with dune-spgrid module')
|
||||
variant('testtools', default=False, description='Build with dune-testtools module')
|
||||
variant('typetree', default=False, description='Build with dune-typetree module')
|
||||
variant('uggrid', default=False, description='Build with dune-uggrid module')
|
||||
|
||||
@ -145,6 +146,13 @@ class Dune(CMakePackage):
|
||||
when='@%s+spgrid' % vers,
|
||||
)
|
||||
|
||||
resource(
|
||||
name='dune-testtools',
|
||||
git='https://gitlab.dune-project.org/quality/dune-testtools.git',
|
||||
branch=branch,
|
||||
when='@%s+testtools' % vers,
|
||||
)
|
||||
|
||||
resource(
|
||||
name='dune-python',
|
||||
git='https://gitlab.dune-project.org/staging/dune-python.git',
|
||||
@ -153,16 +161,18 @@ class Dune(CMakePackage):
|
||||
)
|
||||
|
||||
# Dependencies between modules
|
||||
module_dependencies={"dune-common":[]}
|
||||
module_dependencies["dune-geometry"]=["dune-common"]
|
||||
module_dependencies["dune-grid"]=["dune-common","dune-geometry"]
|
||||
module_dependencies["dune-uggrid"]=["dune-common"]
|
||||
module_dependencies["dune-istl"]=["dune-common"]
|
||||
module_dependencies["dune-localfunctions"]=["dune-common","dune-geometry"]
|
||||
module_dependencies["dune-functions"]=["dune-grid","dune-typetree","dune-localfunctions","dune-istl"]
|
||||
module_dependencies["dune-typetree"]=["dune-common"]
|
||||
module_dependencies["dune-python"]=[]
|
||||
module_dependencies["dune-alugrid"]=["dune-grid","dune-geometry","dune-common"]
|
||||
module_dependencies = {}
|
||||
module_dependencies["dune-alugrid"] = ["dune-grid", "dune-geometry", "dune-common"]
|
||||
module_dependencies["dune-common"] = []
|
||||
module_dependencies["dune-functions"] = ["dune-grid", "dune-typetree", "dune-localfunctions", "dune-istl"]
|
||||
module_dependencies["dune-geometry"] = ["dune-common"]
|
||||
module_dependencies["dune-grid"] = ["dune-common", "dune-geometry"]
|
||||
module_dependencies["dune-istl"] = ["dune-common"]
|
||||
module_dependencies["dune-localfunctions"] = ["dune-common", "dune-geometry"]
|
||||
module_dependencies["dune-python"] = []
|
||||
module_dependencies["dune-testtools"] = ["dune-common"]
|
||||
module_dependencies["dune-typetree"] = ["dune-common"]
|
||||
module_dependencies["dune-uggrid"] = ["dune-common"]
|
||||
|
||||
extends('python')
|
||||
python_components = [ 'dune' ]
|
||||
@ -180,12 +190,14 @@ class Dune(CMakePackage):
|
||||
depends_on('mpi')
|
||||
depends_on('parmetis', when='+parmetis')
|
||||
depends_on('pkg-config', type='build')
|
||||
depends_on('python@3.0:', type=('build', 'run'), when='+python')
|
||||
depends_on('python@3.0:', type=('build', 'run'))
|
||||
depends_on('py-setuptools', type='build', when='+python')
|
||||
depends_on('py-numpy', type=('build', 'run'), when='+python')
|
||||
depends_on('py-pip', type=('build', 'run'), when='+python')
|
||||
depends_on('py-pip', type=('build', 'run'), when='+testtools')
|
||||
depends_on('py-sphinx', type=('build', 'run'), when='+doc')
|
||||
depends_on('py-wheel', type='build', when='+python')
|
||||
depends_on('py-wheel', type='build', when='+testtools')
|
||||
depends_on('scotch+mpi', when='+ptscotch')
|
||||
depends_on('sionlib', when='+sionlib')
|
||||
depends_on('suite-sparse', when='+suitesparse')
|
||||
@ -194,6 +206,10 @@ class Dune(CMakePackage):
|
||||
depends_on('zlib', when='+zlib')
|
||||
depends_on('zoltan', when='+zoltan')
|
||||
|
||||
# Apply patches
|
||||
patch('executable_scripts.patch')
|
||||
patch('virtualenv_from_envvariable.patch', when='+testtools')
|
||||
|
||||
def setup_build_environment(self, env):
|
||||
# We reset the DUNE_CONTROL_PATH here because any entries in this
|
||||
# path that contain Dune modules will break the Spack build process.
|
||||
@ -210,6 +226,11 @@ class Dune(CMakePackage):
|
||||
if '+python' in self.spec:
|
||||
env.set('DUNE_PY_DIR', self.prefix)
|
||||
|
||||
# For those modules that typically work with the Dune Virtualenv,
|
||||
# we export the location of the virtualenv as an environment variable.
|
||||
if '+testtools' in self.spec:
|
||||
env.set('DUNE_PYTHON_VIRTUALENV_PATH', join_path(self.prefix, 'dune-python-env'))
|
||||
|
||||
def cmake_args(self):
|
||||
"""Populate cmake arguments."""
|
||||
spec = self.spec
|
||||
@ -226,23 +247,29 @@ class Dune(CMakePackage):
|
||||
cmake_args = [
|
||||
'-DBUILD_SHARED_LIBS:BOOL=%s' % variant_bool('+shared'),
|
||||
'-DDUNE_GRID_GRIDTYPE_SELECTOR:BOOL=ON',
|
||||
'-DCMAKE_DISABLE_FIND_PACKAGE_BLAS=%s' % nvariant_bool('+blas'),
|
||||
'-DCMAKE_DISABLE_FIND_PACKAGE_Doxygen=%s' % nvariant_bool('+doc'),
|
||||
'-DCMAKE_DISABLE_FIND_PACKAGE_GMP=%s' % nvariant_bool('+gmp'),
|
||||
'-DCMAKE_DISABLE_FIND_PACKAGE_LAPACK=%s' % nvariant_bool('+lapack'),
|
||||
'-DCMAKE_DISABLE_FIND_PACKAGE_LATEX=%s' % nvariant_bool('+doc'),
|
||||
'-DCMAKE_DISABLE_FIND_PACKAGE_METIS=%s' % nvariant_bool('+metis'),
|
||||
'-DCMAKE_DISABLE_FIND_PACKAGE_ParMETIS=%s' % nvariant_bool('+parmetis'),
|
||||
'-DCMAKE_DISABLE_FIND_PACKAGE_PTScotch=%s' % nvariant_bool('+ptscotch'),
|
||||
'-DCMAKE_DISABLE_FIND_PACKAGE_SIONLib=%s' % nvariant_bool('+sionlib'),
|
||||
'-DCMAKE_DISABLE_FIND_PACKAGE_SuiteSparse=%s' % nvariant_bool('+suitesparse'),
|
||||
'-DCMAKE_DISABLE_FIND_PACKAGE_SuperLU=%s' % nvariant_bool('+superlu'),
|
||||
'-DCMAKE_DISABLE_FIND_PACKAGE_BLAS:BOOL=%s' % nvariant_bool('+blas'),
|
||||
'-DCMAKE_DISABLE_FIND_PACKAGE_Doxygen:BOOL=%s' % nvariant_bool('+doc'),
|
||||
'-DCMAKE_DISABLE_FIND_PACKAGE_GMP:BOOL=%s' % nvariant_bool('+gmp'),
|
||||
'-DCMAKE_DISABLE_FIND_PACKAGE_LAPACK:BOOL=%s' % nvariant_bool('+lapack'),
|
||||
'-DCMAKE_DISABLE_FIND_PACKAGE_LATEX:BOOL=%s' % nvariant_bool('+doc'),
|
||||
'-DCMAKE_DISABLE_FIND_PACKAGE_METIS:BOOL=%s' % nvariant_bool('+metis'),
|
||||
'-DCMAKE_DISABLE_FIND_PACKAGE_ParMETIS:BOOL=%s' % nvariant_bool('+parmetis'),
|
||||
'-DCMAKE_DISABLE_FIND_PACKAGE_PTScotch:BOOL=%s' % nvariant_bool('+ptscotch'),
|
||||
'-DCMAKE_DISABLE_FIND_PACKAGE_SIONLib:BOOL=%s' % nvariant_bool('+sionlib'),
|
||||
'-DCMAKE_DISABLE_FIND_PACKAGE_SuiteSparse:BOOL=%s' % nvariant_bool('+suitesparse'),
|
||||
'-DCMAKE_DISABLE_FIND_PACKAGE_SuperLU:BOOL=%s' % nvariant_bool('+superlu'),
|
||||
# '-DCMAKE_DISABLE_FIND_PACKAGE_TBB=%s' % nvariant_bool('+tbb'), Disabled until upstream fix of dune-common#205.
|
||||
'-DCMAKE_DISABLE_FIND_PACKAGE_VC=%s' % nvariant_bool('+vc'),
|
||||
'-DCMAKE_DISABLE_FIND_PACKAGE_ZLIB=%s' % nvariant_bool('+zlib'),
|
||||
'-DCMAKE_DISABLE_FIND_PACKAGE_ZOLTAN=%s' % nvariant_bool('+zoltan'),
|
||||
'-DCMAKE_DISABLE_FIND_PACKAGE_VC:BOOL=%s' % nvariant_bool('+vc'),
|
||||
'-DCMAKE_DISABLE_FIND_PACKAGE_ZLIB:BOOL=%s' % nvariant_bool('+zlib'),
|
||||
'-DCMAKE_DISABLE_FIND_PACKAGE_ZOLTAN:BOOL=%s' % nvariant_bool('+zoltan'),
|
||||
]
|
||||
|
||||
if '+testtools' in spec or '+codegen' in spec:
|
||||
cmake_args.append('-DDUNE_PYTHON_VIRTUALENV_SETUP:BOOL=ON')
|
||||
cmake_args.append('-DDUNE_PYTHON_ALLOW_GET_PIP:BOOL=ON')
|
||||
cmake_args.append('-DDUNE_PYTHON_VIRTUALENV_PATH:STRING="%s"' % join_path(self.prefix, 'dune-python-env'))
|
||||
cmake_args.append('-DDUNE_PYTHON_INSTALL_LOCATION:STRING="system"')
|
||||
|
||||
if '+python' in spec:
|
||||
if '@2.7' not in spec:
|
||||
cmake_args.append('-DDUNE_ENABLE_PYTHONBINDINGS:BOOL=TRUE')
|
||||
|
Reference in New Issue
Block a user