Skip to content

Commit 527666a

Browse files
authored
Merge pull request #675 from lorisercole/blog/eessi
Add 2nd Blog post on Spack+EESSI, + corrections to 1st
2 parents f190c8b + 2d9b674 commit 527666a

6 files changed

Lines changed: 225 additions & 3 deletions

docs/blog/posts/2026/01/Spack-on-top-of-EESSI-PoC.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ and leveraging software installations from EESSI for all required dependencies,
2828

2929
### Step 1: A Spack database for EESSI
3030

31-
To get started, we created an external *Spack database* using the [`spack.database.Database` class](https://spack.readthedocs.io/en/latest/spack.html#module-spack.database)
31+
To get started, we created an external ("upstream") *Spack database* using (a modded version of) the [`spack.database.Database` class](https://spack.readthedocs.io/en/latest/spack.html#module-spack.database)
3232
that Spack provides, which exposes software installed in EESSI to Spack.
3333

3434
This was done through a Python script, and only for a small set of hand-picked software
@@ -38,7 +38,7 @@ Using `spack find`, we can check whether Spack is aware of these installations:
3838

3939
![Spack database for software installations included in EESSI](spack-eessi-20251106-001.webp)
4040

41-
Looks good so far...
41+
The `[^]` symbol indicates a package that is provided by our custom "upstream" database. Looks good so far...
4242

4343

4444
### Step 2: Checking required dependencies for QuantumESPRESSO
@@ -53,7 +53,7 @@ When done correctly, we can see that all required dependencies are indeed resolv
5353
![Checking required dependencies with `spack spec`](spack-eessi-20251106-002.webp)
5454

5555
Here, we use `@7.4.1` to specify the QuantumESPRESSO version we want to install,
56-
and `~mpi` to ensure that the QuantumESPRESSO installation will have MPI support.
56+
and `~mpi` to disable MPI support, for the sake of this simple exercise.
5757

5858

5959
### Step 3: Installing QuantumESPRESSO with Spack
@@ -90,5 +90,7 @@ but this is a nice first step...
9090
This work is being done in collaboration with members of the Spack development team,
9191
including Todd Gamblin and Massimiliano Culpo.
9292

93+
The code and scripts developed for this proof-of-concept are available in the [Spood repository](https://github.com/lorisercole/spood). See "Approach #2 [legacy]" in the README for implementation details.
94+
9395
For updates, check the [dedicated support issue](https://gitlab.com/eessi/support/-/issues/170)
9496
that was opened on using Spack on top of EESSI, or stay tuned for future blog posts!
Lines changed: 220 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,220 @@
1+
---
2+
authors: [lorisercole]
3+
date: 2026-02-05
4+
slug: Spack-on-top-of-EESSI-best-of-both-worlds
5+
---
6+
7+
# Using Spack on Top of EESSI: Best of Both Worlds
8+
9+
<figure markdown="span">
10+
![Spack + EESSI](../01/spack-plus-eessi.webp){width=75%}
11+
</figure>
12+
13+
The HPC software landscape offers powerful tools for managing scientific software, such as [EasyBuild](https://easybuild.io) and [Spack](https://spack.io).
14+
15+
[EESSI](https://www.eessi.io) provides a ready-to-use software stack with thousands of optimized software installations that were built with EasyBuild.
16+
17+
Imagine you are working on an HPC system with EESSI already available. You have access to a wealth of optimized installations for scientific software packages, libraries, tools, as well as compilers. But you need to install a new tool or a specific version of a package that's not in EESSI yet.
18+
19+
You can already extend EESSI with new software through the [EESSI-extend](../../../../using_eessi/building_on_eessi.md) module.
20+
This utility provides you with a pre-configured EasyBuild installation that you can use to build packages from [easyconfig files](https://docs.easybuild.io/terminology/#easyconfig_files).
21+
22+
Like EasyBuild, [Spack](https://spack.io) is a flexible build tool that also offers a vast repository of build recipes maintained by a large and active community, making it a familiar tool for many HPC users.
23+
By enabling Spack to leverage software installations already available in EESSI as dependencies, we can offer users the best of both worlds: the convenience of a pre-built, optimized software stack combined with the flexibility to quickly build new packages using tools they already know.
24+
25+
<!-- more -->
26+
27+
28+
In a previous [blog post](../01/Spack-on-top-of-EESSI-PoC.md), we presented a first proof-of-concept implementation of this vision.
29+
We used a custom-built upstream database to make Spack aware of EESSI's software stack and managed to build a new Quantum ESPRESSO installation that reused dependencies from EESSI.
30+
31+
Thanks to recent updates to Spack (in particular, treating externals as concrete specs and allowing the definition of dependencies – see [this pull request in Spack](https://github.com/spack/spack/pull/51118)) and an active collaboration with its developers, it is now possible to connect Spack and EESSI in a *seamless* and *Spack-native* way.
32+
33+
## How it works
34+
35+
Spack 1.1+ introduces external packages treated as concrete specs (i.e. like any other spec), with dependency support, allowing us to expose software installed in EESSI as externals along with their dependencies.
36+
This is the proper, *Spack-onic* way to achieve our goal, and it does not require any modification of Spack's source code, nor the creation of a custom database.
37+
38+
!!! note
39+
40+
Currently we need to add a small patch to Spack to make sure its compiler wrapper works correctly
41+
with the unusual sysroot configuration of EESSI. This is a known
42+
[issue](https://github.com/spack/spack/issues/51582) that will be addressed in future Spack releases.
43+
44+
We implement the following workflow to connect Spack to EESSI, and build a new Quantum ESPRESSO with Spack reusing EESSI packages as dependencies.
45+
46+
47+
### Step 1 – External packages for EESSI software layer
48+
49+
Declare software installations in EESSI software layer as [external packages](https://spack.readthedocs.io/en/latest/packages_yaml.html#external-packages) in a `packages.yaml` configuration file with [external dependencies](https://spack.readthedocs.io/en/latest/packages_yaml.html#specifying-dependencies-among-external-packages).
50+
51+
```yaml
52+
# Example of packages.yaml file for EESSI software stack without compat-layer packages (to be added by detection tool)
53+
# EESSI detected microarchitecture: haswell
54+
packages:
55+
gcc:
56+
externals:
57+
- spec: gcc@13.2.0 languages:='c,c++,fortran' target=haswell
58+
prefix: /cvmfs/software.eessi.io/versions/2023.06/software/linux/x86_64/intel/haswell/software/GCCcore/13.2.0
59+
dependencies: []
60+
extra_attributes:
61+
compilers:
62+
c: /cvmfs/software.eessi.io/versions/2023.06/software/linux/x86_64/intel/haswell/software/GCCcore/13.2.0/bin/gcc
63+
cxx: /cvmfs/software.eessi.io/versions/2023.06/software/linux/x86_64/intel/haswell/software/GCCcore/13.2.0/bin/g++
64+
fortran: /cvmfs/software.eessi.io/versions/2023.06/software/linux/x86_64/intel/haswell/software/GCCcore/13.2.0/bin/gfortran
65+
gmake:
66+
externals:
67+
- spec: gmake@4.4.1 target=haswell
68+
prefix: /cvmfs/software.eessi.io/versions/2023.06/software/linux/x86_64/intel/haswell/software/make/4.4.1-GCCcore-13.2.0
69+
dependencies:
70+
- spec: gcc@13.2.0 target=haswell
71+
openblas:
72+
externals:
73+
- spec: openblas@0.3.24~ilp64 threads=openmp target=haswell
74+
prefix: /cvmfs/software.eessi.io/versions/2023.06/software/linux/x86_64/intel/haswell/software/OpenBLAS/0.3.24-GCC-13.2.0
75+
dependencies:
76+
- spec: gcc@13.2.0 target=haswell
77+
fftw:
78+
externals:
79+
- spec: fftw@3.3.10~mpi+openmp+shared precision=float,double,long_double,quad target=haswell
80+
prefix: /cvmfs/software.eessi.io/versions/2023.06/software/linux/x86_64/intel/haswell/software/FFTW/3.3.10-GCC-13.2.0
81+
dependencies:
82+
- spec: gcc@13.2.0 target=haswell
83+
curl:
84+
externals:
85+
- spec: curl@8.3.0+nghttp2 target=haswell
86+
prefix: /cvmfs/software.eessi.io/versions/2023.06/software/linux/x86_64/intel/haswell/software/cURL/8.3.0-GCCcore-13.2.0
87+
dependencies:
88+
- spec: gcc@13.2.0 target=haswell
89+
- spec: zlib@1.2.13 # compat
90+
deptypes:
91+
- link
92+
- spec: openssl@1.1.1w # compat
93+
deptypes:
94+
- build
95+
- link
96+
libarchive:
97+
externals:
98+
- spec: libarchive@3.7.2 target=haswell
99+
prefix: /cvmfs/software.eessi.io/versions/2023.06/software/linux/x86_64/intel/haswell/software/libarchive/3.7.2-GCCcore-13.2.0
100+
dependencies:
101+
- spec: gcc@13.2.0 target=haswell
102+
cmake:
103+
externals:
104+
- spec: cmake@3.31.8 target=haswell
105+
prefix: /cvmfs/software.eessi.io/versions/2023.06/software/linux/x86_64/intel/haswell/software/CMake/3.27.6-GCCcore-13.2.0
106+
dependencies:
107+
- spec: gcc@13.2.0 target=haswell
108+
- spec: curl@8.3.0 target=haswell
109+
deptypes:
110+
- build
111+
- link
112+
- spec: ncurses@6.4.20230401 # compat
113+
deptypes:
114+
- build
115+
- link
116+
- spec: zlib@1.2.13 # compat
117+
deptypes:
118+
- build
119+
- link
120+
- spec: libarchive@3.7.2 target=haswell
121+
deptypes:
122+
- build
123+
- link
124+
- spec: bzip2@1.0.8 # compat
125+
deptypes:
126+
- link
127+
- spec: openssl@1.1.1w # compat
128+
deptypes:
129+
- build
130+
- link
131+
132+
```
133+
134+
*Variants* (e.g. `~mpi+openmp`) should be specified to the best of our knowledge. By default, Spack will fill in the gaps with the package's default variants.
135+
136+
*Link* and *runtime dependencies* should be specified whenever possible. Pure build dependencies are not needed (the only exception being the *compiler*, since Spack can reuse this information). A dependency spec should unambiguously point to another declared external package. If an ambiguity exists, Spack will throw an error.
137+
138+
Many packages in EESSI depends on packages of the compatibility layer (e.g. `zlib`), that were filtered out during the build process. To detect these packages, see the [next step](#step-2-optional-suggested-eessi-compat-layer).
139+
140+
Since software installations in EESSI are always RPATH'ed to their dependencies, linking will likely work in most real-case scenarios even if you forget to declare some dependencies.
141+
142+
143+
### Step 2 – (optional, suggested) EESSI compatibility layer
144+
145+
It is possible to detect software installations available in the EESSI compatibility layer and configure Spack to use them as externals.
146+
In EESSI, these are often dependencies of software installations in the software layer (see previous example), so it is suggested to include them.
147+
148+
This can be done automatically via `spack external find`:
149+
150+
<script src="https://asciinema.org/a/ZPTl79rWWYdmMqIf.js" id="asciicast-ZPTl79rWWYdmMqIf" async="true"></script>
151+
152+
153+
### Step 3 – Show configured externals
154+
155+
Externals can then be listed via `spack find --show-configured-externals`.
156+
These packages will get reused during Spack solves by default.
157+
158+
![Show configured externals](spack-eessi-20260205-001.webp)
159+
160+
161+
### Step 4 – Build a new Quantum ESPRESSO with Spack
162+
163+
We can now build new packages with Spack, reusing EESSI installations as dependencies!
164+
Let's try this out by building a new Quantum ESPRESSO with Spack.
165+
166+
We first check what the concretizer comes up with, using `spack spec -I quantum-espresso~mpi`:
167+
168+
![Spack spec for quantum-espresso](spack-eessi-20260205-002.webp)
169+
170+
Looks good! Spack is reusing EESSI packages as external dependencies.
171+
It only needs to build the new `quantum-espresso` itself and a few Spack-specific packages: `compiler-wrapper` that is Spack's compiler wrapper, and `gcc-runtime` that is a local copy of the GCC runtime libraries that are provided by EESSI's `gcc@13.2.0`.
172+
173+
Finally, we can proceed with the installation with `spack install quantum-espresso~mpi`:
174+
175+
<script src="https://asciinema.org/a/1FQKm1E31JpKxY8O.js" id="asciicast-1FQKm1E31JpKxY8O" async="true"></script>
176+
177+
178+
### Step 5 – Verify and run Quantum ESPRESSO
179+
180+
Finally, we can verify that the new Quantum ESPRESSO installation works correctly by running it:
181+
182+
![Running Quantum ESPRESSO installed with Spack](spack-eessi-20260205-003.webp)
183+
184+
When we inspect the `pw.x` binary, we can see that it links to libraries provided by EESSI:
185+
186+
![Inspecting the list of libraries that `pw.x` binary links to](spack-eessi-20260205-004.webp)
187+
188+
(the only exception being `libgomp`, `libgfortran`, `libgcc_s` which come from the `gcc-runtime` package that Spack installs).
189+
190+
191+
## Demo code
192+
193+
A demonstrated implementation of the presented approach is now available in the [Spood repository](https://github.com/lorisercole/spood).
194+
195+
A simple [example script](https://github.com/lorisercole/spood/blob/develop/quick_start.sh) showcases the workflow.
196+
It only requires a running EESSI environment and a patched Spack installation (see instructions in the [README](https://github.com/lorisercole/spood/blob/develop/README.md)):
197+
198+
<script src="https://asciinema.org/a/9ev5dA1e4sHvNigz.js" id="asciicast-9ev5dA1e4sHvNigz" async="true"></script>
199+
200+
201+
## Conclusions and outlook
202+
203+
The workflow we presented is a simple demonstration of how Spack can be integrated with EESSI to leverage its optimized software stack.
204+
More complex scenarios, like building MPI-enabled packages and pre-configured toolchains, are being actively explored.
205+
206+
A complete integration of Spack with EESSI will require building some automation around the generation of the `packages.yaml` files to keep them in sync with EESSI updates, as well as further testing and validation of various build scenarios.
207+
208+
Such an integration will open powerful workflows for HPC users and administrators, allowing new software to be built quickly on top of EESSI's stable, optimized base by leveraging either Spack or EasyBuild.
209+
210+
The future of HPC software management is not about choosing between distributions and package managers: it is about making them work together seamlessly.
211+
212+
---
213+
214+
### Learn more and get involved
215+
216+
We encourage you to join the discussion on the `#spack` channel of [EESSI Slack]({{ config.extra.slack_invite_url }}), as well as our weekly [EESSI Happy Hour sessions](https://www.eessi.io/docs/training-events/happy-hours-sessions/), and share your experiences and suggestions!
217+
218+
### Acknowledgements
219+
220+
This work was made possible thanks to the collaboration with the Spack development team, in particular [Todd Gamblin](https://github.com/tgamblin) and [Massimiliano Culpo](https://github.com/alalazo), as well as EESSI team members [Kenneth Hoste](https://github.com/boegel) and [Alan O'Cais](https://github.com/ocaisa).
422 KB
Loading
161 KB
Loading
116 KB
Loading
158 KB
Loading

0 commit comments

Comments
 (0)