Skip to content

Finer selection of virtual providers in a DAG #15443

@alalazo

Description

@alalazo

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:

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:

  1. intel-parallel-studio to satisfy mpi
  2. openblas to satisfy lapack

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:

  1. 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.
  2. Packages need a way to specify that a set of virtual dependencies needs to be used together (e.g. openblas provides both lapack and blas but 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

concretizationepicA high level task that is broken down into smaller, more focused, units of workfeatureA feature is missing in Spackspecsvirtual-dependencies

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions