You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* environments: update for pearc25
* undo changes to output to get docs to build?
* space
* outputs
* try using outputs workflow
* recomment
* spelling
* test building outputs
* revert output changes
* use head -12 instead of cat for spack config get
* rm extra newline
Copy file name to clipboardExpand all lines: tutorial_environments.rst
+35-37Lines changed: 35 additions & 37 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -52,12 +52,18 @@ Goals of this Tutorial
52
52
----------------------
53
53
54
54
This tutorial will teach you the fundamentals of creating and using Spack environments.
55
+
55
56
We'll cover:
57
+
56
58
1. Command line basics -- Creating and managing environments with Spack commands.
59
+
57
60
2. Configuration files -- Editing ``spack.yaml`` and understanding ``spack.lock``.
61
+
58
62
3. Environment types -- Understanding Spack-managed vs. independent environments.
63
+
59
64
4. Reproducible builds -- Sharing and recreating environments across systems.
60
65
66
+
61
67
-------------------
62
68
Environment Basics
63
69
-------------------
@@ -70,6 +76,7 @@ Let's look at the output of ``spack find`` at this point in the tutorial.
70
76
71
77
This is a complete, but cluttered list of all our installed packages and their dependencies.
72
78
It contains packages built with both ``openmpi`` and ``mpich``, as well as multiple variants of other packages, like ``hdf5`` and ``zlib-ng``.
79
+
73
80
The query mechanism we learned about with ``spack find`` can help, but it would be nice if we could see only the software that is relevant to our current project instead of seeing everything on the machine.
74
81
75
82
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -149,6 +156,7 @@ Let's try it:
149
156
:language: console
150
157
151
158
Now, ``tcl`` and ``trilinos`` have been registered as **root specs** in our environment. **Root specs** are packages that we've explicitly requested to be installed in an environment.
159
+
152
160
They're called **"roots"** because they sit at the top of the dependency graph---when Spack installs these packages, with their respective dependency packages sitting below them.
153
161
154
162
Now, let's install:
@@ -167,38 +175,6 @@ Let's now confirm the contents of the environment using ``spack find``:
167
175
168
176
We can see that the roots and all their dependencies have been installed.
169
177
170
-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
171
-
Creating an environment incrementally
172
-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
173
-
174
-
We can also add and install specs to an environment incrementally. For example:
175
-
176
-
.. code-block:: console
177
-
178
-
$ spack install --add tcl
179
-
$ spack install --add trilinos
180
-
181
-
If we create environments incrementally, Spack ensures that already installed roots are not re-concretized.
182
-
So, adding specs to an environment at a later point in time will not cause existing packages to rebuild.
183
-
184
-
.. note::
185
-
186
-
Incrementally creating an environment may give us different package
187
-
versions from an environment created all at once.
188
-
We'll cover this later in the tutorial after we've discussed different
189
-
concretization strategies.
190
-
191
-
Further, there are two other advantages of concretizing and installing an
192
-
environment all at once:
193
-
194
-
195
-
* If you have a number of specs that can be installed together,
196
-
adding them first and installing them together enables them to
197
-
share dependencies and reduces total installation time.
198
-
199
-
* You can launch all builds in parallel by taking advantage of Spack's
If we create environments incrementally, Spack ensures that already installed roots are not re-concretized.
379
+
So, adding specs to an environment at a later point in time will not cause existing packages to rebuild.
380
+
381
+
Adding and installing specs incrementally leads to greedy concretization, meaning that the environment may have different package versions compared to an environment created all at once.
382
+
383
+
When you first install ``python`` in an environment, Spack will pick a recent version.
396
384
If you then add ``py-numpy``, it may be in conflict with the ``python`` version already installed, and fail to concretize:
0 commit comments