Skip to content

Commit eee1015

Browse files
authored
Merge pull request #60 from ARCTraining/jhodrien-2025-fixes-2
Update to Spack 1.1.0
2 parents b987a9e + 5de409a commit eee1015

9 files changed

Lines changed: 454 additions & 335 deletions

File tree

book/course/conda.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ We've discovered we also need the `statsmodels` package for some extra work we w
450450

451451
````{admonition} Searching for packages
452452

453-
Conda has a command-line search functionality that we describe below in the section [Use Conda to search for a package](#searching-for-packages); you can also use the [`conda-forge` repository](https://anaconda.org/conda-forge) or [`bioconda` repository](https://anaconda.org/bioconda) to search for packages.
453+
Conda has a command-line search functionality that we describe below in the section [Using Conda to search for a package](searching-for-packages); you can also use the [`conda-forge` repository](https://anaconda.org/conda-forge) or [`bioconda` repository](https://anaconda.org/bioconda) to search for packages.
454454
````
455455

456456
Once you have the name (and possibly version) of the package you want to install, again there are two different ways to add these packages, much like there were two ways to create the environment to begin with.

book/course/spack/advanced.md

Lines changed: 214 additions & 145 deletions
Large diffs are not rendered by default.

book/course/spack/containers.md

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Spack install software within.
88
To define your container, you create a YAML file that describes what you want.
99
Here's I'm saying I want spack to install gromacs with MPI enabled, and
1010
OpenMPI. I want it to create the container for Singularity/Apptainer, and I
11-
want it to make sure the libgomp1 package is installed onto the OS.
11+
want it to make sure the libgomp package is installed onto the OS.
1212

1313
spack.yaml:
1414

@@ -21,10 +21,13 @@ spack:
2121
# What I want it to create
2222
container:
2323
format: singularity
24+
images:
25+
os: almalinux:9
26+
spack: 1.1.0
2427
# Bonus OS packages I'd like installed
2528
os_packages:
2629
final:
27-
- libgomp1
30+
- libgomp
2831
# Additional config for the build process
2932
config:
3033
mount proc: yes
@@ -57,18 +60,10 @@ As a proof of life, let's run gromacs from within that container:
5760

5861
```bash
5962
$ apptainer run gromacs-openmpi.sif mpirun -np 4 gmx_mpi
60-
:-) GROMACS - gmx_mpi, 2024.4-spack (-:
63+
:-) GROMACS - gmx_mpi, 2025.3-spack (-:
6164

62-
Executable: /opt/software/linux-zen4/gromacs-2024.4-af5srsrjr7w2alftldvyek2chqu4rtls/bin/gmx_mpi
63-
Data prefix: /opt/software/linux-zen4/gromacs-2024.4-af5srsrjr7w2alftldvyek2chqu4rtls
64-
Working dir: /users/example/hpc2
65-
Command line:
66-
gmx_mpi
67-
68-
SYNOPSIS
69-
70-
gmx [-[no]h] [-[no]quiet] [-[no]version] [-[no]copyright] [-nice <int>]
71-
[-[no]backup]
65+
Executable: /opt/software/linux-zen4/gromacs-2025.3-ipqq3w22geizv4y6pdroneco3hq33xkj/bin/gmx_mpi
66+
Data prefix: /opt/software/linux-zen4/gromacs-2025.3-ipqq3w22geizv4y6pdroneco3hq33xkj
7267
...
7368
```
7469

book/course/spack/environments.md

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ Environments in Spack feel a whole lot like environments in Conda; they allow
44
you to bundle up a number of different pieces of software into a single entity,
55
making a single coherent collection.
66

7+
This is a very simple introduction, and really doesn't cover all the things
8+
you can do with environments, so if you're interested in these, please read
9+
the main documentation links in the [References](environments:references) section.
10+
711
## Creating an environment
812

913
Here's a minimal workflow for creating an environment:
@@ -13,17 +17,21 @@ Here's a minimal workflow for creating an environment:
1317
```bash
1418
spack env create myenv
1519
```
20+
- Activate it
21+
```bash
22+
spack env activate myenv
23+
```
1624

1725
- Add a list of software to it
1826

1927
```bash
20-
spack -e myenv add bash@5 python py-numpy py-scipy py-matplotlib openssl@3.0.15
28+
spack add bash@5 python py-numpy py-scipy py-matplotlib openssl@3.0.7
2129
```
2230

2331
- Tweak the config if required
2432

2533
```bash
26-
spack -e myenv config edit
34+
spack config edit
2735
```
2836

2937
Please review the references for more information on options here, but nothing
@@ -32,7 +40,7 @@ Here's a minimal workflow for creating an environment:
3240
- Validate the installation
3341

3442
```bash
35-
spack -e myenv concretize
43+
spack concretize
3644
```
3745

3846
[Concretizing](https://spack.readthedocs.io/en/latest/environments.html#spec-concretization)
@@ -42,7 +50,7 @@ Here's a minimal workflow for creating an environment:
4250
- Build and install the software
4351

4452
```bash
45-
spack -e myenv install
53+
spack install
4654
```
4755

4856
Note this follows the normal behaviour of Spack, reusing previously built
@@ -51,7 +59,8 @@ software, and external software you've told it to use.
5159
## Using an environment
5260

5361
Again, this feels very familiar to people used to Conda; you have to activate
54-
an environment before using it:
62+
an environment before using it (although we did actually do this earlier when
63+
we created it):
5564

5665
```bash
5766
spack env activate myenv
@@ -63,8 +72,8 @@ Once activated, you can confirm that it's really live:
6372
$ which bash
6473
~/spack/var/spack/environments/myenv/.spack-env/view/bin/bash
6574
$ bash --version
66-
GNU bash, version 5.2.26(1)-release (x86_64-pc-linux-gnu)
67-
Copyright (C) 2022 Free Software Foundation, Inc.
75+
GNU bash, version 5.3.3(1)-release (x86_64-pc-linux-gnu)
76+
Copyright (C) 2025 Free Software Foundation, Inc.
6877
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
6978

7079
This is free software; you are free to change and redistribute it.
@@ -79,7 +88,8 @@ You can leave an environment using:
7988
spack env deactivate
8089
```
8190

91+
(environments:references)=
8292
## References
8393

84-
- [Using Spack to Replace Homebrew/Conda](https://spack.readthedocs.io/en/latest/replace_conda_homebrew.html)
94+
- [Environment Basics](https://spack.readthedocs.io/en/latest/environments_basics.html)
8595
- [Environments](https://spack.readthedocs.io/en/latest/environments.html)

0 commit comments

Comments
 (0)