diff options
author | Massimiliano Culpo <massimiliano.culpo@gmail.com> | 2023-11-02 07:35:23 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-01 23:35:23 -0700 |
commit | 16fa3b9f077be62e62214585dee9f6dfda7f48ad (patch) | |
tree | 0a2208f08955524d0f2bad316816f5d94be580db /bin/spack_cmd.bat | |
parent | 6cd2241e49a393d7ac32b46064a2d2f4e53f7d86 (diff) | |
download | spack-16fa3b9f077be62e62214585dee9f6dfda7f48ad.tar.gz spack-16fa3b9f077be62e62214585dee9f6dfda7f48ad.tar.bz2 spack-16fa3b9f077be62e62214585dee9f6dfda7f48ad.tar.xz spack-16fa3b9f077be62e62214585dee9f6dfda7f48ad.zip |
Cherry-picking virtual dependencies (#35322)
This PR makes it possible to select only a subset of virtual dependencies from a spec that _may_ provide more. To select providers, a syntax to specify edge attributes is introduced:
```
hdf5 ^[virtuals=mpi] mpich
```
With that syntax we can concretize specs like:
```console
$ spack spec strumpack ^[virtuals=mpi] intel-parallel-studio+mkl ^[virtuals=lapack] openblas
```
On `develop` this would currently fail with:
```console
$ spack spec strumpack ^intel-parallel-studio+mkl ^openblas
==> Error: Spec cannot include multiple providers for virtual 'blas'
Requested 'intel-parallel-studio' and 'openblas'
```
In package recipes, virtual specs that are declared in the same `provides` directive need to be provided _together_. This means that e.g. `openblas`, which has:
```python
provides("blas", "lapack")
```
needs to provide both `lapack` and `blas` when requested to provide at least one of them.
## Additional notes
This capability is needed to model compilers. Assuming that languages are treated like virtual dependencies, we might want e.g. to use LLVM to compile C/C++ and Gnu GCC to compile Fortran. This can be accomplished by the following[^1]:
```
hdf5 ^[virtuals=c,cxx] llvm ^[virtuals=fortran] gcc
```
[^1]: We plan to add some syntactic sugar around this syntax, and reuse the `%` sigil to avoid having a lot of boilerplate around compilers.
Modifications:
- [x] Add syntax to interact with edge attributes from spec literals
- [x] Add concretization logic to be able to cherry-pick virtual dependencies
- [x] Extend semantic of the `provides` directive to express when virtuals need to be provided together
- [x] Add unit-tests and documentation
Diffstat (limited to 'bin/spack_cmd.bat')
0 files changed, 0 insertions, 0 deletions