Spack packages of software used or maintained at Empa.
- Ensure you have Spack installed on your system. Follow the Spack installation guide if needed.
- Ensure
git
is installed on your system to clone this repository.
- Clone
Clone the repository to your local system:
git clone https://github.com/empa-scientific-it/empa-spack.git /path/to/local/repo
- Add the repository to Spack
Register the cloned repository with Spack:
spack repo add --scope site /path/to/local/repo
The --scope site
option will register the repository in $(prefix)/etc/spack
. Settings saved within the site
scope affect only this instance of Spack and override the defaults and system scopes.
You can confirm that the repository was added successfully by running:
spack repo list
You should see an entry for this repository, followed by the built-in Spack repository (or any other repository previously added).
- Check for available packages
To list all packages provided by this repository, run:
spack list
Packages from this repository will appear with the repository's namespace (e.g., empa.package-name
).
- Search for a package
You can search for a specific package using:
spack info package-name
- Install a package
Install any package from this repository as you would for any Spack package:
spack install package-name
If you want to make sure to install a package from this specific repository, specify the namespace explicitly:
spack install empa.package-name
Important
Spack's repos order matters. If you have multiple repositories with the same package, Spack will use the first one in the list.
For example, if your repos.yaml
file looks like:
repos:
- ~/proto
- /usr/local/spack
- $spack/var/spack/repos/builtin
The command spack install hdf5
will install the package from the ~/proto
repository, if available. If not, it will install the package from the /usr/local/spack
repository, falling back to the built-in Spack repository if necessary, and failing if no repository provides the package.
This repository must follow the standard Spack repository structure:
repo/
├── repo.yaml # Metadata for the repository
└── packages/ # Directory containing package recipes
├── package1/
│ └── package.py
└── package2/
└── package.py
The repo.yaml
defines the namespace as empa
:
repo:
namespace: empa
For additional info, refer to the Spack documentation.