summaryrefslogtreecommitdiff
path: root/var/spack/repos/builtin.mock/packages/netlib-scalapack/package.py
diff options
context:
space:
mode:
authorMassimiliano Culpo <massimiliano.culpo@gmail.com>2023-11-02 07:35:23 +0100
committerGitHub <noreply@github.com>2023-11-01 23:35:23 -0700
commit16fa3b9f077be62e62214585dee9f6dfda7f48ad (patch)
tree0a2208f08955524d0f2bad316816f5d94be580db /var/spack/repos/builtin.mock/packages/netlib-scalapack/package.py
parent6cd2241e49a393d7ac32b46064a2d2f4e53f7d86 (diff)
downloadspack-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 'var/spack/repos/builtin.mock/packages/netlib-scalapack/package.py')
-rw-r--r--var/spack/repos/builtin.mock/packages/netlib-scalapack/package.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/var/spack/repos/builtin.mock/packages/netlib-scalapack/package.py b/var/spack/repos/builtin.mock/packages/netlib-scalapack/package.py
new file mode 100644
index 0000000000..fe5d7f90a1
--- /dev/null
+++ b/var/spack/repos/builtin.mock/packages/netlib-scalapack/package.py
@@ -0,0 +1,20 @@
+# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
+# Spack Project Developers. See the top-level COPYRIGHT file for details.
+#
+# SPDX-License-Identifier: (Apache-2.0 OR MIT)
+
+
+from spack.package import *
+
+
+class NetlibScalapack(Package):
+ homepage = "http://www.netlib.org/scalapack/"
+ url = "http://www.netlib.org/scalapack/scalapack-2.1.0.tgz"
+
+ version("2.1.0", "b1d3e3e425b2e44a06760ff173104bdf")
+
+ provides("scalapack")
+
+ depends_on("mpi")
+ depends_on("lapack")
+ depends_on("blas")