Search Docs by Keyword

Table of Contents

Spack software package management

Overview

Spack is a package management tool designed to support multiple versions and configurations of software on a wide variety of platforms and environments. It was designed for large supercomputer centers, where many users and application teams share common installations of software on clusters with exotic architectures, using non-standard libraries. Spack is non-destructive: installing a new version does not break existing installations. In this way several configurations can coexist on the same system.

Most importantly, Spack is simple. It offers a simple spec syntax so that users can specify versions and configuration options concisely. Spack is also simple for package authors: package files are written in pure Python, and specs allow package authors to maintain a single file for many different builds of the same package.

This page provides a brief guide to the usage of Spack. For more detailed instructions please checkout FASRC User Codes and the official Spack documentation.

Installation

To install Spack do:

git clone -c feature.manyFiles=true https://github.com/spack/spack.git

We recommend cloning into your lab directory on holylabs, or other lab storage if holylabs is not available, in a common directory (e.g. /n/holylabs/LABS/jharvard_lab/Lab/software). This way you can have a collective Spack installation for your lab to use and you get the superior performance of holylabs over your home directory. Other locations work as well, but you should pick a location that has decent performance and is mounted to the entire cluster.

Setup

To setup Spack, go to your Spack directory and run . /share/spack/setup-env.sh. This will modify your environment and put spack in your path.  If you want to have spack always on, you will need to update your .bashrc with source <PATHTOSPACK>/share/spack/setup-env.sh

Package Management

Below is a list of convenient commands for Spack. Note: Depending on the package installation can take hours so plan accordingly by using screen/tmux or a Remote Desktop on Open Ondemand.

Command Purpose
spack list List all available packages
spack list <package> List specific package
spack versions <package> List available versions of package
spack install <package> Install package
spack uninstall <package> Remove package
spack find List installed packages
spack load <package> Load package for use
spack unload <package> Unload package from environment

Further Reading

© The President and Fellows of Harvard College
Except where otherwise noted, this content is licensed under Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International license.