Skip to content

Commit 7d5ab38

Browse files
committed
add notes on next steps
1 parent bc3d955 commit 7d5ab38

File tree

2 files changed

+31
-1
lines changed

2 files changed

+31
-1
lines changed

compilers.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,31 @@
1+
## proposal
2+
3+
Generate: `spack:packages:all:prefer: ['%[when=%c] c=[{compilers[0]}] %[when=%cxx] cxx={compilers[0]} %[when=%fortran] fortran={compilers[0]}']`
4+
5+
The user can then manually customise specs, e.g. `%fortran=nvhpc`, on a per-package basis.
6+
7+
This approach is a little ad-hoc, but gets the job done for now.
8+
9+
For a future change, I would propose adding a new `toolchain` field to the field that lets the recipe author provide a specific toolchain that would be implemented as a Spack toolchain or using a `require`
10+
11+
```
12+
default:
13+
compiler: [gcc, nvhpc]
14+
toolchain:
15+
c: gcc
16+
cxx: gcc
17+
fortran: nvhpc
18+
mpi:
19+
spec: cray-mpich@8.1.30
20+
gpu: cuda
21+
specs:
22+
...
23+
```
24+
25+
By not using "spack syntax" for the `toolchain` spec, we would have the freedom to generate an elaborate `require` statement, or create a proper `toolchain`.
26+
27+
## working
28+
129
TODO:
230
- remove the requirement (which is overly broad and blocks us from using `requires` below)
331
- link: [github.com/eth-cscs/alps-cluster-config](https://github.com/eth-cscs/alps-cluster-config/blob/main/site/spack_repo/alps/packages/cray_mpich/package.py#L80-L85)

stackinator/recipe.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,9 @@ def generate_environment_specs(self, raw):
358358
# Which will compile the upstream MPI with nvfortran, as well as downstream dependendencies.
359359
if config["prefer"] is None:
360360
compiler = config["compiler"][0]
361-
config["prefer"] = [f"%[when=%c] c={compiler} %[when=%cxx] cxx={compiler} %[when=%fortran] fortran={compiler}"]
361+
config["prefer"] = [
362+
f"%[when=%c] c={compiler} %[when=%cxx] cxx={compiler} %[when=%fortran] fortran={compiler}"
363+
]
362364

363365
# An awkward hack to work around spack not supporting creating activation
364366
# scripts for each file system view in an environment: it only generates them

0 commit comments

Comments
 (0)