ALPS Installation on Mac/Linux from Spack Packages
Spack Installation
If you plan to use a parallel version of ALPS or run ALPS in a supercomputer environment, besides the source installation you can also install it through the Spack package management tool. You are encouraged to check out the details about ALPS package in Spack and the Spack documentation.
Spack is able to determine the ALPS dependencies and will install the correct versions required by ALPS. The installation is also local to each user in their own home directory, so it does not affect other users in the same computer cluster.
Installation Steps
First, Spack needs to be cloned from the GitHub repository:
git clone --depth=2 https://github.com/spack/spack.gitThis creates a directory called spack. You can source the appropriate script for your shell.
For bash, zsh, and sh users:
. spack/share/spack/setup-env.shFor csh and tcsh users:
source spack/share/spack/setup-env.cshNext, Spack needs to find all available compilers in your computer:
spack compiler findThis command will enable Spack to detect all available compilers in the system and create a file packages.yaml under the hidden .spack directory in your home directory. It can be viewed/edited with the command:
spack config edit packagesAlternatively, you can view the available compilers through:
spack compilersThe minimum compiler versions required are gcc@10.5.0 and clang@13.0.1.
We can take a look at ALPS information page in Spack:
spack info alpsIt shows the package dependencies of ALPS. All the related packages will be automatically installed through Spack’s package management system.
Finally, let us install ALPS!
spack install alpsspack load alpsSpack Installation on Supercomputer Clusters
If you need to install ALPS on a supercomputer cluster, we recommend submitting a batch job to install ALPS through a job node instead of running the above commands on a login node. Since the installation sometimes takes a long time, using login node to install ALPS could affect other users of the cluster.
We have successfully installed ALPS on the following supercomputer clusters: NCSA Delta (Illinois), PSC Bridges (Pittsburgh), Purdue Anvil, SDSC Expanse (San Diego), TACC Stampede3 (Texas). Please read their documentation about how to submit a batch job.
Troubleshooting
spack: command not found, or Spack only works inside the spack directory
Spack’s shell setup script has to be sourced in every new terminal session, using the path to your spack directory:
. /path/to/spack/share/spack/setup-env.shTo make this permanent, add that line to your shell startup file (e.g. ~/.zshrc or ~/.bashrc).
Choosing the Python interpreter used by Spack
Spack uses the first python3 (or python) it finds on your PATH. To use a different interpreter, set the SPACK_PYTHON environment variable (Spack ignores the PYTHON variable):
export SPACK_PYTHON=/path/to/python3
. spack/share/spack/setup-env.sh
spack python -c "import sys; print(sys.executable)"The last command prints the interpreter that Spack is actually using.
SSL: CERTIFICATE_VERIFY_FAILED on macOS
If every download fails with an error like
[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificateSpack is most likely running under a Python installed from python.org (located under /Library/Frameworks/Python.framework/). This Python does not use the macOS system certificates, so its certificate bundle must be installed once for each Python version:
"/Applications/Python 3.x/Install Certificates.command"Replace 3.x with your Python version (e.g. 3.14). Alternatively, tell Spack to use Apple’s system Python, which uses the macOS certificate store:
export SPACK_PYTHON=/usr/bin/python3AttributeError: module 'os' has no attribute 'O_PATH'
os.O_PATH only exists on Linux. Spack development checkouts from May 2026 used it unconditionally (spack/spack#52334); this was fixed in spack/spack#52447.
- On macOS: switching the Python interpreter does not fix this error. Update Spack to v1.2.0 or later (run
git pull, orgit checkout v1.2.2, inside thespackdirectory). - On Linux: update your Spack checkout (run
git pullinside thespackdirectory), or run Spack with a different Python interpreter viaSPACK_PYTHON(see above).
If your problem is not listed here, please search or open an issue on GitHub.