Spack
What is Spack?
Spack is a package manager for supercomputers. It makes installing scientific software easy. Spack isn’t tied to a particular language; you can build a software stack in Python or R, link to libraries written in C, C++, or Fortran, and easily swap compilers or target specific microarchitectures.
How set up Spack in user environment
<user@cresco7x001 ~> module load spack-0.23.0
To summarize:
System
Spack version
Supported shells
Requirement
Command
CRESCO7
0.23.0
all
none
module load spack-0.23.0
XCRESCO
0.23.0
all
none
module load spack-0.23.0
CRESCO6
0.23.0
/bin/bash /bin/sh
module load scipy39
module load spack-0.23.0
How to use Spack
Search a software
<user@cresco7x001 ~> spack list octave
octave octave-arduino octave-control octave-gsl octave-instrctl octave-io octave-optim octave-quaternion octave-signal octave-splines octave-statistics octave-struct octave-symbolic
==> 13 packages
Get info about a software
<user@cresco7x001 ~> spack info octave
AutotoolsPackage: octave
Description:
GNU Octave is a high-level language, primarily intended for numerical
computations. It provides a convenient command line interface for
solving linear and nonlinear problems numerically, and for performing
other numerical experiments using a language that is mostly compatible
with Matlab. It may also be used as a batch-oriented language.
Homepage: https://www.gnu.org/software/octave/
Preferred version:
9.1.0 https://ftpmirror.gnu.org/octave/octave-9.1.0.tar.gz
Safe versions:
9.1.0 https://ftpmirror.gnu.org/octave/octave-9.1.0.tar.gz
8.4.0 https://ftpmirror.gnu.org/octave/octave-8.4.0.tar.gz
8.2.0 https://ftpmirror.gnu.org/octave/octave-8.2.0.tar.gz
8.1.0 https://ftpmirror.gnu.org/octave/octave-8.1.0.tar.gz
7.3.0 https://ftpmirror.gnu.org/octave/octave-7.3.0.tar.gz
7.2.0 https://ftpmirror.gnu.org/octave/octave-7.2.0.tar.gz
7.1.0 https://ftpmirror.gnu.org/octave/octave-7.1.0.tar.gz
6.4.0 https://ftpmirror.gnu.org/octave/octave-6.4.0.tar.gz
6.3.0 https://ftpmirror.gnu.org/octave/octave-6.3.0.tar.gz
6.2.0 https://ftpmirror.gnu.org/octave/octave-6.2.0.tar.gz
6.1.0 https://ftpmirror.gnu.org/octave/octave-6.1.0.tar.gz
5.2.0 https://ftpmirror.gnu.org/octave/octave-5.2.0.tar.gz
5.1.0 https://ftpmirror.gnu.org/octave/octave-5.1.0.tar.gz
4.4.1 https://ftpmirror.gnu.org/octave/octave-4.4.1.tar.gz
4.4.0 https://ftpmirror.gnu.org/octave/octave-4.4.0.tar.gz
4.2.2 https://ftpmirror.gnu.org/octave/octave-4.2.2.tar.gz
4.2.1 https://ftpmirror.gnu.org/octave/octave-4.2.1.tar.gz
4.2.0 https://ftpmirror.gnu.org/octave/octave-4.2.0.tar.gz
4.0.2 https://ftpmirror.gnu.org/octave/octave-4.0.2.tar.gz
4.0.0 https://ftpmirror.gnu.org/octave/octave-4.0.0.tar.gz
Deprecated versions:
None
Variants:
arpack [false] false, true
Use arpack
build_system [autotools] autotools
Build systems supported by the package
bz2 [true] false, true
Use bzip2
curl [false] false, true
Use curl
fftw [false] false, true
Use FFTW3
fltk [false] false, true
Use FLTK
...
Build Dependencies:
arpack-ng bzip2 fftw-api fontconfig gl glpk gnuconfig hdf5 java llvm pcre2 qhull qscintilla readline texinfo
blas curl fltk freetype gl2ps gmake gnuplot imagemagick lapack pcre pkgconfig qrupdate qt suite-sparse zlib-api
Link Dependencies:
arpack-ng bzip2 fftw-api fontconfig gl glpk hdf5 java llvm pcre2 qrupdate qt suite-sparse
blas curl fltk freetype gl2ps gnuplot imagemagick lapack pcre qhull qscintilla readline zlib-api
Run Dependencies:
None
Licenses:
GPL-3.0-or-later
Install a software
Note
N.B.: Error during ncurses installation on AFS
If a software depends on ncurses package then software installation by means spack will be not completed and an error message will be reported as following:
/usr/sbin/ldconfig: Can't create temporary cache file /etc/ld.so.cache~: Permission deniedThis event is known on ncurses documentation by this note:
“USING NCURSES WITH AFS: AFS treats each directory as a separate logical filesystem, you can’t hard-link across them. The –enable-symlinks option copes with this by making tic use symbolic links.”
Workaround: From https://github.com/spack/spack/issues/8675 a simple way to install ncurses via spack is to enabling the the use of symbolic links creation instead hard links, i.e: spack install ncurses+symlinks
By default, spack creates an hidden directory named .spack into user home. Below, an example of octave installation via spack by workaround ncurses error:
<user@cresco7x001 ~> spack install octave^ncurses+symlinks
[+] /usr (external glibc-2.34-l3ukyqeboaxys3yum525zfxkzbsuljrh)
[+] /userhome/.spack/opt/spack/linux-almalinux9-skylake_avx512/gcc-11.3.1/gcc-runtime-11.3.1-aphao5cskj5j7lufcrn23sn7vo3as2jb
[+] /userhome/.spack/opt/spack/linux-almalinux9-skylake_avx512/gcc-11.3.1/pcre2-10.43-6iugizgfqsvaj5cu7hecjgis72pu5evi
[+] /userhome/.spack/opt/spack/linux-almalinux9-skylake_avx512/gcc-11.3.1/ncurses-6.5-4la6oeefwiying2qbaq52jg5uk6csnvs
[+] /userhome/.spack/opt/spack/linux-almalinux9-skylake_avx512/gcc-11.3.1/openblas-0.3.27-u5zltiouimdktyfm2rbpuoh4fcrihc5m
[+] /userhome/.spack/opt/spack/linux-almalinux9-skylake_avx512/gcc-11.3.1/bzip2-1.0.8-dlk26nltz2kcgtg5rnkwiy3yrdov62cm
[+] /userhome/.spack/opt/spack/linux-almalinux9-skylake_avx512/gcc-11.3.1/readline-8.2-ikqnu623xqzlzunqonnf3z4reut4ob5b
[+] /userhome/.spack/opt/spack/linux-almalinux9-skylake_avx512/gcc-11.3.1/octave-9.1.0-x5dmrnjlfmvexwqvlppje2mrp7plql32
<user@cresco7x001 ~> mv .spack .spack_20241015
<user@cresco7x001 ~> spack install octave^ncurses+symlinks
==> Fetching https://mirror.spack.io/bootstrap/github-actions/v0.5/build_cache/linux-centos7-x86_64-gcc-10.2.1-clingo-bootstrap-spack-bhqgwuvef354fwuxq7heeighavunpber.spec.json
==> Fetching https://mirror.spack.io/bootstrap/github-actions/v0.5/build_cache/linux-centos7-x86_64/gcc-10.2.1/clingo-bootstrap-spack/linux-centos7-x86_64-gcc-10.2.1-clingo-bootstrap-spack-bhqgwuvef354fw
uxq7heeighavunpber.spack
==> Installing "clingo-bootstrap@=spack%gcc@=10.2.1~docs+ipo+optimized+python+static_libstdcpp build_system=cmake build_type=Release generator=make patches=bebb819,ec99431 arch=linux-centos7-x86_64" from
a buildcache
[+] /usr (external glibc-2.34-l3ukyqeboaxys3yum525zfxkzbsuljrh)
==> Installing gcc-runtime-11.3.1-aphao5cskj5j7lufcrn23sn7vo3as2jb [2/22]
...
==> octave: Executing phase: 'build'
==> octave: Executing phase: 'install'
==> octave: Successfully installed octave-9.1.0-x5dmrnjlfmvexwqvlppje2mrp7plql32
Stage: 1.12s. Autoreconf: 0.00s. Configure: 1m 5.71s. Build: 4m 15.51s. Install: 33.36s. Post-install: 2.86s. Total: 5m 59.14s
[+] /userhome/.spack/opt/spack/linux-almalinux9-skylake_avx512/gcc-11.3.1/octave-9.1.0-x5dmrnjlfmvexwqvlppje2mrp7plql32
Launch a software
<user@cresco7x001 ~> spack load octave
<user@cresco7x001 ~> octave
GNU Octave, version 9.1.0
Copyright (C) 1993-2024 The Octave Project Developers.
This is free software; see the source code for copying conditions.
There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. For details, type 'warranty'.
Octave was configured for "x86_64-pc-linux-gnu".
Home page: https://octave.org
Support resources: https://octave.org/support
Improve Octave: https://octave.org/get-involved
For changes from previous versions, type 'news'.
octave:1>
Additional Information
- Source URL: