petsc: fix conditional activation of parmetis (#16533)
This commit is contained in:
parent
23a5f3f200
commit
b1bd777403
@ -216,7 +216,7 @@ def mpi_dependent_options(self):
|
|||||||
# enabled. This generates a list of any such errors.
|
# enabled. This generates a list of any such errors.
|
||||||
errors = [
|
errors = [
|
||||||
error_message_fmt.format(library=x)
|
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 ('+' + x) in self.spec]
|
||||||
if errors:
|
if errors:
|
||||||
errors = ['incompatible variants given'] + errors
|
errors = ['incompatible variants given'] + errors
|
||||||
@ -296,15 +296,18 @@ def install(self, spec, prefix):
|
|||||||
'--with-scalapack=0'
|
'--with-scalapack=0'
|
||||||
])
|
])
|
||||||
|
|
||||||
# Activates library support if needed
|
# Activates library support if needed (i.e. direct dependency)
|
||||||
for library in ('cuda', 'metis', 'hypre', 'parmetis',
|
for library in ('cuda', 'metis', 'hypre', 'parmetis',
|
||||||
'mumps', 'trilinos', 'fftw', 'valgrind'):
|
'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(
|
options.append(
|
||||||
'--with-{library}={value}'.format(
|
'--with-{library}={value}'.format(
|
||||||
library=library,
|
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(
|
options.append(
|
||||||
'--with-{library}-dir={path}'.format(
|
'--with-{library}-dir={path}'.format(
|
||||||
library=library, path=spec[library].prefix)
|
library=library, path=spec[library].prefix)
|
||||||
|
Loading…
Reference in New Issue
Block a user