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: docs/environment/spack.md
+33-42Lines changed: 33 additions & 42 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,8 +7,8 @@
7
7
[Spack](https://spack.io/about/) is an open-source package manager designed for installing, building, and managing scientific software across a wide range of system including from personal computers to super computers. It supports multiple versions, compilers, and configurations of software packages, all coexisting in a single system without conflict. Spack provides with [over 8,500 ](https://packages.spack.io/)official software packages available since the `v1.0.0` release.Additionally users can also create [custom packages](https://spack-tutorial.readthedocs.io/en/latest/tutorial_packaging.html) via `package.py` files for software not yet available in the Spack pre-defined [packages](https://spack.readthedocs.io/en/latest/package_fundamentals.html).
8
8
9
9
10
-
Similar to [EasyBuild](https://docs.easybuild.io/), [Spack](https://spack.io/about/) is also available on the UL HPC platform for managing and installing scientific software in more flexible and customizable way.
11
-
At present, the UL HPC environment includes a pre-installed version of Spack,namely `devel/Spack/0.21.2` which can be accessed via the module system.
10
+
<!--Similar to [EasyBuild](https://docs.easybuild.io/), [Spack](https://spack.io/about/) is also available on the UL HPC platform for managing and installing scientific software in more flexible and customizable way.
11
+
At present, the UL HPC environment includes a pre-installed version of Spack,namely `devel/Spack/0.21.2` which can be accessed via the module system.-->
12
12
13
13
??? question "Why use automatic building tools like [Easybuild](https://docs.easybuild.io) or [Spack](https://spack.io/) on HPC environments?"
14
14
@@ -34,18 +34,9 @@ At present, the UL HPC environment includes a pre-installed version of Spack,nam
34
34
35
35
## Setting up Spack.
36
36
37
-
For all tests and compilation with Spack, it is essential to run on a **compute node**, not in the login/access node.
38
-
39
-
??? note "Connection to a compute node"
40
-
41
-
Here's an example of how to allocate an [interactive session](../jobs/interactive.md) in **Aion cluster**.
42
-
43
-
```{.sh .copy}
44
-
si -N 1 -n 16 -c 1 -t 0-02:00:00
45
-
```
46
-
47
-
This command requests a [job](../jobs/submit.md) with 1 node, 16 MPI processes (-n 16), and 1 CPU core per process (-c 1).The -n 16 option allows running up to 16 parallel processes, which can accelerate builds spack.However, these values are only examples and are not mandatory. Users may adjust the resource allocation according to their requirements or omit certain options entirely for simpler use cases.
37
+
!!! warning "Connect to a compute node"
48
38
39
+
For all tests and compilation with Spack, it is essential to run on a [**compute node**](../systems/iris/compute.md), not in the [**login/access**](../connect/access.md). For detailed information on resource allocation and job submission, visit the [**Slurm Job Management System**](../slurm/index.md).
49
40
50
41
51
42
### Clone & Setup Spack
@@ -56,10 +47,10 @@ To clone the Spack Repository:
Cloning the Spack repository creates a directory named spack, and by default, it uses the develop branch. However for improved stability switching to the latest official [release](https://github.com/spack/spack/releases) is recommended. The current release tags at that time `v1.0.0`. and to checkout the most recnet release `v1.0.0` :
53
+
Cloning the Spack repository creates a directory named spack, and by default, it uses the develop branch. However for improved stability switching to the latest official [release](https://github.com/spack/spack/releases) is recommended. The current release tags at that time `v1.0.0`. and to checkout the most recent release `v1.0.0` :
63
54
64
55
```{ .sh .copy }
65
56
cd spack
@@ -229,6 +220,7 @@ Then, add the following contents, which instructs Spack to use system-provided v
229
220
230
221
```
231
222
!!! note " Defining CUDA as an External Package"
223
+
// i need to adjust that .
232
224
233
225
Similarly, users can configure Spack to use a system-provided CUDA toolkit by adding the following example to the `packages.yaml` file. This helps Spack avoid rebuilding CUDA from source and ensures compatibility with the system GPU drivers and libraries:
234
226
``` { .sh .copy }
@@ -242,48 +234,47 @@ Then, add the following contents, which instructs Spack to use system-provided v
242
234
```
243
235
244
236
245
-
## Software installtion with Spack
237
+
## Installing softwares with Spack
246
238
!!! Note
247
-
This section will include examples and detailed instructions on how to install software using Spack. Relevant official documentation will also be linked to guide users through advanced usage and best practices.
239
+
In this section i will include examples and detailed instructions on how to install software using Spack and link to the relevant official documentation.
240
+
241
+
### Spack Environments
248
242
243
+
A Spack [environment](https://spack.readthedocs.io/en/latest/environments.html) lets users manage software and dependencies in an isolated and reproducible way.
249
244
250
-
### Useful Spack Commands.
245
+
!!! info
246
+
On shared clusters, it's highly recommended to use Spack environments to keep installations clean, avoid conflicts, and and simplify sharing or reproduction.
251
247
252
248
253
-
The following tables summarizes the basic commands for managing software packages with Spack, from searching and installation to managing the software environment.
249
+
To create and activate a Spack[environmen](https://spack.readthedocs.io/en/latest/environments.html):
|`spack list <package>`| Searches for packages matching the name or keyword.|
258
-
|` spack info <package>`| displays detailed information about that package|
259
-
|`spack install <package>`| Installs a new package on the cluster. |
260
-
|`spack uninstall <package>`| Removes an installed package from the cluster. |
261
-
|`spack load <package>`| Makes a package ready for use in the current session. |
262
-
|`spack unload <package>`| Removes a package from the current session's environment. |
263
-
|`spack help`| Displays general help and available subcommands. |
251
+
```{ .sh .copy }
252
+
spack env create test-env
253
+
spack env activate test-env
254
+
```
264
255
256
+
This command creates a Spack environment in the directory `$SPACK_ROOT/var/spack/environments/test-env`. It also generates a `spack.yaml` file—the main configuration file where users specify packages to install, compilers to use, and other settings specific to that `test-env` environment.For more details see the official [Spack Environment Tutorial](https://spack-tutorial.readthedocs.io/en/latest/tutorial_environments.html).
265
257
266
-
??? info "Further Reference"
267
-
For a comprehensive list of commands and advanced usage options, see the official Spack documentation:<ahref="https://spack.readthedocs.io/en/latest/command_index.html"target="_blank"><strong>Spack Command Index</strong></a>
258
+
### Spack Packages Installation:
268
259
260
+
Spack makes it easy to install software [packages](https://spack-tutorial.readthedocs.io/en/pearc22/tutorial_packaging.html#what-is-a-spack-package) from its extensive repository. To [install any package](https://spack.readthedocs.io/en/latest/package_fundamentals.html#installing-and-uninstalling) listed by spack list, use the following command: `spack install <package_name>`
269
261
270
-
### Spack Environments
271
262
272
-
A Spack environment is a powerful feature that allows users to manage sets of software packages, dependencies, and configurations in an isolated and reproducible way.
263
+
!!! details "Spack Packages Spec"
264
+
265
+
Spack uses a specific syntax to describe [package](https://spack.readthedocs.io/en/latest/packaging_guide_creation.html#structure-of-a-package) configurations during installation. Each configuration is called a [spec](https://spack.readthedocs.io/en/latest/spec_syntax.html) — a concise way to define package versions, compiler choices, variants, and dependencies.
Below is a list of commonly used Spack environment commands:
271
+
This installs `HDF5` package in version `1.10.7` with MPI support, explicitly specifying `mpich` version 3.3.2 and `zlib` version 1.2.11 as dependencies, all built with GCC 13.2.0.
For more technical details, see the official Spack documentation:<ahref="https://spack.readthedocs.io/en/latest/environments.html"target="_blank"><strong>Spack Environments</strong></a>
0 commit comments