What’s Spack

Spack is a package manager for supercomputers, Linux, and macOS. It makes installing scientific software easy. With Spack, you can build a package with multiple versions, configurations, platforms, and compilers, and these builds can coexist on the same machine.

What Makes Spack Different From Other Package Managers

The following features makes Spack different from other package managers:

  1. Simple package installation: Installing the default version of a package is simple.

  2. Custom versions & configurations: Spack allows installation to be customized. Users can specify the version, build compiler, compile-time options, and cross-compile platform, all on the command line.

  3. Customize dependencies: Spack allows dependencies of a particular installation to be customized extensively.

  4. Non-destructive installs: Spack installs every unique package/dependency configuration into its own prefix, so new installs won’t break existing ones.

  5. Packages can peacefully coexist: Spack avoids library misconfiguration by using RPATH to link dependencies. When a user links a library or runs a program, it’s tied to the dependencies it was built with, so there is no need to manipulate LD_LIBRARY_PATH at runtime.

  6. Creating packages is easy: To create a new package, all Spack needs is the URL for the source archive. The spack create command will create a boilerplate package file, and the package authors can fill in specific build steps in pure Python.

Spack Packages

Spack packages are installation scripts, which are essentially recipes for building the software.

They define properties and behavior of the build, such as:

  • Where to find and how to retrieve the software.

  • Its dependencies.

  • Options for building the software from source.

  • Build commands.

Once you’ve specified a package’s recipe, users of that recipe can ask Spack to build the software with different features on any of the supported systems.