Log In | Users | Register
Edit | Attach | New | Raw | Diff | Print | | Tools
You are here: CM » SpackOverview

Managing packages with Spack


Spack is a package management tool designed to support multiple versions and configurations of software on a wide variety of platforms and environments. It is especially designed for supercomputing centers able to deal with many different architectures. For a detailed description what Spack is please read the official documentation

ORGANIZATION.ORGMeteoSwiss has started moving COSMO-related software from the legacy build-scripts to Spack, therefore the build-scripts won't be supported by ORGANIZATION.ORGMeteoSwiss or C2SM anymore. This wiki page should help you to easily make use of Spack.

Info-Session with Elsa Germann from ORGMeteoSwiss

On the 2nd of September at 10:30 Elsa Germann from ORGANIZATION.ORGMeteoSwiss held a talk/introduction about Spack. This session is a nice introduction into the Spack-deployment of ORGANIZATION.ORGMeteoSwiss containing COSMO related software.

* Slides

* Recorded Session

Feel free to share it!

Important Spack commands

Spack list

list and search available packages
 spack list your_package_name 

Spack info

get detailed information about a particular package
 spack info your_package_name 

Spack spec

show what would be installed, given a spec
 spack spec package@version%compiler +variants 

Spack install

build and install packages
 spack install package@version%compiler +variants 

Setting the right environment for Daint

The Spack-repository configured for Daint needs at least Python Version 3.6.
 module load cray-python
 source /project/g110/spack/user/daint/spack/share/spack/setup-env.sh
Caution: In case you have anything printing the hostname to the terminal, similar to
 echo $(hostname) 
in your .bashrc, the setup-env.sh script for Spack does not work. A possible workaround is to direct the "echo" to the stderr.
 echo $(hostname ) >&2 
Side-effects on your own risks!

Caution: Due to filesystem constraints, Spack installs packages on scratch. Regular cleanups of scratch every month can corrupt your installations in unpredicted manner. In case you suspect this had happenend, delete the entire spack-install directory.

Change install location

(Disclaimer: Do this at your own risk!)

In order to install in another location than your scratch root (e.g., ${SCRATCH}/spack or ${PROJECT}), create a config file and adapt the paths:

spack config get config > ~/.spack/config.yaml
Make sure to check that the config file does not exist yest, otherwise this will overwrite it.

To change the location of the config file, for instance to a machine-specific location like ${SCRATCH}/spack/daint/config.yaml, create an alias for spack in your ~/.bashrc:

alias spack="spack --config-scope=${SCRATCH}/spack/daint"

Compile COSMO

An overview about all different configuration available for COSMO is displayed by typing
 spack info cosmo 
To compile COSMO for example on branch master with PGI Version 20.1 on GPU run
 spack install cosmo@master%pgi@20.1.0 cosmo_target=gpu 
This will clone the source code directly from GitHub. In case you want to build from a local repository, i.e., during development, use
 cd repo_base_dir
 spack dev-build package@version%compiler +variants 

Compile int2lm

An overview over all different configuration available for int2lm is displayed by typing
 spack info int2lm 
To compile int2lm for example on branch master with GCC run
 spack install int2lm@master%gcc slave=daint 

Furhter information

See the spack-c2sm-documentation for more information on how to contribute to the Spack repository or how to prepare own packages to be managed by Spack.

version 1 uploaded by JonasJucker on 02 Sep 2020 - 11:51
Info-Session.mp4 (63285.29K)
version 1 uploaded by JonasJucker on 02 Sep 2020 - 11:53
This site is managed by the Center for Climate Systems Modeling (C2SM).
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors. Ideas, requests, problems? Send feedback!