Skip to content

Commit 0a25097

Browse files
committed
add a basic porting guide for stackinator 6/spack 1
1 parent 7d5ab38 commit 0a25097

File tree

3 files changed

+194
-1
lines changed

3 files changed

+194
-1
lines changed

docs/index.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,16 @@ To run stackinator [uv](https://docs.astral.sh/uv/getting-started/installation/)
2929

3030
### Versions
3131

32-
Stackinator version 6 will be the first release of Stackinator to support Spack 1.0, when it is released in June 2025.
32+
Stackinator version 6 will be the first release of Stackinator to support Spack 1.0, released in July 2025.
3333
There will be significant changes introduced in Spack 1.0, which will require making some non-trivial changes to Stackinator, and possibly adding breaking changes to the Stackinator recipe specification.
3434

3535
The git branch `releases/v5` will be maintained to provide support for all versions 0.21, 0.22 and 0.23 of Spack and existing recipes.
3636

3737
The `main` branch of Stackinator will contain
3838

39+
!!! info "Porting recipes to Spack 1.0"
40+
[Check out the guide][ref-porting] for porting recipes from Stackinator 5/Spack 0.23 to Stackinator 6/Spack 1.0.
41+
3942
## Quick Start
4043

4144
Stackinator generates the make files and spack configurations that build the spack environments that are packaged together in the spack stack.

docs/porting.md

Lines changed: 183 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,183 @@
1+
[](){#ref-porting}
2+
# Porting recipes to Spack 1.0
3+
4+
This guide covers the main differences between version 1 and version 2 of the Stackinator recipe format.
5+
Follow it to update uenv recipes that were created for Spack v0.23 and earlier to target Spack 1.0 using Stackinator 6.
6+
7+
## `config.yaml`
8+
9+
First, add `version: 2` as a specification in the config.yaml file to tell Stackinator that the recipe is in the new format.
10+
11+
Spack 1.0 moved the `builtin` package definition repository from the Spack main repository to its own standard location, which is now versioned separately.
12+
This change is reflected in the config file
13+
14+
!!! example
15+
=== "Stackinator 5"
16+
17+
```yaml title="config.yaml"
18+
name: prgenv-gnu
19+
store: /user-environment
20+
spack:
21+
repo: https://github.com/spack/spack.git
22+
commit: releases/v0.23
23+
modules: true
24+
description: "HPC development tools for building MPI applications with the GNU compiler toolchain"
25+
```
26+
27+
28+
=== "Stackinator 6"
29+
30+
```yaml title="config.yaml"
31+
name: prgenv-gnu
32+
store: /user-environment
33+
spack:
34+
repo: https://github.com/spack/spack.git
35+
commit: releases/v1.0
36+
packages: # (1)
37+
repo: https://github.com/spack/spack-packages.git
38+
commit: releases/v2025.07
39+
modules: true
40+
description: "HPC development tools for building MPI applications with the GNU compiler toolchain"
41+
version: 2 # (2)
42+
```
43+
44+
1. the `packages` field is new.
45+
1. don't forget to specify version 2.
46+
47+
## `compilers.yaml`
48+
49+
The format of the `compilers.yaml` file has been simplified, and support for llvm has been added.
50+
51+
There is no bootstrap compiler, and only a single version of `gcc`, `nvhpc` or `llvm` is allowed.
52+
Because of this, the compiler description is greatly streamlined.
53+
54+
!!! example "a gcc based uenv"
55+
This uenv uses `gcc@13` as the only compiler.
56+
57+
=== "Stackinator 5"
58+
59+
```yaml title="compilers.yaml"
60+
bootstrap:
61+
spec: gcc@12.3
62+
gcc:
63+
specs:
64+
- gcc@13
65+
```
66+
67+
68+
=== "Stackinator 6"
69+
70+
```yaml title="compilers.yaml"
71+
gcc:
72+
version: "13"
73+
```
74+
75+
!!! example "a gcc and nvhpc based uenv"
76+
This uenv uses `gcc@13` and `nvhpc@25.1`.
77+
78+
=== "Stackinator 5"
79+
80+
```yaml title="compilers.yaml"
81+
bootstrap:
82+
spec: gcc@12.3
83+
gcc:
84+
specs:
85+
- gcc@13.2
86+
llvm:
87+
requires: gcc@13
88+
specs:
89+
- nvhpc@25.1
90+
```
91+
92+
=== "Stackinator 6"
93+
94+
```yaml title="compilers.yaml"
95+
gcc:
96+
version: "13"
97+
nvhpc:
98+
version: "25.1"
99+
```
100+
101+
## `environments.yaml`
102+
103+
The main change in `environments.yaml` is how the compiler toolchain is specified.
104+
The compilers are provided as a list, without version information.
105+
106+
!!! example "a gcc based uenv"
107+
This uenv uses `gcc@13` as the only compiler.
108+
109+
=== "Stackinator 5"
110+
111+
```yaml title="environments.yaml"
112+
compiler:
113+
- toolchain: gcc
114+
spec: gcc
115+
```
116+
117+
=== "Stackinator 6"
118+
119+
```yaml title="environments.yaml"
120+
compiler: [gcc]
121+
```
122+
123+
!!! example "a gcc and nvhpc based uenv"
124+
This uenv uses `gcc@13` and `nvhpc@25.1`.
125+
126+
=== "Stackinator 5"
127+
128+
```yaml title="environments.yaml"
129+
compiler:
130+
- toolchain: gcc
131+
spec: gcc
132+
- toolchain: llvm
133+
spec: nvhpc
134+
```
135+
136+
=== "Stackinator 6"
137+
138+
```yaml title="environments.yaml"
139+
compiler: [gcc, nvhpc]
140+
```
141+
142+
Avoid specifying the compiler to use for `cray-mpich`, because this conflicts with the new Spack specification format.
143+
144+
!!! example "do not specify compiler to use for cray-mpich"
145+
This uenv uses `gcc@13` and `nvhpc@25.1`.
146+
147+
=== "Stackinator 5"
148+
149+
```yaml title="environments.yaml"
150+
mpi:
151+
spec: cray-mpich@8.1.30%nvhpc
152+
gpu: cuda
153+
```
154+
155+
=== "Stackinator 6"
156+
157+
```yaml title="environments.yaml"
158+
mpi:
159+
spec: cray-mpich@8.1.30
160+
gpu: cuda
161+
```
162+
163+
!!! note
164+
The method for specifying MPI and networking software stacks will be updated to give you more control over how MPI is compiled before Stackinator 6 is released.
165+
166+
Typically you want to install `cray-mpich` with `nvhpc` to support building Fortran applications with the `nvfortran` compiler.
167+
You can force this by adding `%fortran=nvhpc` to one of the specs in your environment that is compiled with Fortran, e.g.
168+
```yaml title="environments.yaml
169+
specs:
170+
- hdf5+mpi+hl+fortran %fortran=nvhpc
171+
```
172+
This will transitively require that `cray-mpich` be installed using `nvhpc`.
173+
174+
## `modules.yaml`
175+
176+
There are no changes required to the modules.yaml definition.
177+
178+
## repo
179+
180+
If your recipe contains custom package definitions in a , you may have to update these to support Spack 1.0.
181+
182+
If the package was based on one from Spack, have a look at the updated package definition for Spack 1.0.
183+
You can also look at changes that were made to similar custom packages in [alps-uenv](https://github.com/eth-cscs/alps-uenv) recipes when they were updated to Stackinator 6.0

mkdocs.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,23 @@ nav:
99
- 'Cluster Configuration': cluster-config.md
1010
- 'Interfaces': interfaces.md
1111
- 'Build Caches': build-caches.md
12+
- 'Spack 1.0': porting.md
1213
- 'Development': development.md
1314
# - Tutorial: tutorial.md
1415
theme:
1516
name: material
1617
features:
1718
- content.code.copy
19+
- content.code.annotate
1820
- navigation.tabs
1921
palette:
2022
primary: deep orange
2123
accent: deep orange
24+
plugins:
25+
- autorefs
2226
markdown_extensions:
2327
- attr_list # for internal links
28+
- md_in_html
2429
- admonition
2530
- pymdownx.details
2631
- pymdownx.superfences
@@ -31,6 +36,8 @@ markdown_extensions:
3136
- tables
3237
- toc:
3338
permalink: true
39+
- pymdownx.tabbed:
40+
alternate_style: true
3441
extra_css:
3542
- stylesheets/extra.css
3643
repo_url: https://github.com/eth-cscs/stackinator

0 commit comments

Comments
 (0)