|
| 1 | +--- |
| 2 | +authors: [lorisercole, ocaisa, boegel] |
| 3 | +date: 2026-01-09 |
| 4 | +slug: Spack-on-top-of-EESSI-PoC |
| 5 | +--- |
| 6 | + |
| 7 | +# Using Spack on top of EESSI: A Proof of Concept |
| 8 | + |
| 9 | +<figure markdown="span"> |
| 10 | +{width=75%} |
| 11 | +</figure> |
| 12 | + |
| 13 | +EESSI provides a rich set of software installations, which were built and installed using |
| 14 | +[EasyBuild](https://easybuild.io). |
| 15 | + |
| 16 | +Can we convince [Spack](https://spack.io) to reuse software installed in EESSI, |
| 17 | +and by doing so make EESSI more attractive to those of you who prefer using Spack over EasyBuild? |
| 18 | + |
| 19 | +Several people have expressed interest in exposing the software installations provided by EESSI |
| 20 | +to Spack, so they can be used as dependencies when building and installing software with Spack. |
| 21 | + |
| 22 | +Recently, we have explored how this could be achieved through a proof-of-concept with [QuantumESPRESSO](https://www.quantum-espresso.org/). |
| 23 | + |
| 24 | +The goal here is to build and install only QuantumESPRESSO with Spack, |
| 25 | +and leveraging software installations from EESSI for all required dependencies, including the compiler and libraries for MPI, BLAS/LAPACK, FFTW, etc. |
| 26 | + |
| 27 | +<!-- more --> |
| 28 | + |
| 29 | +### Step 1: A Spack database for EESSI |
| 30 | + |
| 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) |
| 32 | +that Spack provides, which exposes software installed in EESSI to Spack. |
| 33 | + |
| 34 | +This was done through a Python script, and only for a small set of hand-picked software |
| 35 | +installations: those that are build or runtime dependencies of QuantumESPRESSO. |
| 36 | + |
| 37 | +Using `spack find`, we can check whether Spack is aware of these installations: |
| 38 | + |
| 39 | + |
| 40 | + |
| 41 | +Looks good so far... |
| 42 | + |
| 43 | + |
| 44 | +### Step 2: Checking required dependencies for QuantumESPRESSO |
| 45 | + |
| 46 | +Spack being aware of software installed in EESSI is not sufficient though. |
| 47 | +We need to make sure those installations are also actually *used* by Spack to resolve required dependencies. |
| 48 | + |
| 49 | +For this, we need to provide the necessary metadata for those installations, |
| 50 | +including which [*variants*](https://spack.readthedocs.io/en/latest/packaging_guide_creation.html#variants) they provide. |
| 51 | +When done correctly, we can see that all required dependencies are indeed resolved using `spack spec`: |
| 52 | + |
| 53 | + |
| 54 | + |
| 55 | +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. |
| 57 | + |
| 58 | + |
| 59 | +### Step 3: Installing QuantumESPRESSO with Spack |
| 60 | + |
| 61 | +The real test consist of actually trying to build and install QuantumESPRESSO using Spack, |
| 62 | +by running `spack install quantum-espresso`: |
| 63 | + |
| 64 | + |
| 65 | + |
| 66 | +That worked like charm! |
| 67 | + |
| 68 | + |
| 69 | +### Step 4: Running QuantumESPRESSO |
| 70 | + |
| 71 | +Finally, we try to actually *run* QuantumESPRESSO as it was installed with Spack. |
| 72 | + |
| 73 | +We set up the environment with `spack load quantum-espresso`, and feed an input file into the main command `pw.x`: |
| 74 | + |
| 75 | + |
| 76 | + |
| 77 | +This was just a simple single-core test, but it does seem to work as expected! |
| 78 | + |
| 79 | +When we inspect the `pw.x` binary a bit more closely, we can see that it (only) links to libraries provided by EESSI: |
| 80 | + |
| 81 | + |
| 82 | + |
| 83 | + |
| 84 | +It's clear that more work needs to be done to further validate the installation and check its performance, |
| 85 | +but this is a nice first step... |
| 86 | + |
| 87 | + |
| 88 | +### More information & updates |
| 89 | + |
| 90 | +This work is being done in collaboration with member of the Spack development team, |
| 91 | +including Todd Gamblin and Massimiliano Culpo. |
| 92 | + |
| 93 | +For updates, check the [dedicated support issue](https://gitlab.com/eessi/support/-/issues/170) |
| 94 | +that was opened on using Spack on top of EESSI, or stay tuned for future blog posts! |
0 commit comments