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
Copy file name to clipboardExpand all lines: 03_building_and_packaging/spack_demo.md
+17-31Lines changed: 17 additions & 31 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,28 +1,24 @@
1
1
# Packaging for High-Performance Computing (Notes)
2
2
3
-
**Note**: It is recommended to try out Spack in a fresh Docker container. To understand how Spack itself is installed, follow Step 1 in a fresh Ubuntu container. To make things simpler from Step 2 onwards, create a container from the [spack/ubuntu-jammy](https://hub.docker.com/r/spack/ubuntu-jammy) image, so that Spack is preinstalled.
3
+
**Note**: It is recommended to try out Spack in a fresh Docker container. To understand how Spack itself is installed, follow Step 1 in a fresh Ubuntu Noble container (`docker run --rm -it ubuntu:noble`). To make things simpler from Step 2 onwards, create a container from the [spack/ubuntu-noble](https://hub.docker.com/r/spack/ubuntu-noble) image, so that Spack is preinstalled.
4
4
5
5
## 1. Spack Setup/Installation
6
6
7
-
- Git repository of Python scripts
7
+
- This demo (and Spack) needs Python, Git, a C/C++ compiler, patch, make, tar, and a few more tools. Basically `build-essential`, `git`, and `python` on Ubuntu Noble.
-**Note:** Install `curl`, `libcurl4-openssl-dev`, and `vim` to ensure that Spack v0.23.0 works in a fresh Ubuntu Jammy container.
16
-
17
15
- Initializing Spack with
18
16
19
17
```bash
20
18
.<spack_prefix>/share/spack/setup-env.sh
21
19
```
22
20
23
-
will set `SPACK_ROOT` and also add `spack` to `PATH`.
24
-
25
-
Note that the `.` operator will run the commands in the supplied script as if we would type the commands supplied by the script in the shell ourselves. In bash the `.` operator is equivalent to `source`. However, `source` is not specified in POSIX and thus using `.` is likely to work on more platforms.
21
+
will set `SPACK_ROOT` and also add `spack` to `PATH`. Note that the `.` operator will run the commands in the supplied script as if we would type the commands supplied by the script in the shell ourselves. In bash the `.` operator is equivalent to `source`. However, `source` is not specified in POSIX and thus using `.` is likely to work on more platforms.
26
22
27
23
- Finish Spack setup
28
24
@@ -40,25 +36,23 @@
40
36
41
37
prints the list of compilers that Spack has added.
42
38
43
-
- Find external packages (optional)
39
+
- Find external packages
44
40
45
41
```bash
46
42
spack external find
47
43
```
48
44
49
45
This command tries to find preinstalled software packages which are also in Spack's package database. This way we do not have to recompile everything from scratch.
50
46
51
-
**Note**`spack external find` is an experimental feature and might fail. System packages [can be defined manually](https://spack.readthedocs.io/en/latest/getting_started.html#system-packages).
47
+
Found packages (including version, configuration etc.) are stored in `~/.spack/packages.yaml`. There one can add further packages manually. Look at contents of this file.
52
48
53
-
- Found packages (including version, configuration etc.) are stored in `~/.spack/packages.yaml`. There one can add further packages manually. **Note**: Maybe show content of this file.
54
-
55
-
- Concretize a spec to trigger bootstrap process (optional)
49
+
- Concretize a spec to trigger bootstrap process
56
50
57
51
```bash
58
52
spack spec zlib
59
53
```
60
54
61
-
This will try to concretize the package and its dependencies. `clingo`, Spack's concretizer, is needed for this. If one calls this command the very first time, a bootstrapping process is triggered that installs `clingo`.
55
+
This will try to concretize the package and its dependencies. `clingo`, Spack's concretizer, is needed for this. Running `spack spec` for the first time triggers a bootstrapping process that installs `clingo`.
62
56
63
57
## 2. Package Installation/Management with Spack
64
58
@@ -68,15 +62,7 @@
68
62
spack info zlib
69
63
```
70
64
71
-
- Install a simple example package
72
-
73
-
```bash
74
-
spack spec zlib
75
-
```
76
-
77
-
This will trigger the bootstrap process of Spack. It installs `clingo`, the dependency resolver, if not done before.
78
-
79
-
- Install `zlib`
65
+
- Install the package
80
66
81
67
```bash
82
68
spack install --reuse zlib
@@ -102,7 +88,7 @@
102
88
103
89
Spack will fetch the archive and try to deduce some basic settings. It will also check for other releases and asks whether to add checksums. We want all checksums.
104
90
105
-
-Afterwards Spack drops us in the boilerplate package.
91
+
- Spack immediately drops you in a boilerplate package file.
106
92
107
93
```Python
108
94
classHelloworld(CMakePackage):
@@ -133,7 +119,7 @@
133
119
134
120
At least the `FIXME` statements should be fixed before releasing the package. The Spack package recipe is written in Python so we can also do common Python magic here.
135
121
136
-
- Spack has deduced a good number of information already.
122
+
- Spack has deduced a good amount of information already.
0 commit comments