Skip to content

Commit b2b46f0

Browse files
committed
use head -12 instead of cat for spack config get
1 parent 2a90caf commit b2b46f0

2 files changed

Lines changed: 12 additions & 41 deletions

File tree

outputs/environments.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ example --tee environments/env-swap-1 "spack env activate myproject"
9191
spack env activate myproject
9292
example environments/env-swap-1 "spack find"
9393

94-
example environments/config-get-1 'cat "$(spack location -e)/spack.yaml"'
94+
example environments/config-get-1 "spack config get | head -12"
9595

9696
# The file is edited by hand here
9797
# We mock that by using `spack config add`

tutorial_environments.rst

Lines changed: 11 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ Let's look at the output of ``spack find`` at this point in the tutorial.
7676

7777
This is a complete, but cluttered list of all our installed packages and their dependencies.
7878
It contains packages built with both ``openmpi`` and ``mpich``, as well as multiple variants of other packages, like ``hdf5`` and ``zlib-ng``.
79+
7980
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.
8081

8182
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -155,6 +156,8 @@ Let's try it:
155156
:language: console
156157

157158
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+
160+
158161
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.
159162

160163
Now, let's install:
@@ -173,38 +176,6 @@ Let's now confirm the contents of the environment using ``spack find``:
173176

174177
We can see that the roots and all their dependencies have been installed.
175178

176-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
177-
Creating an environment incrementally
178-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
179-
180-
We can also add and install specs to an environment incrementally. For example:
181-
182-
.. code-block:: console
183-
184-
$ spack install --add tcl
185-
$ spack install --add trilinos
186-
187-
If we create environments incrementally, Spack ensures that already installed roots are not re-concretized.
188-
So, adding specs to an environment at a later point in time will not cause existing packages to rebuild.
189-
190-
.. note::
191-
192-
Incrementally creating an environment may give us different package
193-
versions from an environment created all at once.
194-
We'll cover this later in the tutorial after we've discussed different
195-
concretization strategies.
196-
197-
Further, there are two other advantages of concretizing and installing an
198-
environment all at once:
199-
200-
201-
* If you have a number of specs that can be installed together,
202-
adding them first and installing them together enables them to
203-
share dependencies and reduces total installation time.
204-
205-
* You can launch all builds in parallel by taking advantage of Spack's
206-
`install-level build parallelism <https://spack.readthedocs.io/en/latest/config_yaml.html#build-jobs>`_.
207-
208179
^^^^^^^^^^^^^^
209180
Using Packages
210181
^^^^^^^^^^^^^^
@@ -305,15 +276,10 @@ In this section, we'll learn how to enforce that all the packages in our environ
305276

306277
We can customize the selection of the ``mpi`` provider using `concretization preferences <https://spack.readthedocs.io/en/latest/build_settings.html#concretization-preferences>`_ to change the behavior of the concretizer.
307278

308-
.. note::
309279

310-
Before proceeding, make sure your ``EDITOR`` environment variable
311-
is set to the path of your preferred text editor.
312-
313-
Let's start by examining our environment's configuration using ``spack config edit``:
280+
Let's start by examining our environment's configuration using ``spack config get``:
314281

315282
.. literalinclude:: outputs/environments/config-get-1.out
316-
:emphasize-lines: 8-13
317283

318284
The output shows the special ``spack.yaml`` configuration file that Spack uses to store environment configurations.
319285

@@ -342,9 +308,14 @@ The ``concretizer:unify:true`` setting controls how Spack resolves dependencies
342308
Editing environment configuration
343309
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
344310

345-
Let's edit ``spack.yaml`` to *require* ``mpich`` as our ``mpi`` provider.
311+
.. note::
312+
313+
Before proceeding, make sure your ``EDITOR`` environment variable
314+
is set to the path of your preferred text editor.
315+
316+
Let's edit ``spack.yaml`` to *require* ``mpich`` as our ``mpi`` provider using ``spack config edit``.
346317

347-
You should have the above file open in your editor.
318+
You should now have the above file open in your editor.
348319
Change it to include the ``packages:mpi:require`` entry below:
349320

350321
.. code-block:: yaml

0 commit comments

Comments
 (0)