|
7 | 7 | - Git repository of Python scripts |
8 | 8 |
|
9 | 9 | ```bash |
10 | | - git clone -b releases/v0.19 https://github.com/spack/spack.git |
| 10 | + git clone -b v0.23.0 -c feature.manyFiles=true --depth=2 https://github.com/spack/spack.git |
11 | 11 | ``` |
12 | 12 |
|
13 | | - - `v0.19` is currently the latest release |
14 | | - - Update to newer versions using `git pull`/`git checkout -b` |
| 13 | + - `v0.23.0` is currently the latest major release |
| 14 | + |
| 15 | +- **Note:** Install `curl`, `libcurl4-openssl-dev`, and `vim` to ensure that Spack v0.23.0 works in a fresh Ubuntu Jammy container. |
15 | 16 |
|
16 | 17 | - Initializing Spack with |
17 | 18 |
|
|
159 | 160 |
|
160 | 161 | We see that `cmake` is an implicit dependency as we need it for building our package. |
161 | 162 |
|
| 163 | +- If the same Docker container as in step 2 is used, make sure to uninstall `zlib` before installing `helloworld`. |
| 164 | + |
| 165 | +- Make sure Spack finds external packages that `HelloWorld` needs |
| 166 | + |
| 167 | + ```bash |
| 168 | + spack external find |
| 169 | + ``` |
| 170 | + |
162 | 171 | - Install package |
163 | 172 |
|
164 | 173 | ```bash |
|
187 | 196 |
|
188 | 197 | This will concretize (internally, i.e. no output on terminal) and then build the software. |
189 | 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 | + |
190 | 207 | - **Optional**: one could add `main` branch and thus GitHub repository |
191 | 208 |
|
192 | 209 | ```diff |
193 | 210 | + git = "https://github.com/Simulation-Software-Engineering/HelloWorld.git" |
194 | 211 | + |
195 | | - + version('main', branch='main') |
| 212 | + + version("main", branch="main") |
196 | 213 | ``` |
197 | 214 |
|
198 | 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. |
199 | 216 |
|
200 | | -- If one wants to edit the package later, there are two options |
201 | | - |
202 | | - ```bash |
203 | | - spack edit helloworld |
204 | | - ``` |
205 | | - |
206 | | - or open `package.py` file in `${HOME}/var/spack/repos/builtin/packages/helloworld/` |
207 | | - |
208 | 217 | - Add artificial dependencies |
209 | 218 |
|
210 | 219 | ```diff |
211 | | - + depends_on('python@3:', when='@0.3.0:') |
212 | | - + depends_on('zlib@:1.2') |
| 220 | + + depends_on("python@3:", when="@0.3.0:") |
| 221 | + + depends_on("zlib@:1.2") |
213 | 222 | ``` |
214 | 223 |
|
215 | 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` |
|
227 | 236 | - Add an artificial variant |
228 | 237 |
|
229 | 238 | ```diff |
230 | | - + variant('python', default=True, description='Enable Python support') |
231 | | - - depends_on('python@3:', when='@0.3.0:') |
232 | | - + 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") |
233 | 242 | ``` |
234 | 243 |
|
235 | 244 | and check its existence |
|
246 | 255 |
|
247 | 256 | `~` can be (often) used instead of `-`. There are [examples in the documentation](https://spack.readthedocs.io/en/latest/basic_usage.html#variants). |
248 | 257 |
|
249 | | -## Further reading |
| 258 | +## Further material |
250 | 259 |
|
251 | 260 | ### References |
252 | 261 |
|
|
0 commit comments