A flexible package manager that supports multiple versions, configurations, platforms, and compilers.
Go to file
Todd Gamblin f85f50d64e
configuration: remove platform-specific scopes
Spack has historically allowed a platform-specific subdirectory
for each configuration scope. e.g., in Spack's own defaults we use this
for platform-specific overrides:

```
spack/etc/spack/
    packages.yaml
spack/etc/spack/linux/
    packages.yaml
spack/etc/spack/darwin/
    packages.yaml
```

This adds specialized `packages.yaml` overrides for linux and darwin.

In #48784, we added a much more general facility for an `include:`
section in configuration, so you can add your own much more specialized
config directories.  This PR addresses a couple issues with that, namely:

1. We still hard-code the platform includes in Spack
2. Platform includes are at *higher* precedence than the including scope,
   while `include:` includes are lower. This makes it impossible for
   something like:

   ```yaml
   include:
      - include: "${os}"
   ```

   to override the linux subdirectory in a config scope.

This PR removes the older platform-specific config scopes in favor of
allowing users to add their own such scopes if they need them.  So,
if you want platform configuration, you can add this to the scope
that needs it:

   ```yaml
   include:
      - include: "${platform}"
   ```

If you want platform to have lower precedence than OS, you can do this:

   ```yaml
   include:
      - include: "${os}"
   include:
      - include: "${platform}"
   ```

And now OS config can override platform. Likewise, you could reverse the
list and have platofrm with higher precedence than OS.

- [x] remove `_add_platform_scope() from `config`
- [x] refactor default config scope to account for new structure
- [ ] TBD: docs

Signed-off-by: Todd Gamblin <tgamblin@llnl.gov>
2025-05-21 16:39:58 -07:00
.devcontainer codespaces: add ubuntu22.04 (#46100) 2024-09-12 13:40:05 +02:00
.github ci: sync packages to python/spack_repo instead of spack_repo/ (#50589) 2025-05-21 09:10:01 +02:00
bin import os.path -> os (#48709) 2025-01-28 09:45:43 +01:00
etc/spack/defaults configuration: remove platform-specific scopes 2025-05-21 16:39:58 -07:00
lib/spack configuration: remove platform-specific scopes 2025-05-21 16:39:58 -07:00
share/spack celeritas: new versions through 0.6 (#50197) 2025-05-20 11:00:01 -04:00
var/spack podio, edm4hep: Add version 1.3 and 0.99.2 and ensure make sure EDM4hep still builds (#50489) 2025-05-21 14:06:45 -05:00
.codecov.yml codecov: increase project threshold to 2% (#46828) 2024-10-07 08:24:22 +02:00
.dockerignore Docker: ignore var/spack/cache (source caches) when creating container (#23329) 2021-05-17 11:28:58 +02:00
.flake8 builtin: use api v2.0 and update dir structure (#49275) 2025-05-06 12:05:44 +02:00
.git-blame-ignore-revs Ignore black reformat in git blame (#35544) 2023-02-18 01:03:50 -08:00
.gitattributes Remove Prolog so that GitHub detects Answer Set Programming (#50077) 2025-04-15 22:41:53 -07:00
.gitignore gitignore: remove *_archive (#49278) 2025-03-04 18:37:18 +01:00
.mailmap Update mailmap (#22739) 2021-04-06 10:32:35 +02:00
.readthedocs.yml docs: do not promote build_systems/* at all (#47111) 2024-10-21 13:40:29 +02:00
CHANGELOG.md update CHANGELOG.md (#46758) 2024-10-03 18:01:46 -07:00
CITATION.cff CITATION.cff: wrap at 100 columns like the rest of Spack (#41849) 2023-12-27 08:02:30 -08:00
COPYRIGHT Remove years from license headers (#48352) 2025-01-02 15:40:28 +01:00
LICENSE-APACHE relicense: update COPYRIGHT, LICENSE-*, README, CONTRIBUTING, and NOTICE 2018-10-17 14:42:06 -07:00
LICENSE-MIT Remove years from license headers (#48352) 2025-01-02 15:40:28 +01:00
NOTICE relicense: update COPYRIGHT, LICENSE-*, README, CONTRIBUTING, and NOTICE 2018-10-17 14:42:06 -07:00
pyproject.toml archspec: change module from archspec to _vendoring.archspec (#50450) 2025-05-21 11:25:02 +02:00
pytest.ini test_builtin_repo: add a marker to skip the test if builtin is not available (#50476) 2025-05-15 19:50:42 +02:00
README.md Improve our README to make it easier for new users (#49711) 2025-04-15 17:08:39 -04:00
SECURITY.md security: change SECURITY.md to recommend GitHub's private reporting (#39651) 2023-08-28 18:06:17 +00:00

Spack

CI Status Bootstrap Status Containers Status Documentation Status Code coverage Slack Matrix

Getting Started   •   Config   •   Community   •   Contributing   •   Packaging Guide

Spack is a multi-platform package manager that builds and installs multiple versions and configurations of software. It works on Linux, macOS, Windows, and many supercomputers. Spack is non-destructive: installing a new version of a package does not break existing installations, so many configurations of the same package can coexist.

Spack offers a simple "spec" syntax that allows users to specify versions and configuration options. Package files are written in pure Python, and specs allow package authors to write a single script for many different builds of the same package. With Spack, you can build your software all the ways you want to.

See the Feature Overview for examples and highlights.

Installation

To install spack, first make sure you have Python & Git. Then:

git clone -c feature.manyFiles=true --depth=2 https://github.com/spack/spack.git
What are manyFiles=true and --depth=2?

-c feature.manyFiles=true improves git's performance on repositories with 1,000+ files.

--depth=2 prunes the git history to reduce the size of the Spack installation.

# 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
# Now you're ready to install a package!
spack install zlib-ng

Documentation

Full documentation is available, or run spack help or spack help --all.

For a cheat sheet on Spack syntax, run spack help --spec.

Tutorial

We maintain a hands-on tutorial. It covers basic to advanced usage, packaging, developer features, and large HPC deployments. You can do all of the exercises on your own laptop using a Docker container.

Feel free to use these materials to teach users at your organization about Spack.

Community

Spack is an open source project. Questions, discussion, and contributions are welcome. Contributions can be anything from new packages to bugfixes, documentation, or even new core features.

Resources:

Contributing

Contributing to Spack is relatively easy. Just send us a pull request. When you send your request, make develop the destination branch on the Spack repository.

Your PR must pass Spack's unit tests and documentation tests, and must be PEP 8 compliant. We enforce these guidelines with our CI process. To run these tests locally, and for helpful tips on git, see our Contribution Guide.

Spack's develop branch has the latest contributions. Pull requests should target develop, and users who want the latest package versions, features, etc. can use develop.

Releases

For multi-user site deployments or other use cases that need very stable software installations, we recommend using Spack's stable releases.

Each Spack release series also has a corresponding branch, e.g. releases/v0.14 has 0.14.x versions of Spack, and releases/v0.13 has 0.13.x versions. We backport important bug fixes to these branches but we do not advance the package versions or make other changes that would change the way Spack concretizes dependencies within a release branch. So, you can base your Spack deployment on a release branch and git pull to get fixes, without the package churn that comes with develop.

The latest release is always available with the releases/latest tag.

See the docs on releases for more details.

Code of Conduct

Please note that Spack has a Code of Conduct. By participating in the Spack community, you agree to abide by its rules.

Authors

Many thanks go to Spack's contributors.

Spack was created by Todd Gamblin, tgamblin@llnl.gov.

Citing Spack

If you are referencing Spack in a publication, please cite the following paper:

On GitHub, you can copy this citation in APA or BibTeX format via the "Cite this repository" button. Or, see the comments in CITATION.cff for the raw BibTeX.

License

Spack is distributed under the terms of both the MIT license and the Apache License (Version 2.0). Users may choose either license, at their option.

All new contributions must be made under both the MIT and Apache-2.0 licenses.

See LICENSE-MIT, LICENSE-APACHE, COPYRIGHT, and NOTICE for details.

SPDX-License-Identifier: (Apache-2.0 OR MIT)

LLNL-CODE-811652