diff options
author | Peter Scheibel <scheibel1@llnl.gov> | 2022-05-19 20:15:44 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-20 03:15:44 +0000 |
commit | 55f4950ed4bf3aa6cc40fe0d296f99cf2df17903 (patch) | |
tree | a54a57b3f087b610c1100c589a0af3581941c0bc /var | |
parent | 23960ed6234a311af41a9358b087a1f1c4894a68 (diff) | |
download | spack-55f4950ed4bf3aa6cc40fe0d296f99cf2df17903.tar.gz spack-55f4950ed4bf3aa6cc40fe0d296f99cf2df17903.tar.bz2 spack-55f4950ed4bf3aa6cc40fe0d296f99cf2df17903.tar.xz spack-55f4950ed4bf3aa6cc40fe0d296f99cf2df17903.zip |
Petsc: fix enable-x for virtuals (#30749)
* If direct dependencies provide virtuals, add those virtual names as well
* Also refer to package by virtual name for jpeg
Diffstat (limited to 'var')
-rw-r--r-- | var/spack/repos/builtin/packages/petsc/package.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/var/spack/repos/builtin/packages/petsc/package.py b/var/spack/repos/builtin/packages/petsc/package.py index 853650c4ec..51ee1a9899 100644 --- a/var/spack/repos/builtin/packages/petsc/package.py +++ b/var/spack/repos/builtin/packages/petsc/package.py @@ -440,9 +440,6 @@ class Petsc(Package, CudaPackage, ROCmPackage): else: options.append('--with-clanguage=C') - # Activates library support if needed (i.e. direct dependency) - jpeg_sp = spec['jpeg'].name if 'jpeg' in spec else 'jpeg' - # to be used in the list of libraries below if '+fortran' in spec: hdf5libs = ':hl,fortran' @@ -453,7 +450,11 @@ class Petsc(Package, CudaPackage, ROCmPackage): # default: 'gmp', => ('gmp', 'gmp', True, True) # any other combination needs a full tuple # if not (useinc || uselib): usedir - i.e (False, False) - direct_dependencies = [x.name for x in spec.dependencies()] + direct_dependencies = [] + for dep in spec.dependencies(): + direct_dependencies.append(dep.name) + direct_dependencies.extend( + set(vspec.name for vspec in dep.package.virtuals_provided)) for library in ( ('cuda', 'cuda', False, False), ('hip', 'hip', True, False), @@ -487,7 +488,7 @@ class Petsc(Package, CudaPackage, ROCmPackage): ('saws', 'saws', False, False), ('libyaml', 'yaml', True, True), 'hwloc', - (jpeg_sp, 'libjpeg', True, True), + ('jpeg', 'libjpeg', True, True), ('scalapack', 'scalapack', False, True), 'strumpack', 'mmg', |