spack Cheatsheet
#
Spack is a package manager for scientific software that helps to manage installations, dependencies, and environments.
Basic Commands
#
Command/Option | Example | Description |
---|
spack install | spack install hdf5 | Install a package and its dependencies |
spack uninstall | spack uninstall hdf5 | Uninstall a package |
spack update | spack update | Update Spack and its packages |
spack upgrade | spack upgrade hdf5 | Upgrade a package to the latest version |
spack find | spack find | List all installed packages |
Package Management
#
Command/Option | Example | Description |
---|
spack list | spack list | List all available packages |
spack info | spack info hdf5 | Display information about a package |
spack search | spack search hdf5 | Search for a package |
Environment Management
#
Command/Option | Example | Description |
---|
spack env create | spack env create myenv | Create a new Spack environment |
spack env activate | spack env activate myenv | Activate a Spack environment |
spack env deactivate | spack env deactivate | Deactivate the current Spack environment |
spack env remove | spack env remove myenv | Remove a Spack environment |
Configuration
#
Command/Option | Example | Description |
---|
spack config | spack config | Show Spack configuration settings |
spack config --list | spack config --list | List all Spack configuration settings |
spack config --edit | spack config --edit | Edit Spack configuration settings |
Repository Management
#
Command/Option | Example | Description |
---|
spack repo add | spack repo add /path/to/repo | Add a new repository to Spack |
spack repo list | spack repo list | List all Spack repositories |
spack repo remove | spack repo remove /path/to/repo | Remove a repository from Spack |
Advanced Commands
#
Command/Option | Example | Description |
---|
spack concretize | spack concretize | Resolve and concretize dependencies |
spack build | spack build hdf5 | Build a package from source |
spack test | spack test hdf5 | Test a package to ensure it works correctly |
This cheatsheet covers essential Spack commands for managing scientific software, including installation, environment management, configuration, and more.