Skip to content

Commit 5f0a0c4

Browse files
committed
refine spack introductory section
1 parent c9c6f20 commit 5f0a0c4

File tree

1 file changed

+33
-42
lines changed

1 file changed

+33
-42
lines changed

docs/environment/spack.md

Lines changed: 33 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
[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).
88

99

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. -->
1212

1313
??? question "Why use automatic building tools like [Easybuild](https://docs.easybuild.io) or [Spack](https://spack.io/) on HPC environments?"
1414

@@ -34,18 +34,9 @@ At present, the UL HPC environment includes a pre-installed version of Spack,nam
3434

3535
## Setting up Spack.
3636

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"
4838

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).
4940

5041

5142
### Clone & Setup Spack
@@ -56,10 +47,10 @@ To clone the Spack Repository:
5647

5748
``` { .sh .copy }
5849
cd $HOME
59-
git clone -c feature.manyFiles=true https://github.com/spack/spack.git
50+
git clone --depth=2 --branch=releases/v1.0.0 https://github.com/spack/spack.git
6051
```
6152

62-
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` :
6354

6455
``` { .sh .copy }
6556
cd spack
@@ -229,6 +220,7 @@ Then, add the following contents, which instructs Spack to use system-provided v
229220

230221
```
231222
!!! note " Defining CUDA as an External Package"
223+
// i need to adjust that .
232224

233225
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:
234226
``` { .sh .copy }
@@ -242,48 +234,47 @@ Then, add the following contents, which instructs Spack to use system-provided v
242234
```
243235

244236

245-
## Software installtion with Spack
237+
## Installing softwares with Spack
246238
!!! 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
248242

243+
A Spack [environment](https://spack.readthedocs.io/en/latest/environments.html) lets users manage software and dependencies in an isolated and reproducible way.
249244

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.
251247

252248

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):
254250

255-
| Spack Command | Description |
256-
|------------------------------|--------------------------------------------------------------|
257-
|`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+
```
264255

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).
265257

266-
??? info "Further Reference"
267-
For a comprehensive list of commands and advanced usage options, see the official Spack documentation:<a href="https://spack.readthedocs.io/en/latest/command_index.html" target="_blank"><strong>Spack Command Index</strong></a>
258+
### Spack Packages Installation:
268259

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>`
269261

270-
### Spack Environments
271262

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.
266+
267+
``` { .sh .copy }
268+
spack install hdf5@1.10.7 +mpi ^mpich@3.3.2 ^zlib@1.2.11 %gcc@13.2.0
269+
```
273270

274-
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.
275272

276-
| Spack Command | Description |
277-
|-----------------------------------|-----------------------------------------------------------------------------|
278-
| `spack env create <env_name>` | Creates a new Spack environment with the specified name. |
279-
| `spack env activate <env_name>` | Activates the specified Spack environment. |
280-
| `spack env status` | Displays the currently active Spack environment. |
281-
| `spack env deactivate` | Deactivates the currently active environment. |
282-
| `spack concretize` | Prepares a full dependency spec for an environment or package before install. |
273+
<!-- ![](https://spack.readthedocs.io/en/latest/_images/spec_anatomy.svg) -->
283274

284275

285-
??? info "Further Reference"
286-
For more technical details, see the official Spack documentation:<a href="https://spack.readthedocs.io/en/latest/environments.html" target="_blank"><strong>Spack Environments</strong></a>
287276

277+
### Creating your own packages
288278

289279

280+
### Spack Binary Cache

0 commit comments

Comments
 (0)