summaryrefslogtreecommitdiff
path: root/lib/spack/docs/environments.rst
diff options
context:
space:
mode:
authorGreg Becker <becker33@llnl.gov>2020-05-04 15:11:10 -0700
committerGitHub <noreply@github.com>2020-05-04 15:11:10 -0700
commit8e2f5ba861bee449e7ad60f7da51767c23942c75 (patch)
tree1a5ed9e027607e6ec6dc8ea33c687f578c976529 /lib/spack/docs/environments.rst
parent6c07260d27a2556f4f559c0f0dc24217ef05a3ae (diff)
downloadspack-8e2f5ba861bee449e7ad60f7da51767c23942c75.tar.gz
spack-8e2f5ba861bee449e7ad60f7da51767c23942c75.tar.bz2
spack-8e2f5ba861bee449e7ad60f7da51767c23942c75.tar.xz
spack-8e2f5ba861bee449e7ad60f7da51767c23942c75.zip
environments: allow sigils to apply to entire reference (#15245)
* environments: allow sigils to apply to entire reference
Diffstat (limited to 'lib/spack/docs/environments.rst')
-rw-r--r--lib/spack/docs/environments.rst36
1 files changed, 35 insertions, 1 deletions
diff --git a/lib/spack/docs/environments.rst b/lib/spack/docs/environments.rst
index c26f81d914..b80e36b4b2 100644
--- a/lib/spack/docs/environments.rst
+++ b/lib/spack/docs/environments.rst
@@ -602,7 +602,7 @@ files are identical.
spack:
definitions:
- first: [libelf, libdwarf]
- - compilers: ['%gcc', '^intel']
+ - compilers: ['%gcc', '%intel']
- second:
- $first
- matrix:
@@ -676,6 +676,40 @@ The valid variables for a ``when`` clause are:
#. ``hostname``. The hostname of the system (if ``hostname`` is an
executable in the user's PATH).
+""""""""""""""""""""""""
+SpecLists as Constraints
+""""""""""""""""""""""""
+
+Dependencies and compilers in Spack can be both packages in an
+environment and constraints on other packages. References to SpecLists
+allow a shorthand to treat packages in a list as either a compiler or
+a dependency using the ``$%`` or ``$^`` syntax respectively.
+
+For example, the following environment has three root packages:
+``gcc@8.1.0``, ``mvapich2@2.3.1 %gcc@8.1.0``, and ``hdf5+mpi
+%gcc@8.1.0 ^mvapich2@2.3.1``.
+
+.. code-block:: yaml
+
+ spack:
+ definitions:
+ - compilers: [gcc@8.1.0]
+ - mpis: [mvapich2@2.3.1]
+ - packages: [hdf5+mpi]
+
+ specs:
+ - $compilers
+ - matrix:
+ - [$mpis]
+ - [$%compilers]
+ - matrix:
+ - [$packages]
+ - [$^mpis]
+ - [$%compilers]
+
+This allows for a much-needed reduction in redundancy between packages
+and constraints.
+
^^^^^^^^^^^^^^^^^^^^^^^^^
Environment-managed Views
^^^^^^^^^^^^^^^^^^^^^^^^^