-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Finer selection of virtual providers in a DAG #15443
Description
As a user I want to be able to use a package only for a subset of the virtual dependencies it provides so that I can select other providers for whatever virtual dependency is not used.
Rationale
When a spec providing multiple virtual dependencies is present in a DAG Spack enforces the use of all of them, if required by a dependee. To make a concrete example consider intel-parallel-studio:
spack/var/spack/repos/builtin/packages/intel-parallel-studio/package.py
Lines 176 to 185 in 20c77ca
| provides('daal', when='+daal') | |
| provides('ipp', when='+ipp') | |
| provides('mkl', when='+mkl') | |
| provides('blas', when='+mkl') | |
| provides('lapack', when='+mkl') | |
| provides('scalapack', when='+mkl') | |
| provides('mpi', when='+mpi') | |
| provides('tbb', when='+tbb') |
This package provides multiple virtual dependencies and it would be currently impossible to require the build of a spec which uses:
intel-parallel-studioto satisfympiopenblasto satisfylapack
This proposal aims at solving this issue by introducing a syntax to specify the binding of a virtual dependency to a particular provider.
Description
Spack should be extended to allow specs like:
dealii ^[virtuals=mpi] intel-parallel-studio ^[virtuals=lapack] openblas
to mean that dealii should be compiled to use the mpi from intel-parallel-studio and the lapack from openblas. More in details:
- The provider can be specified as an abstract spec (in which case some concretizer heuristics will kick-in) or as a concrete spec by hash.
- Packages need a way to specify that a set of virtual dependencies needs to be used together (e.g.
openblasprovides bothlapackandblasbut within a unique library)
Additional information
This modification will be instrumental to move towards compilers as regular dependencies, since compilers can be modeled as providers of languages and we want to retain the ability to mix them (e.g. clang for C and C++, gcc for Fortran):
hdf5 %[virtuals=cc,cxx] clang %[virtuals=fortran] gcc
Task list
General information
- I have searched the issues of this repo and believe this is not a duplicate
Metadata
Metadata
Assignees
Labels
Type
Projects
Status