Use SPack on Minerva
SPack is a package manager that provides a “modules” interface, able to handle multiple versions, dependencies, and build environments. It can be used together with, or as a replacement for, the old modules environment that has been used for a long time.
To use the latest SPack repository on Minerva (there are some older /home/SPACK*
left), you must source a config file:
. /home/SPACK2021/share/spack/setup-env.sh
After that, you may use spack help
. Most important commands I use:
spack list hdf5
to find (source) packages matchinghdf5
spack info hdf5
to show the description of thehdf5
(source) packagespack find hdf5
to check whether the package has already been built and installed (as binary and module)spack find -lv hdf5
provides more details:- green: compiler version
- cyan: package version
- pale blue: variants user to build (
~
prefixes disabled,+
enabled variants) - gray: package hash
spack find … -d hdf5
lists the (build) dependencies
You will have to make yourself familiar with the special characters used:
+
enables a variant,~
disables it^
specifies a build include%
denotes a compiler,@
a version/
can be used to select hashes
To load the o2x4itb hdf5@1.8.19~cxx~debug~fortran~hl+mpi+pic+shared~szip~threadsafe
built with %gcc@7.3.0
you saw listed with the last find
command, you may choose from the following options:
module load hdf5-1.8.19-gcc-7.3.0-o2x4itb
(old style, module name combines from ${packagename}-${packageversion}-${compiler}-${compilerversion}-${hash}) orspack load hdf5 ~cxx +mpi
works (at the time of this writing)spack load hdf5 /o2x4
(with the hash further shortened) will also get the right one. This even works without a package name!spack load hdf5 %gcc@7.3.0 +mpi
will match (and load, although the docs suggest that an error would result!) multiple modules! Don't forget tomodule (purge|unload)
!
In general, spack load
is slow, and prone to ambiguity errors. Use module list -t
to identify such situations, and get the names of loaded modules one-per-line.
Package dependencies are now resolved automatically (even if not invoked with -r
).
IMPORTANT: The /home/SPACK2021/
tree is read-only (and there are no means yet to make it collaborative). Therefore spack install
will not work for you! If you need a package that hasn't been installed yet, ask me (Steffen), if possible keep the right options (variants, includes) at hand!
(To be extended.)