Skip to content

Commit a9f6cd6

Browse files
authored
Basics: minor updates to tutorial (#152)
1 parent c522c4d commit a9f6cd6

File tree

3 files changed

+31
-28
lines changed

3 files changed

+31
-28
lines changed

outputs/basics.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ rm -rf $raw_outputs ~/spack ~/.spack ~/.gnupg
1111
pip3 install boto3
1212

1313
# basic installation
14-
example basics/clone "git clone https://github.com/spack/spack ~/spack"
14+
example basics/clone "git clone https://github.com/spack/spack.git ~/spack"
1515

1616
example basics/checkout "cd ~/spack"
1717
cd ~/spack

outputs/basics/clone.out

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
$ git clone https://github.com/spack/spack ~/spack
1+
$ git clone https://github.com/spack/spack.git ~/spack
22
Cloning into '/home/spack/spack'...
33
remote: Enumerating objects: 326481, done.K
44
remote: Counting objects: 100% (770/770), done.K

tutorial_basics.rst

Lines changed: 29 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -10,33 +10,33 @@ Basic Installation Tutorial
1010
=========================================
1111

1212
This tutorial will guide you through the process of installing
13-
software using Spack. We will first cover the `spack install` command,
13+
software using Spack. We will first cover the ``spack install`` command,
1414
focusing on the power of the spec syntax and the flexibility it gives
15-
to users. We will also cover the `spack find` command for viewing
16-
installed packages and the `spack uninstall` command. Finally, we will
17-
touch on how Spack manages compilers, especially as it relates to
18-
using Spack-built compilers within Spack. We will include full output
19-
from all of the commands demonstrated, although we will frequently
20-
call attention to only small portions of that output (or merely to the
21-
fact that it succeeded). The provided output is all from an AWS
22-
instance running Ubuntu 18.04.
15+
to users. We will also cover the ``spack find`` command for viewing
16+
installed packages and the ``spack uninstall`` command for uninstalling
17+
them. Finally, we will touch on how Spack manages compilers,
18+
especially as it relates to using Spack-built compilers within Spack.
19+
We will include full output from all of the commands demonstrated,
20+
although we will frequently call attention to only small portions of
21+
that output (or merely to the fact that it succeeded). The provided
22+
output is all from an AWS instance running Ubuntu 18.04.
2323

2424
.. _basics-tutorial-install:
2525

2626
----------------
2727
Installing Spack
2828
----------------
2929

30-
Spack works out of the box. Simply clone Spack and get going. We will
31-
clone Spack and immediately checkout the most recent release, v0.17.
30+
Spack works out of the box. Simply clone Spack to get going. We will
31+
clone Spack and immediately check out the most recent release, v0.17.
3232

3333
.. literalinclude:: outputs/basics/clone.out
3434
:language: console
3535

3636
.. literalinclude:: outputs/basics/checkout.out
3737
:language: console
3838

39-
Next, add Spack to your path. Spack has some nice command line
39+
Next, add Spack to your path. Spack has some nice command-line
4040
integration tools, so instead of simply appending to your ``PATH``
4141
variable, source the Spack setup script.
4242

@@ -91,7 +91,7 @@ You'll learn more about configuring Spack later in the tutorial, but
9191
for now you will be able to install the rest of the packages in the
9292
tutorial from a binary cache using the same ``spack install``
9393
command. By default this will install the binary cached version if it
94-
exists and fall back on installing from source.
94+
exists and fall back on installing from source if it does not.
9595

9696
Spack's spec syntax is the interface by which we can request specific
9797
configurations of the package. The ``%`` sigil is used to specify
@@ -137,6 +137,9 @@ compiler flags of those packages.
137137
.. literalinclude:: outputs/basics/find.out
138138
:language: console
139139

140+
.. literalinclude:: outputs/basics/find-lf.out
141+
:language: console
142+
140143
Spack generates a hash for each spec. This hash is a function of the full
141144
provenance of the package, so any change to the spec affects the
142145
hash. Spack uses this value to compare specs and to generate unique
@@ -183,11 +186,11 @@ we install it "out of the box," it will build with OpenMPI.
183186
:language: console
184187

185188
Spack packages can also have build options, called variants. Boolean
186-
variants can be specified using the ``+`` and ``~`` or ``-``
187-
sigils. There are two sigils for ``False`` to avoid conflicts with
188-
shell parsing in different situations. Variants (boolean or otherwise)
189-
can also be specified using the same syntax as compiler flags. Here
190-
we can install HDF5 without MPI support.
189+
variants can be specified using the ``+`` (enable) and ``~`` or ``-``
190+
(disable) sigils. There are two sigils for "disable" to avoid conflicts
191+
with shell parsing in different situations. Variants (boolean or
192+
otherwise) can also be specified using the same syntax as compiler flags.
193+
Here we can install HDF5 without MPI support.
191194

192195
.. literalinclude:: outputs/basics/hdf5-no-mpi.out
193196
:language: console
@@ -202,7 +205,7 @@ an MPI dependency. For example, we can build HDF5 with MPI support
202205
provided by MPICH by specifying a dependency on ``mpich``. Spack also
203206
supports versioning of virtual dependencies. A package can depend on the
204207
MPI interface at version 3, and provider packages specify what version of
205-
the interface *they* provide. The partial spec ``^mpi@3`` can be safisfied
208+
the interface *they* provide. The partial spec ``^mpi@3`` can be satisfied
206209
by any of several providers.
207210

208211
.. literalinclude:: outputs/basics/hdf5-hl-mpi.out
@@ -225,19 +228,19 @@ You may also have noticed that there are some packages shown in the
225228
``spack find -d`` output that we didn't install explicitly. These are
226229
dependencies that were installed implicitly. A few packages installed
227230
implicitly are not shown as dependencies in the ``spack find -d``
228-
output. These are build dependencies. For example, ``libpciaccess`` is a
229-
dependency of openmpi and requires ``m4`` to build. Spack will build ``m4`` as
230-
part of the installation of ``openmpi``, but it does not become a part of
231-
the DAG because it is not linked in at run time. Spack handles build
231+
output. These are build dependencies. For example, ``hdf5`` requires
232+
``cmake`` to build. Spack will build ``cmake`` as part of the
233+
installation of ``hdf5``, but it does not become a part of the DAG
234+
because it is not linked in at run time. Spack handles build
232235
dependencies differently because of their different (less strict)
233236
consistency requirements. It is entirely possible to have two packages
234237
using different versions of a dependency to build, which obviously cannot
235238
be done with linked dependencies.
236239

237240
HDF5 is more complicated than our basic example of zlib and
238241
Tcl, but it's still within the realm of software that an experienced
239-
HPC user could reasonably expect to install given a bit of time. Now
240-
let's look at an even more complicated package.
242+
HPC user could reasonably expect to manually install given a bit of time.
243+
Now let's look at an even more complicated package.
241244

242245
.. literalinclude:: outputs/basics/trilinos.out
243246
:language: console
@@ -351,7 +354,7 @@ return every package which was built with ``cppflags="-O3"``.
351354
The ``find`` command can also show which packages were installed
352355
explicitly (rather than pulled in as a dependency) using the ``-x``
353356
flag. The ``-X`` flag shows implicit installs only. The ``find`` command can
354-
also show the path to which a spack package was installed using the ``-p``
357+
also show the path to which a Spack package was installed using the ``-p``
355358
flag.
356359

357360
.. literalinclude:: outputs/basics/find-px.out

0 commit comments

Comments
 (0)