Once package(s) to be installed are identified, activate the desired Spack environment. $ spack env activate ENV-NAME
. Verify you have enough space in your home directory for the installation. $ home-quota
will tell you how much space you have remaining. Typically should reserve at least 10GB or more, depending on the size of the installation.
To create a Spack environment (https://spack.readthedocs.io/en/latest/environments.html), run $ spack env create ENV-NAME
. A comprehensive discussion is provided in the official Spack documentation.
Spack commands are environment sensitive. For example, the find
command shows only the specs in the active environment if an environment has been activated. Similarly, the install
and uninstall
commands act on the active environment.
$ spack find ==> In environment myenv ==> No root specs ==> 0 installed packages
Adding Abstract Specs
An Abstract spec is the user-specified spec before Spack has applied any defaults or dependency information. Users can add abstract specs to an environment using the spack add
command.
$ spack env activate myenv $ spack add gmake
The spack
add
command is environment aware. It adds to the currently active environment. All environment aware commands can also be called using the spack -
e
flag to specify the environment.
Concretizing
A complete detailed discussion on Spack’s concretizing command is here (https://spack.readthedocs.io/en/latest/environments.html#environments-concretization-config). Once specs have been added, they can be concretized.
$ spack concretize
You can also check the programs, and packages to be installed using $ spack spec -lI
. The first letter after the hyphen is a lowercase “L”, and the second letter is an uppercase “i”.
This command identifies what dependencies Spack needs in order to install your desired packages along with how it will obtain them. Assuming their are no problems, then it will print a list of the packages and their dependencies, where entries that begin with a green [+]
have already been installed somewhere in your local Spack installation, while those that begin with a green [^]
are referencing the system installation, and those beginning with a gray -
will need to be downloaded and installed.
Installing an Environment
In addition to installing individual specs into an environment, these specs can be installed collectively as the entire environment to your local installation directory (~/.spack) or an alternative directory If you’ve specified in your custom configuration.
$ spack install
Once installed, that’s it! The software packages are available via $ spack load
or $ module load
.
Generating Lmod modulefiles for an Environment
After software has installed successfully, to generate Lmod modulefiles (if not automatically generated), run $ spack modules lmod refresh