summaryrefslogtreecommitdiff
path: root/lib/spack/docs/environments.rst
diff options
context:
space:
mode:
authorMassimiliano Culpo <massimiliano.culpo@gmail.com>2019-10-07 18:53:23 +0200
committerPeter Scheibel <scheibel1@llnl.gov>2019-10-07 09:53:23 -0700
commit9faee51e22967b289dc7d8aabe0dffd36a0f85ba (patch)
tree09ccb90b328d656fdd91c6f1d18b1804a3990f39 /lib/spack/docs/environments.rst
parentc8c795e7dbde22dc47c9ae285a4dd59004b115b1 (diff)
downloadspack-9faee51e22967b289dc7d8aabe0dffd36a0f85ba.tar.gz
spack-9faee51e22967b289dc7d8aabe0dffd36a0f85ba.tar.bz2
spack-9faee51e22967b289dc7d8aabe0dffd36a0f85ba.tar.xz
spack-9faee51e22967b289dc7d8aabe0dffd36a0f85ba.zip
Spack environments can concretize specs together (#11372)
This PR adds a 'concretize' entry to an environment's spec.yaml file which controls how user specs are concretized. By default it is set to 'separately' which means that each spec added by the user is concretized separately (the behavior of environments before this PR). If set to 'together', the environment will concretize all of the added user specs together; this means that all specs and their dependencies will be consistent with each other (for example, a user could develop code linked against the set of libraries in the environment without conflicts). If the environment was previously concretized, this will re-concretize all specs, in which case previously-installed specs may no longer be used by the environment (in this sense, adding a new spec to an environment with 'concretize: together' can be significantly more expensive). The 'concretize: together' setting is not compatible with Spec matrices; this PR adds a check to look for multiple instances of the same package added to the environment and fails early when 'concretize: together' is set (to avoid confusing messages about conflicts later on).
Diffstat (limited to 'lib/spack/docs/environments.rst')
-rw-r--r--lib/spack/docs/environments.rst52
1 files changed, 49 insertions, 3 deletions
diff --git a/lib/spack/docs/environments.rst b/lib/spack/docs/environments.rst
index 6ce67f0067..1ce765210f 100644
--- a/lib/spack/docs/environments.rst
+++ b/lib/spack/docs/environments.rst
@@ -292,19 +292,37 @@ or
$ spack -E myenv add python
+.. _environments_concretization:
+
^^^^^^^^^^^^
Concretizing
^^^^^^^^^^^^
Once some user specs have been added to an environment, they can be
-concretized. The following command will concretize all user specs
-that have been added and not yet concretized:
+concretized. *By default specs are concretized separately*, one after
+the other. This mode of operation permits to deploy a full
+software stack where multiple configurations of the same package
+need to be installed alongside each other. Central installations done
+at HPC centers by system administrators or user support groups
+are a common case that fits in this behavior.
+Environments *can also be configured to concretize all
+the root specs in a self-consistent way* to ensure that
+each package in the environment comes with a single configuration. This
+mode of operation is usually what is required by software developers that
+want to deploy their development environment.
+
+Regardless of which mode of operation has been chosen, the following
+command will ensure all the root specs are concretized according to the
+constraints that are prescribed in the configuration:
.. code-block:: console
[myenv]$ spack concretize
-This command will re-concretize all specs:
+In the case of specs that are not concretized together, the command
+above will concretize only the specs that were added and not yet
+concretized. Forcing a re-concretization of all the specs can be done
+instead with this command:
.. code-block:: console
@@ -467,6 +485,34 @@ Appending to this list in the yaml is identical to using the ``spack
add`` command from the command line. However, there is more power
available from the yaml file.
+"""""""""""""""""""
+Spec concretization
+"""""""""""""""""""
+
+Specs can be concretized separately or together, as already
+explained in :ref:`environments_concretization`. The behavior active
+under any environment is determined by the ``concretization`` property:
+
+.. code-block:: yaml
+
+ spack:
+ specs:
+ - ncview
+ - netcdf
+ - nco
+ - py-sphinx
+ concretization: together
+
+which can currently take either one of the two allowed values ``together`` or ``separately``
+(the default).
+
+.. admonition:: Re-concretization of user specs
+
+ When concretizing specs together the entire set of specs will be
+ re-concretized after any addition of new user specs, to ensure that
+ the environment remains consistent. When instead the specs are concretized
+ separately only the new specs will be re-concretized after any addition.
+
"""""""""""""
Spec Matrices
"""""""""""""