Skip to content
Snippets Groups Projects
Commit 8e3ff9b3 authored by Alexander Knieps's avatar Alexander Knieps Committed by Adam J. Stewart
Browse files

dealii: Added 'threads' variant that controls the TBB dependency (#13931)


* dealii: Added 'threads' variant that controls the DEAL_II_WITH_THREADS cmake option and the dependency on Intel TBB

* Update var/spack/repos/builtin/packages/dealii/package.py

Co-Authored-By: default avatarAdam J. Stewart <ajstewart426@gmail.com>
parent c7568c91
No related branches found
No related tags found
No related merge requests found
...@@ -66,6 +66,8 @@ class Dealii(CMakePackage, CudaPackage): ...@@ -66,6 +66,8 @@ class Dealii(CMakePackage, CudaPackage):
description='Compile with Slepc (only with Petsc and MPI)') description='Compile with Slepc (only with Petsc and MPI)')
variant('symengine', default=True, variant('symengine', default=True,
description='Compile with SymEngine') description='Compile with SymEngine')
variant('threads', default=True,
description='Compile with multi-threading via TBB')
variant('trilinos', default=True, variant('trilinos', default=True,
description='Compile with Trilinos (only with MPI)') description='Compile with Trilinos (only with MPI)')
variant('python', default=False, variant('python', default=False,
...@@ -110,7 +112,6 @@ class Dealii(CMakePackage, CudaPackage): ...@@ -110,7 +112,6 @@ class Dealii(CMakePackage, CudaPackage):
depends_on('bzip2', when='@:8.99') depends_on('bzip2', when='@:8.99')
depends_on('lapack') depends_on('lapack')
depends_on('suite-sparse') depends_on('suite-sparse')
depends_on('tbb')
depends_on('zlib') depends_on('zlib')
# optional dependencies # optional dependencies
...@@ -159,6 +160,7 @@ class Dealii(CMakePackage, CudaPackage): ...@@ -159,6 +160,7 @@ class Dealii(CMakePackage, CudaPackage):
# depends_on("symengine@0.4: build_type=Release", when="@9.1:+symengine+trilinos^trilinos~debug") # NOQA: ignore=E501 # depends_on("symengine@0.4: build_type=Release", when="@9.1:+symengine+trilinos^trilinos~debug") # NOQA: ignore=E501
# depends_on("symengine@0.4: build_type=Debug", when="@9.1:+symengine+trilinos^trilinos+debug") # NOQA: ignore=E501 # depends_on("symengine@0.4: build_type=Debug", when="@9.1:+symengine+trilinos^trilinos+debug") # NOQA: ignore=E501
depends_on('symengine@0.4:', when='@9.1:+symengine') depends_on('symengine@0.4:', when='@9.1:+symengine')
depends_on('tbb', when='+threads')
# do not require +rol to make concretization of xsdk possible # do not require +rol to make concretization of xsdk possible
depends_on('trilinos+amesos+aztec+epetra+ifpack+ml+muelu+sacado+teuchos', when='+trilinos+mpi~int64~cuda') depends_on('trilinos+amesos+aztec+epetra+ifpack+ml+muelu+sacado+teuchos', when='+trilinos+mpi~int64~cuda')
depends_on('trilinos+amesos+aztec+epetra+ifpack+ml+muelu+sacado+teuchos~hypre', when='+trilinos+mpi+int64~cuda') depends_on('trilinos+amesos+aztec+epetra+ifpack+ml+muelu+sacado+teuchos~hypre', when='+trilinos+mpi+int64~cuda')
...@@ -233,7 +235,6 @@ def cmake_args(self): ...@@ -233,7 +235,6 @@ def cmake_args(self):
lapack_blas_headers = spec['lapack'].headers + spec['blas'].headers lapack_blas_headers = spec['lapack'].headers + spec['blas'].headers
options.extend([ options.extend([
'-DDEAL_II_COMPONENT_EXAMPLES=ON', '-DDEAL_II_COMPONENT_EXAMPLES=ON',
'-DDEAL_II_WITH_THREADS:BOOL=ON',
'-DBOOST_DIR=%s' % spec['boost'].prefix, '-DBOOST_DIR=%s' % spec['boost'].prefix,
# CMake's FindBlas/Lapack may pickup system's blas/lapack instead # CMake's FindBlas/Lapack may pickup system's blas/lapack instead
# of Spack's. Be more specific to avoid this. # of Spack's. Be more specific to avoid this.
...@@ -247,7 +248,13 @@ def cmake_args(self): ...@@ -247,7 +248,13 @@ def cmake_args(self):
'-DDEAL_II_ALLOW_BUNDLED=OFF' '-DDEAL_II_ALLOW_BUNDLED=OFF'
]) ])
if (spec.satisfies('^intel-parallel-studio+tbb')): if '+threads' in spec:
options.append('-DDEAL_II_WITH_THREADS:BOOL=ON')
else:
options.extend(['-DDEAL_II_WITH_THREADS:BOOL=OFF'])
if (spec.satisfies('^intel-parallel-studio+tbb')
and '+threads' in spec):
# deal.II/cmake will have hard time picking up TBB from Intel. # deal.II/cmake will have hard time picking up TBB from Intel.
tbb_ver = '.'.join(('%s' % spec['tbb'].version).split('.')[1:]) tbb_ver = '.'.join(('%s' % spec['tbb'].version).split('.')[1:])
options.extend([ options.extend([
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment