Skip to content

Commit 56da0ce

Browse files
authored
add note about spack help --spec (#440)
* add note about spack help --spec * fix .. note:: * indent doesn't need to be so large * fix the help text output * break up sentences
1 parent 0793325 commit 56da0ce

3 files changed

Lines changed: 78 additions & 9 deletions

File tree

outputs/basics/help-spec.out

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
spec expression syntax:
2+
3+
package [constraints] [^dependency [constraints] ...]
4+
5+
package any package from 'spack list', or
6+
/hash unique prefix or full hash of
7+
installed package
8+
9+
constraints:
10+
versions:
11+
@version single version
12+
@min:max version range (inclusive)
13+
@min: version <min> or higher
14+
@:max up to version <max> (inclusive)
15+
@=version exact version
16+
17+
compilers:
18+
%compiler build with <compiler>
19+
%compiler@version build with specific compiler version
20+
%compiler@min:max specific version range (see above)
21+
22+
compiler flags:
23+
cflags="flags" cppflags, cflags, cxxflags,
24+
fflags, ldflags, ldlibs
25+
== propagate flags to package dependencies
26+
27+
variants:
28+
+variant enable <variant>
29+
-variant or ~variant disable <variant>
30+
variant=value set non-boolean <variant> to <value>
31+
variant=value1,value2,value3 set multi-value <variant> values
32+
++, --, ~~, == propagate variants to package dependencies
33+
34+
architecture variants:
35+
platform=platform linux, darwin, freebsd, windows
36+
os=operating_system specific <operating_system>
37+
target=target specific <target> processor
38+
arch=platform-os-target shortcut for all three above
39+
40+
dependencies:
41+
^dependency [constraints] specify constraints on dependencies
42+
^/hash build with a specific installed
43+
dependency
44+
45+
examples:
46+
hdf5 any hdf5 configuration
47+
hdf5 @1.10.1 hdf5 version 1.10.1
48+
hdf5 @1.8: hdf5 1.8 or higher
49+
hdf5 @1.8: %gcc hdf5 1.8 or higher built with gcc
50+
hdf5 +mpi hdf5 with mpi enabled
51+
hdf5 ~mpi hdf5 with mpi disabled
52+
hdf5 ++mpi hdf5 with mpi enabled and propagates
53+
hdf5 ~~mpi hdf5 with mpi disabled and propagates
54+
hdf5 +mpi ^mpich hdf5 with mpi, using mpich
55+
hdf5 +mpi ^openmpi@1.7 hdf5 with mpi, using openmpi 1.7
56+
boxlib dim=2 boxlib built for 2 dimensions
57+
libdwarf %intel ^libelf%gcc
58+
libdwarf, built with intel compiler, linked to libelf built with gcc
59+
mvapich2 fabrics=psm,mrail,sock %gcc
60+
mvapich2, built with gcc compiler, with support for multiple fabrics

tutorial_basics.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,3 +341,12 @@ We can also remove compilers from our configuration using ``spack compiler remov
341341

342342
.. literalinclude:: outputs/basics/compiler-remove.out
343343
:language: console
344+
345+
.. note::
346+
347+
The spec syntax may be confusing for new users.
348+
Spack can provide information about commands you run frequently.
349+
For instance, see the output of ``spack help --spec``:
350+
351+
.. literalinclude:: outputs/basics/help-spec.out
352+
:language: console

tutorial_binary_cache.rst

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@ The build cache name, `buildcache-${USER}-${HOSTNAME}`, is a suggestion; you can
5959
oci://ghcr.io/<your-github-username-or-org>/buildcache-${USER}-${HOSTNAME}
6060
6161
62-
.. note ::
62+
.. note::
6363

64-
We talk about mirrors and build caches almost interchangeably, because every build cache is a binary mirror.
65-
Source mirrors exist too, which we will not cover in this tutorial.
64+
We talk about mirrors and build caches almost interchangeably, because every build cache is a binary mirror.
65+
Source mirrors exist too, which we will not cover in this tutorial.
6666

6767

6868
Your ``spack.yaml`` file should now contain the following:
@@ -110,15 +110,15 @@ The location of the pushed package, when referred to as an OCI image, will be:
110110
111111
look very similar to a container image --- we will get to that in a bit.
112112

113-
.. note ::
113+
.. note::
114114

115-
Binaries pushed to GitHub packages are ``private`` by default, which means you need a token to download them.
116-
You can change the visibility to ``public`` by going to GitHub Packages from your GitHub account, selecting the ``buildcache`` package, go to ``package settings``, and change the visibility to ``public`` in the ``Danger Zone`` section.
117-
This page can also be directly accessed by going to
115+
Binaries pushed to GitHub packages are ``private`` by default, which means you need a token to download them.
116+
You can change the visibility to ``public`` by going to GitHub Packages from your GitHub account, selecting the ``buildcache`` package, go to ``package settings``, and change the visibility to ``public`` in the ``Danger Zone`` section.
117+
This page can also be directly accessed by going to
118118

119-
.. code-block:: text
119+
.. code-block:: text
120120
121-
https://github.com/users/<user>/packages/container/buildcache/settings
121+
https://github.com/users/<user>/packages/container/buildcache/settings
122122
123123
124124
-------------------------------

0 commit comments

Comments
 (0)