Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Spack is a multi-platform package manager that allows to easily install multiple versions and configurations of software. It is especially useful for building and maintaining installations of many different versions of the same software.
Currently Spack is available on Marconi100 MARCONI, GALILEO100 and Galileo100LEONARDO. Please refer to the spack documentation page  for more detailed information.

Loading the spack module available on the cluster

We provide a module to load a pre-configured Spack instance:

...

When you load the "prod" module, you will use a Spack instance configured to compile software in the CINECA environment.
When you connect to a Cineca CINECA cluster, "preprod" and "prod" spack Spack modules are available. The pre-production module should only be used when no production module of spack Spack is available.


By loading a spack module, the setup-env.sh file is sourced. Then $SPACK_ROOT is initialized to /cineca/prod/opt/tools/spack/<vers>/none, spack command is added to your PATH, and some nice command line integration tools too.
The folder $USERdirectory /spack-<version> is automatically created into your "a default " $WORK space ("chprj -l" command to see the default work) space, and it contains some subfolders sub-directories created and used by spack Spack during the phase of the packages installationpackage installation. When you load the spack module, the list of the sub-directories is shown, with the full paths: on MARCONI and GALILEO100, the default area is $WORK/$USER, while on LEONARDO this is $PUBLIC. You will find then, for example on LEONARDO:

  • sources cache: $WORK/$USER$PUBLIC/spack-<version>/cache
  • software installation root: $WORK/$USER$PUBLIC/spack-<version>/install
  • modulefiles location: $WORK/$USER$PUBLIC/spack-<version>/modules
  • user scope:  $WORK/$USER $PUBLIC/spack-<version>/user_cache

Notice For MARCONI and GALILEO100 users, notice that $WORK space will be removed at the end of the corresponding project. If you want to define different paths for cache, installation, modules and user scope directories, please refer to spack Spack manual.

Listing the software packages available to be installed

You can check if the software package you want install is available via spack with the comand spack list, which prints out a list of all of the packages Spack can install. You can also specified the name of the package:

...

$ spack list | grep <package_name>

Providers

In the spack environment, "virtual packages" are defined (e.g. mpi), which are provided by multiple specific packages (e.g. intel-oneapi-mpi, openmpi, ...). The list of the available virtual packages is given by

...

(e.g. intel-oneapi-mpi and openmpi packages provide the mpi virtual package; netlib-lapack and openblas provide the lapack virtual package).

Variants and dependencies

If the package of your interest is available to be installed via spack, look at its build “variants” that yon can switch in/off or customize, and  the  “dependencies” that will be used for the building, linking and running phases and you are able to personalize:

$ spack info <package_name>

Listing the software packages installed from Cineca staff via spack

Cineca staff has already installed through the spack module that you loaded a suite of compilers, libraries, tools and applications and you can use them to install additional software (it is strongly recommended). List the packages already installed

...

The list of all the compilers already installed and ready to be used can be seen with

$ spack compilers

Installing a new package

Spec command

In order to install a package with the spack module you have to select for it a version, a compiler, the dependencies and the building variants (we will show how to do it in the following). The combination of all these parameters is the "spec" with which the package will be installed.

...

$ spack spec -Il parmetis %gcc@10.2.0 ^/ov3ei7j
-   oefbg6x  parmetis@4.0.3%gcc@10.2.0~gdb~int64~ipo+shared build_type=RelWithDebInfo patches=4f892531eb0a807eb1b82e683a416d3e35154a455274cf9b162fb02054d11a5b,50ed2081bc939269689789942067c58b3e522c269269a430d5d34c00edbc5870,704b84f7c7444d4372cb59cca6e1209df4ef3b033bc4ee3cf50f369bce972a9d arch=linux-centos8-cascadelake
 [^]      ov3ei7j      ^openmpi@4.1.1%gcc@10.2.0~atomics+cuda~cxx~cxx_exceptions~gpfs~internal-hwloc~java+legacylaunchers~lustre~memchecker~pmi+pmix~singularity~sqlite3+static~thread_multiple+vt+wrapper-rpath fabrics=ucx schedulers=slurm arch=linux-centos8-cascadelake

Install command

For a specific package you can install the default spec  or a custom spec by selecting a specific version (through @ symbol), and/or a specific compiler (through % symbol), building variants (through +,-,= symbols) and specific dependencies (through ^ symbol).

...

$ spack install <compiler_package>
$ spack load <compiler_package>
$ spack compiler add
$ spack compilers

Module command

After installing a package, you can load it with the spack command

...