Library / SDK
spack/spack avatar
spack/spack

Spack's spec line, three setup-env scripts, and a develop branch you probably should not deploy from

A flexible package manager that supports multiple versions, configurations, platforms, and compilers.

5,179 stars2,480 forksPythonApache-2.0

At a glance

What is it?
Spack builds many versions and configurations of one package side by side, with package recipes written in pure Python. What a new user has to sort out for themselves is the shell environment step, the clingo runtime dependency, and the difference between the develop branch and the release branches that only get bug fixes.
Who is it for?
Spack fits sites that need several versions of the same compiler, MPI, or library coexisting on one machine, and it fits anyone who wants package builds expressed as Python rather than shell logic. It does not fit a laptop user who wants a single tool installed from a one line command.
Can I use it commercially?
Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 3 days ago.
What is it written in?
Mainly Python, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 23, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • spack/spack5,179 ★ · +49
Star history
Repository2026-09-232026-11-23
spack/spack5.1k5.2k

49 Stars in the last 61 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

The spec line is the interface, not a flag list

Spack is built around a single syntax called a spec, and that spec is how you ask for a package. Because specs describe versions and configuration options together, one command can name versions and configuration options in one line, and installing a new version of a package does not break what is already installed. That non-destructive property is the reason many configurations of the same package can sit on one filesystem. The other half of the design is that package files are written in pure Python, so a package author writes one script and lets specs produce many different builds from it. If you have never used Spack, this is the idea to hold on to: you are not editing flags in a Makefile, you are selecting a node in a graph of builds. The syntax has its own cheat sheet, reachable from the command line with `spack help --spec`.

Three setup-env scripts, and your login shell picks one

Installation is a clone followed by a shell snippet, and the snippet is different for every shell family. Bash, zsh and sh share one file, csh and tcsh share another, and fish gets a third. If you skip the sourcing step the `spack` command is not on your path, and nothing in the clone itself will tell you that, because the environment is not baked into the checkout.

bash
# For bash/zsh/sh
. spack/share/spack/setup-env.sh

# For tcsh/csh
source spack/share/spack/setup-env.csh

# For fish
. spack/share/spack/setup-env.fish

The practical consequence is that cluster users who land on a login node with csh, or fish users on a laptop, need the matching line before anything else works. Site administrators who script Spack across a cluster have to carry that per-shell distinction into their own provisioning.

A shallow clone gets you the entry point and four directories

The clone is deliberately shallow, which is the right trade for a tool that gets updated often, but it means you have no history locally.

bash
git clone --depth=2 https://github.com/spack/spack.git

What lands on disk is laid out in a handful of directories. `bin/` holds the command, `lib/` holds the Python implementation, `share/` holds the setup scripts and the rest of the shared data, `var/` holds user state, and `etc/` holds configuration. Testing and packaging files sit at the root next to `pyproject.toml`, `pytest.ini` and `conftest.py`. A developer checking out Spack to work on it also gets `.ci/`, `.devcontainer/` and `.github/`. If you want to see what a given checkout can build rather than read about it, the first command after sourcing is short:

bash
# Now you're ready to install a package!
spack install zlib-ng

The default branch is `develop`, so an unmodified clone is the moving target rather than a released version.

Clingo is the declared runtime dependency, and Python is the floor

The packaging metadata states the runtime contract plainly: the project requires Python 3.6 or later, and its one declared dependency is `clingo`.

toml
[project]
name = "spack"
description = "The spack package manager"
requires-python = ">=3.6"
dependencies = ["clingo"]
dynamic = ["version"]

[project.scripts]
spack = "lib.spack.spack_installable.main:main"

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

The console script is named `spack` and points at `lib.spack.spack_installable.main:main`. The build backend is hatchling, and the wheel deliberately bundles the `/bin`, `/etc`, `/lib`, `/share` and `/var` directories along with `CITATION.cff`, `COPYRIGHT`, both license files, `NOTICE`, `README.md` and `SECURITY.md`. A pip installed Spack therefore carries its own configuration directories, which is a different arrangement from a bare clone on your path.

Release branches get bug fixes, develop gets everything else

Multi user site deployments are pointed at release branches rather than at `develop`, and the policy behind that is specific. Each release series has a matching branch, such as `releases/v0.14` carrying `0.14.x` versions. Important bug fixes are backported to those branches, but package versions are not advanced and no other change is made that would alter how Spack concretizes dependencies inside a release branch. The `releases/latest` tag always points at the newest release. Three releases shipped in the summer of 2026: v1.2.0 on 2026-06-21, v1.2.1 on 2026-07-06 and v1.2.2 on 2026-07-20. The last push to the repository was on 2026-11-02. If you base a deployment on a release branch you can pull fixes without inheriting the package churn that arrives on `develop`.

Lint settings exclude exactly the directories that generate recipes

The style configuration in the project metadata is unusually specific about what it skips.

toml
[tool.ruff]
fix = true
target-version = "py37"
line-length = 99
extend-include = ["bin/spack"]
force-exclude = true
exclude = [
  "var/spack/environments",
  "lib/spack/spack/vendor",
  "opt/spack",
  "*.md",
]
src = ["lib"]

[tool.ruff.lint]
select = ["E", "F", "W", "I"]
ignore = ["E203", "E731", "F811"]

Environments under `var/spack/environments`, the vendored library, an optional `opt/spack` tree and markdown files are all outside linting. The isort configuration then splits imports into named sections for `spack.vendor` and `spack`, so a file that mixes vendored and first party imports still sorts into the intended order. Contributors get three entry points in the hatch environment: `./bin/spack` itself, `./bin/spack style` and `./bin/spack unit-test`.

Package recipes live in a separate repository with its own rules

Spack splits its own code from the software it builds. Package recipes are contributed to the spack-packages repository, while changes to the manager itself go to this repository. A pull request against the manager must target `develop` as the destination branch, pass the unit tests, the documentation tests and the package build tests, comply with PEP 8, and carry commits signed off with `git commit --signoff`, which records agreement with the Developer Certificate of Origin rather than a cryptographic signature. The per file ignore list gives package files their own rule set, with `var/spack/*/package.py` exempted from F403, F405, F811 and F821. Continuous integration enforces all of this, and the local equivalents are `spack unit-test` and `spack style`.

The README never tells you what it can install

Here is the gap worth planning around. The README explains what Spack is, how to install it, and where the documentation lives, and it points at a separate packages repository for the actual recipes. Apart from the `zlib-ng` install example, it does not list package names, so it cannot answer the question most new users arrive with, which is whether the tool you need is already there. Answering that means searching the spack-packages repository or reading the feature overview linked from the README. The README also names two ways to learn the syntax beyond the command itself: a hands on tutorial that covers basic through advanced usage, packaging, developer features and large HPC deployments, and which can be completed on a laptop inside a Docker container. The main documentation is built separately and is also on the command line through `spack help` or `spack help --all`. The repository metadata lists Apache-2.0, and the repository ships both LICENSE-APACHE and LICENSE-MIT files.

Editorial conclusion

Spack fits sites that need several versions of the same compiler, MPI, or library coexisting on one machine, and it fits anyone who wants package builds expressed as Python rather than shell logic. It does not fit a laptop user who wants a single tool installed from a one line command. Before deploying it, check the shell you log in with against the three setup-env scripts, confirm the clingo dependency is satisfied, and decide whether you track develop or a releases branch, because only the release branches receive backported fixes without dependency churn.

Frequently asked questions

What is a spack package manager?

Spack is a multi platform package manager that builds and installs multiple versions and configurations of software, working on Linux, macOS, Windows and many supercomputers. Package files are written in pure Python, and a spec syntax lets you name versions and configuration options for a build.

How does spack work?

You describe the build you want with a spec, and Spack works out the dependency and variant combinations. Installing a new version of a package does not break existing installations, so many configurations of the same package can coexist on one machine. The syntax cheat sheet is available from the command line with `spack help --spec`.

how to install spack

You need Python and Git, then a shallow clone of the repository, followed by sourcing the setup script that matches your shell. For bash, zsh or sh it is `. spack/share/spack/setup-env.sh`, for tcsh or csh it is `source spack/share/spack/setup-env.csh`, and for fish it is `. spack/share/spack/setup-env.fish`. After that, `spack install zlib-ng` is the first install command.

how to install spack on ubuntu

The documented path does not vary by distribution: have Python and Git available, run `git clone --depth=2 https://github.com/spack/spack.git`, and source the setup-env script for your shell. The README states that Spack works on Linux, macOS, Windows and many supercomputers, so the same steps apply on Ubuntu.

spack vs conda

Spack's documented approach is: pure Python package files, a spec syntax, non destructive installs that let several versions and configurations coexist, and deployment from stable release branches for sites that need very stable installations.

Is spack better than Conda?

Spack's stated scope is multiple versions and configurations built from source on Linux, macOS, Windows and supercomputers, with Python 3.6 or later required and `clingo` as its one declared dependency.

Official sources

  1. License: Apache-2.0
  2. Project website
  3. README
  4. Releases
  5. spack/spack on GitHub

Was this useful?