Skip to content

Commit bff3b27

Browse files
committed
stacks section: initial edit for spack 1.0
Signed-off-by: Gregory Becker <becker33@llnl.gov>
1 parent 8d7d8b8 commit bff3b27

10 files changed

Lines changed: 7 additions & 145 deletions

outputs/stacks.sh

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,6 @@ fake_example stacks/setup-1 "spack config edit" "/bin/true"
2222
example stacks/setup-2 "spack concretize"
2323
example stacks/setup-2 "spack install"
2424

25-
example stacks/compiler-find-0 'spack compiler find "$(spack location -i gcc)"'
26-
example stacks/compiler-find-1 "spack location -i gcc"
27-
28-
example stacks/compiler-list-0 "spack compiler list"
29-
3025
example stacks/unify-0 "spack add netlib-scalapack %gcc@12 ^openblas ^openmpi"
3126
example stacks/unify-0 "spack add netlib-scalapack %gcc@12 ^openblas ^mpich"
3227

outputs/stacks/examples/2.spack.stack.yaml

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,3 @@ spack:
1313
view: false
1414
concretizer:
1515
unify: false
16-
compilers:
17-
- compiler:
18-
spec: gcc@=12.3.0
19-
paths:
20-
cc: /home/spack/spack/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-11.4.0/gcc-12.3.0-hc3fmfiuomxfx4gnvorj3z3y2gjf2doh/bin/gcc
21-
cxx: /home/spack/spack/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-11.4.0/gcc-12.3.0-hc3fmfiuomxfx4gnvorj3z3y2gjf2doh/bin/g++
22-
f77: /home/spack/spack/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-11.4.0/gcc-12.3.0-hc3fmfiuomxfx4gnvorj3z3y2gjf2doh/bin/gfortran
23-
fc: /home/spack/spack/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-11.4.0/gcc-12.3.0-hc3fmfiuomxfx4gnvorj3z3y2gjf2doh/bin/gfortran
24-
flags: {}
25-
operating_system: ubuntu22.04
26-
target: x86_64
27-
modules: []
28-
environment: {}
29-
extra_rpaths: []

outputs/stacks/examples/3.spack.stack.yaml

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,3 @@ spack:
2020
view: false
2121
concretizer:
2222
unify: false
23-
compilers:
24-
- compiler:
25-
spec: gcc@=12.3.0
26-
paths:
27-
cc: /home/spack/spack/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-11.4.0/gcc-12.3.0-hc3fmfiuomxfx4gnvorj3z3y2gjf2doh/bin/gcc
28-
cxx: /home/spack/spack/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-11.4.0/gcc-12.3.0-hc3fmfiuomxfx4gnvorj3z3y2gjf2doh/bin/g++
29-
f77: /home/spack/spack/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-11.4.0/gcc-12.3.0-hc3fmfiuomxfx4gnvorj3z3y2gjf2doh/bin/gfortran
30-
fc: /home/spack/spack/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-11.4.0/gcc-12.3.0-hc3fmfiuomxfx4gnvorj3z3y2gjf2doh/bin/gfortran
31-
flags: {}
32-
operating_system: ubuntu22.04
33-
target: x86_64
34-
modules: []
35-
environment: {}
36-
extra_rpaths: []

outputs/stacks/examples/4bis.spack.stack.yaml

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,3 @@ spack:
2626
view: false
2727
concretizer:
2828
unify: false
29-
compilers:
30-
- compiler:
31-
spec: gcc@=12.3.0
32-
paths:
33-
cc: /home/spack/spack/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-11.4.0/gcc-12.3.0-hc3fmfiuomxfx4gnvorj3z3y2gjf2doh/bin/gcc
34-
cxx: /home/spack/spack/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-11.4.0/gcc-12.3.0-hc3fmfiuomxfx4gnvorj3z3y2gjf2doh/bin/g++
35-
f77: /home/spack/spack/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-11.4.0/gcc-12.3.0-hc3fmfiuomxfx4gnvorj3z3y2gjf2doh/bin/gfortran
36-
fc: /home/spack/spack/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-11.4.0/gcc-12.3.0-hc3fmfiuomxfx4gnvorj3z3y2gjf2doh/bin/gfortran
37-
flags: {}
38-
operating_system: ubuntu22.04
39-
target: x86_64
40-
modules: []
41-
environment: {}
42-
extra_rpaths: []

outputs/stacks/examples/5.spack.stack.yaml

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,3 @@ spack:
2828
view: false
2929
concretizer:
3030
unify: false
31-
compilers:
32-
- compiler:
33-
spec: gcc@=12.3.0
34-
paths:
35-
cc: /home/spack/spack/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-11.4.0/gcc-12.3.0-hc3fmfiuomxfx4gnvorj3z3y2gjf2doh/bin/gcc
36-
cxx: /home/spack/spack/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-11.4.0/gcc-12.3.0-hc3fmfiuomxfx4gnvorj3z3y2gjf2doh/bin/g++
37-
f77: /home/spack/spack/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-11.4.0/gcc-12.3.0-hc3fmfiuomxfx4gnvorj3z3y2gjf2doh/bin/gfortran
38-
fc: /home/spack/spack/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-11.4.0/gcc-12.3.0-hc3fmfiuomxfx4gnvorj3z3y2gjf2doh/bin/gfortran
39-
flags: {}
40-
operating_system: ubuntu22.04
41-
target: x86_64
42-
modules: []
43-
environment: {}
44-
extra_rpaths: []

outputs/stacks/examples/6.spack.stack.yaml

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,20 +27,6 @@ spack:
2727
- "py-scipy ^netlib-lapack"
2828
concretizer:
2929
unify: false
30-
compilers:
31-
- compiler:
32-
spec: gcc@=12.3.0
33-
paths:
34-
cc: /home/spack/spack/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-11.4.0/gcc-12.3.0-hc3fmfiuomxfx4gnvorj3z3y2gjf2doh/bin/gcc
35-
cxx: /home/spack/spack/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-11.4.0/gcc-12.3.0-hc3fmfiuomxfx4gnvorj3z3y2gjf2doh/bin/g++
36-
f77: /home/spack/spack/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-11.4.0/gcc-12.3.0-hc3fmfiuomxfx4gnvorj3z3y2gjf2doh/bin/gfortran
37-
fc: /home/spack/spack/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-11.4.0/gcc-12.3.0-hc3fmfiuomxfx4gnvorj3z3y2gjf2doh/bin/gfortran
38-
flags: {}
39-
operating_system: ubuntu22.04
40-
target: x86_64
41-
modules: []
42-
environment: {}
43-
extra_rpaths: []
4430
view:
4531
default:
4632
root: views/default

outputs/stacks/examples/7.spack.stack.yaml

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,20 +27,6 @@ spack:
2727
- "py-scipy ^netlib-lapack"
2828
concretizer:
2929
unify: false
30-
compilers:
31-
- compiler:
32-
spec: gcc@=12.3.0
33-
paths:
34-
cc: /home/spack/spack/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-11.4.0/gcc-12.3.0-hc3fmfiuomxfx4gnvorj3z3y2gjf2doh/bin/gcc
35-
cxx: /home/spack/spack/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-11.4.0/gcc-12.3.0-hc3fmfiuomxfx4gnvorj3z3y2gjf2doh/bin/g++
36-
f77: /home/spack/spack/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-11.4.0/gcc-12.3.0-hc3fmfiuomxfx4gnvorj3z3y2gjf2doh/bin/gfortran
37-
fc: /home/spack/spack/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-11.4.0/gcc-12.3.0-hc3fmfiuomxfx4gnvorj3z3y2gjf2doh/bin/gfortran
38-
flags: {}
39-
operating_system: ubuntu22.04
40-
target: x86_64
41-
modules: []
42-
environment: {}
43-
extra_rpaths: []
4430
view:
4531
default:
4632
root: views/default

outputs/stacks/examples/8.spack.stack.yaml

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,6 @@ spack:
2828
view: false
2929
concretizer:
3030
unify: false
31-
compilers:
32-
- compiler:
33-
spec: gcc@=12.3.0
34-
paths:
35-
cc: /home/spack/spack/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-11.4.0/gcc-12.3.0-hc3fmfiuomxfx4gnvorj3z3y2gjf2doh/bin/gcc
36-
cxx: /home/spack/spack/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-11.4.0/gcc-12.3.0-hc3fmfiuomxfx4gnvorj3z3y2gjf2doh/bin/g++
37-
f77: /home/spack/spack/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-11.4.0/gcc-12.3.0-hc3fmfiuomxfx4gnvorj3z3y2gjf2doh/bin/gfortran
38-
fc: /home/spack/spack/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-11.4.0/gcc-12.3.0-hc3fmfiuomxfx4gnvorj3z3y2gjf2doh/bin/gfortran
39-
flags: {}
40-
operating_system: ubuntu22.04
41-
target: x86_64
42-
modules: []
43-
environment: {}
44-
extra_rpaths: []
4531
modules:
4632
default:
4733
enable:

outputs/stacks/examples/9.spack.stack.yaml

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,6 @@ spack:
2828
view: false
2929
concretizer:
3030
unify: false
31-
compilers:
32-
- compiler:
33-
spec: gcc@=12.3.0
34-
paths:
35-
cc: /home/spack/spack/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-11.4.0/gcc-12.3.0-hc3fmfiuomxfx4gnvorj3z3y2gjf2doh/bin/gcc
36-
cxx: /home/spack/spack/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-11.4.0/gcc-12.3.0-hc3fmfiuomxfx4gnvorj3z3y2gjf2doh/bin/g++
37-
f77: /home/spack/spack/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-11.4.0/gcc-12.3.0-hc3fmfiuomxfx4gnvorj3z3y2gjf2doh/bin/gfortran
38-
fc: /home/spack/spack/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-11.4.0/gcc-12.3.0-hc3fmfiuomxfx4gnvorj3z3y2gjf2doh/bin/gfortran
39-
flags: {}
40-
operating_system: ubuntu22.04
41-
target: x86_64
42-
modules: []
43-
environment: {}
44-
extra_rpaths: []
4531
modules:
4632
default:
4733
enable:

tutorial_stacks.rst

Lines changed: 7 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ Setup the compiler
3939
The first step to build our stack is to setup the compiler we want to use later.
4040
This is currently an iterative process that can be done in two ways:
4141

42-
1. Install the compiler first, then register it in the environment
43-
2. Use a second environment just for the compiler
42+
1. Install the compiler first, then install the rest of the environment
43+
2. Install the compiler outside the environment (either in another environment or standalone)
4444

4545
Below, we'll use the first approach.
46-
For people interested, an example of the latter approach can be found `at this link <https://github.com/haampie/spack-intermediate-gcc-example/>`_.
46+
For people interested, an example of composing a compiler from another environment can be found `at this link <https://github.com/haampie/spack-intermediate-gcc-example/>`_.
4747

4848
Let's start by creating an environment in a directory of our choice:
4949

@@ -67,27 +67,6 @@ The next step is to concretize and install our compiler:
6767
.. literalinclude:: outputs/stacks/setup-2.out
6868
:language: console
6969

70-
Finally, let's register it as a new compiler in the environment:
71-
72-
.. literalinclude:: outputs/stacks/compiler-find-0.out
73-
:language: console
74-
75-
The ``spack location -i`` command returns the installation prefix for the spec being queried:
76-
77-
.. literalinclude:: outputs/stacks/compiler-find-1.out
78-
:language: console
79-
80-
This might be useful in general when scripting Spack commands, as the example above shows.
81-
Listing the compilers now shows the presence of ``gcc@12.3.0``:
82-
83-
.. literalinclude:: outputs/stacks/compiler-list-0.out
84-
:language: console
85-
86-
The manifest file at this point looks like:
87-
88-
.. literalinclude:: outputs/stacks/examples/1.spack.stack.yaml
89-
:language: yaml
90-
9170
We are ready to build more software with our newly installed GCC!
9271

9372
------------------------
@@ -350,7 +329,7 @@ Edit our ``spack.yaml`` file again.
350329

351330
.. literalinclude:: outputs/stacks/examples/6.spack.stack.yaml
352331
:language: yaml
353-
:emphasize-lines: 44-54
332+
:emphasize-lines: 30-40
354333

355334
In the configuration above we created two views, named ``default`` and ``full``.
356335
The ``default`` view consists of all the packages that are compiled with ``gcc@12``, but do not depend on either ``mpich`` or ``netlib-lapack``.
@@ -370,7 +349,7 @@ If we set the option to "roots", Spack links only the root packages into the vie
370349

371350
.. literalinclude:: outputs/stacks/examples/7.spack.stack.yaml
372351
:language: yaml
373-
:emphasize-lines: 49
352+
:emphasize-lines: 35
374353

375354
.. literalinclude:: outputs/stacks/view-1.out
376355
:language: console
@@ -412,7 +391,7 @@ The next step is to add some basic configuration to our ``spack.yaml`` to genera
412391

413392
.. literalinclude:: outputs/stacks/examples/8.spack.stack.yaml
414393
:language: yaml
415-
:emphasize-lines: 45-54
394+
:emphasize-lines: 31-40
416395

417396
In these few lines of additional configuration we told Spack to generate ``lmod`` module files in a subdirectory named ``modules``, using a hierarchy comprising both ``lapack`` and ``mpi``.
418397

@@ -444,7 +423,7 @@ To address all these needs we can complicate our ``modules`` configuration a bit
444423

445424
.. literalinclude:: outputs/stacks/examples/9.spack.stack.yaml
446425
:language: yaml
447-
:emphasize-lines: 55-70
426+
:emphasize-lines: 41-56
448427

449428
Regenerate the modules again:
450429

0 commit comments

Comments
 (0)