|
12 | 12 |
|
13 | 13 | - `v0.23.0` is currently the latest major release |
14 | 14 |
|
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. |
16 | 16 |
|
17 | 17 | - Initializing Spack with |
18 | 18 |
|
|
160 | 160 |
|
161 | 161 | We see that `cmake` is an implicit dependency as we need it for building our package. |
162 | 162 |
|
| 163 | +- If the same Docker container as in step 2 is used, make sure to uninstall `zlib` before installing `helloworld`. |
| 164 | + |
163 | 165 | - Make sure Spack finds external packages that `HelloWorld` needs |
164 | 166 |
|
165 | 167 | ```bash |
|
194 | 196 |
|
195 | 197 | This will concretize (internally, i.e. no output on terminal) and then build the software. |
196 | 198 |
|
| 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 | + |
197 | 207 | - **Optional**: one could add `main` branch and thus GitHub repository |
198 | 208 |
|
199 | 209 | ```diff |
200 | 210 | + git = "https://github.com/Simulation-Software-Engineering/HelloWorld.git" |
201 | 211 | + |
202 | | - + version('main', branch='main') |
| 212 | + + version("main", branch="main") |
203 | 213 | ``` |
204 | 214 |
|
205 | 215 | 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. |
206 | 216 |
|
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 | | - |
215 | 217 | - Add artificial dependencies |
216 | 218 |
|
217 | 219 | ```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") |
220 | 222 | ``` |
221 | 223 |
|
222 | 224 | 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 | 236 | - Add an artificial variant |
235 | 237 |
|
236 | 238 | ```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") |
240 | 242 | ``` |
241 | 243 |
|
242 | 244 | and check its existence |
|
0 commit comments