summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGreg Becker <becker33@llnl.gov>2020-05-31 12:13:10 -0700
committerGitHub <noreply@github.com>2020-05-31 14:13:10 -0500
commitb1bd7774035c626d777220f279a152c01b71ceea (patch)
treeb301c4391562511e1279739db026d3cb00277c56
parent23a5f3f20055c7f86b97657d77b3c61a7ca67f50 (diff)
downloadspack-b1bd7774035c626d777220f279a152c01b71ceea.tar.gz
spack-b1bd7774035c626d777220f279a152c01b71ceea.tar.bz2
spack-b1bd7774035c626d777220f279a152c01b71ceea.tar.xz
spack-b1bd7774035c626d777220f279a152c01b71ceea.zip
petsc: fix conditional activation of parmetis (#16533)
-rw-r--r--var/spack/repos/builtin/packages/petsc/package.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/var/spack/repos/builtin/packages/petsc/package.py b/var/spack/repos/builtin/packages/petsc/package.py
index c1b060bd50..f328171072 100644
--- a/var/spack/repos/builtin/packages/petsc/package.py
+++ b/var/spack/repos/builtin/packages/petsc/package.py
@@ -216,7 +216,7 @@ class Petsc(Package):
# enabled. This generates a list of any such errors.
errors = [
error_message_fmt.format(library=x)
- for x in ('hdf5', 'hypre', 'parmetis', 'mumps', 'superlu-dist')
+ for x in ('hdf5', 'hypre', 'mumps', 'superlu-dist')
if ('+' + x) in self.spec]
if errors:
errors = ['incompatible variants given'] + errors
@@ -296,15 +296,18 @@ class Petsc(Package):
'--with-scalapack=0'
])
- # Activates library support if needed
+ # Activates library support if needed (i.e. direct dependency)
for library in ('cuda', 'metis', 'hypre', 'parmetis',
'mumps', 'trilinos', 'fftw', 'valgrind'):
+ # Cannot check `library in spec` because of transitive deps
+ # Cannot check variants because parmetis keys on +metis
+ library_requested = library in spec.dependencies_dict()
options.append(
'--with-{library}={value}'.format(
library=library,
- value=('1' if '+' + library in spec else '0'))
+ value=('1' if library_requested else '0'))
)
- if '+' + library in spec:
+ if library_requested:
options.append(
'--with-{library}-dir={path}'.format(
library=library, path=spec[library].prefix)