Skip to content

Commit 0c9d839

Browse files
committed
Update Spack demo notes
1 parent 77fad0f commit 0c9d839

File tree

1 file changed

+17
-15
lines changed

1 file changed

+17
-15
lines changed

03_building_and_packaging/spack_demo.md

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
- `v0.23.0` is currently the latest major release
1414

15-
- Install `curl`, `libcurl4-openssl-dev`, and `vim` to ensure that Spack v0.23.0 works in a Ubuntu Jammy container.
15+
- **Note:** Install `curl`, `libcurl4-openssl-dev`, and `vim` to ensure that Spack v0.23.0 works in a fresh Ubuntu Jammy container.
1616

1717
- Initializing Spack with
1818

@@ -160,6 +160,8 @@
160160

161161
We see that `cmake` is an implicit dependency as we need it for building our package.
162162

163+
- If the same Docker container as in step 2 is used, make sure to uninstall `zlib` before installing `helloworld`.
164+
163165
- Make sure Spack finds external packages that `HelloWorld` needs
164166

165167
```bash
@@ -194,29 +196,29 @@
194196

195197
This will concretize (internally, i.e. no output on terminal) and then build the software.
196198

199+
- If one wants to edit the package later, there are two options
200+
201+
```bash
202+
spack edit helloworld
203+
```
204+
205+
or open `package.py` file in `${HOME}/var/spack/repos/builtin/packages/helloworld/`
206+
197207
- **Optional**: one could add `main` branch and thus GitHub repository
198208

199209
```diff
200210
+ git = "https://github.com/Simulation-Software-Engineering/HelloWorld.git"
201211
+
202-
+ version('main', branch='main')
212+
+ version("main", branch="main")
203213
```
204214

205215
This can also be used for `develop` branches etc. It is useful if one needs really the newest version of a package or if one develops software using Spack.
206216

207-
- If one wants to edit the package later, there are two options
208-
209-
```bash
210-
spack edit helloworld
211-
```
212-
213-
or open `package.py` file in `${HOME}/var/spack/repos/builtin/packages/helloworld/`
214-
215217
- Add artificial dependencies
216218

217219
```diff
218-
+ depends_on('python@3:', when='@0.3.0:')
219-
+ depends_on('zlib@:1.2')
220+
+ depends_on("python@3:", when="@0.3.0:")
221+
+ depends_on("zlib@:1.2")
220222
```
221223

222224
This means that the package depends on Python `3.0.0` or newer and newer if we use `helloworld` of version `0.3.0` or newer. The software also requires at most `zlib` in version `1.2.10`
@@ -234,9 +236,9 @@
234236
- Add an artificial variant
235237

236238
```diff
237-
+ variant('python', default=True, description='Enable Python support')
238-
- depends_on('python@3:', when='@0.3.0:')
239-
+ depends_on('python@3:', when='@0.3.0:+python')
239+
- depends_on("python@3:", when="@0.3.0:")
240+
+ variant("python", default=True, description="Enable Python support")
241+
+ depends_on("python@3:", when="@0.3.0:+python")
240242
```
241243

242244
and check its existence

0 commit comments

Comments
 (0)