Basic Usage

The spack command has many subcommands. You’ll only need a small subset of them for typical usage.

Note that Spack colorizes output. less -R should be used with Spack to maintain this colorization. E.g.:

$ spack find | less -R

It is recommended that the following be put in your .bashrc file:

alias less='less -R'

Listing available packages

To install software with Spack, you need to know what software is available. You can see a list of available package names at the Package List webpage, or using the spack list command.

spack list

The spack list command prints out a list of all of the packages Spack can install:

$ spack list
abinit                           nasm                                   r-circlize
abyss                            nauty                                  r-class
accfft                           ncbi-rmblastn                          r-classint
ack                              nccl                                   r-cli
activeharmony                    nccmp                                  r-clipr
adept-utils                      ncdu                                   r-cluster
adios                            ncftp                                  r-clusterprofiler
adios2                           ncl                                    r-cner
adlbx                            nco                                    r-coda
adol-c                           ncurses                                r-codetools
aegean                           ncview                                 r-coin
albany                           ndiff                                  r-colorspace
albert                           nek5000                                r-complexheatmap
alglib                           nekbone                                r-corpcor
allinea-forge                    nekcem                                 r-corrplot
allinea-reports                  nektar                                 r-covr
allpaths-lg                      neovim                                 r-cowplot
alquimia                         netcdf                                 r-crayon
alsa-lib                         netcdf-cxx                             r-crosstalk
amg                              netcdf-cxx4                            r-cubature
amg2013                          netcdf-fortran                         r-cubist
amp                              netgauge                               r-curl
ampliconnoise                    netgen                                 r-data-table
amrex                            netlib-lapack                          r-dbi
andi                             netlib-scalapack                       r-dbplyr
angsd                            netlib-xblas                           r-delayedarray
ant                              nettle                                 r-deldir
antlr                            neuron                                 r-dendextend
ants                             nextflow                               r-deoptim
ape                              nfft                                   r-deoptimr
apex                             nghttp2                                r-deseq
applewmproto                     nginx                                  r-deseq2
appres                           ngmlr                                  r-desolve
apr                              ninja                                  r-devtools
apr-util                         ninja-fortran                          r-diagrammer
aragorn                          nlohmann-json                          r-dicekriging
archer                           nlopt                                  r-dichromat
argp-standalone                  nmap                                   r-diffusionmap
argtable                         nnvm                                   r-digest
arlecore                         node-js                                r-diptest
armadillo                        notmuch                                r-dirichletmultinomial
arpack-ng                        npb                                    r-dismo
ascent                           npm                                    r-dnacopy
asciidoc                         npth                                   r-do-db
aspa                             nspr                                   r-domc
aspcud                           numactl                                r-doparallel
aspect                           numdiff                                r-dorng
aspell                           nut                                    r-dose
aspell6-de                       nwchem                                 r-downloader
aspell6-en                       ocaml                                  r-dplyr
aspell6-es                       occa                                   r-dt
assimp                           oce                                    r-dtw
astra                            oclint                                 r-dygraphs
astral                           oclock                                 r-e1071
astyle                           octave                                 r-edger
atk                              octave-optim                           r-ellipse
atlas                            octave-splines                         r-ensembldb
atom-dft                         octave-struct                          r-ergm
atompaw                          octopus                                r-evaluate
atop                             of-adios-write                         r-expm
augustus                         omega-h                                r-factoextra
autoconf                         ompss                                  r-factominer
autodock-vina                    ompt-openmp                            r-fastmatch
autogen                          oniguruma                              r-ff
automaded                        ont-albacore                           r-fftwtools
automake                         opa-psm2                               r-fgsea
axel                             opam                                   r-filehash
bamtools                         opari2                                 r-fit-models
bamutil                          openbabel                              r-flashclust
barrnap                          openblas                               r-flexclust
bash                             opencoarrays                           r-flexmix
bash-completion                  opencv                                 r-fnn
bats                             openexr                                r-forcats
bazel                            openfast                               r-foreach
bbcp                             openfoam-com                           r-forecast
bbmap                            openfoam-org                           r-foreign
bc                               openfst                                r-formatr
bcftools                         opengl                                 r-formula
bcl2fastq2                       openglu                                r-fpc
bdftopcf                         openjpeg                               r-fracdiff
bdw-gc                           openmc                                 r-futile-logger
bear                             openmpi                                r-futile-options
beast1                           opennurbs                              r-gbm
beast2                           openpmd-api                            r-gcrma
bedops                           openscenegraph                         r-gdata
bedtools2                        openslide                              r-gdsfmt
beforelight                      openspeedshop                          r-geiger
benchmark                        openspeedshop-utils                    r-genefilter
berkeley-db                      openssh                                r-geneplotter
bertini                          openssl                                r-genie3
bib2xhtml                        opium                                  r-genomeinfodb
bigreqsproto                     opus                                   r-genomeinfodbdata
binutils                         orfm                                   r-genomicalignments
bioawk                           orthofinder                            r-genomicfeatures
biopieces                        orthomcl                               r-genomicranges
bismark                          osu-micro-benchmarks                   r-geomorph
bison                            otf                                    r-geoquery
bitmap                           otf2                                   r-geosphere
blasr-libcpp                     p4est                                  r-getopt
blast-plus                       p7zip                                  r-getoptlong
blat                             pacbio-daligner                        r-ggally
blaze                            pacbio-damasker                        r-ggbio
bliss                            pacbio-dazz-db                         r-ggdendro
blitz                            pacbio-dextractor                      r-ggjoy
bmake                            pagit                                  r-ggmap
bml                              pagmo                                  r-ggplot2
bohrium                          paml                                   r-ggpubr
bookleaf-cpp                     panda                                  r-ggrepel
boost                            pandaseq                               r-ggridges
boostmplcartesianproduct         pango                                  r-ggsci
bowtie                           papi                                   r-ggvis
bowtie2                          papyrus                                r-gistr
boxlib                           paradiseo                              r-git2r
bpp-core                         parallel                               r-glmnet
bpp-phyl                         parallel-netcdf                        r-globaloptions
bpp-seq                          paraver                                r-glue
bpp-suite                        paraview                               r-gmodels
bracken                          parmetis                               r-gmp
braker                           parmgridgen                            r-go-db
branson                          parsimonator                           r-googlevis
breakdancer                      parsplice                              r-gosemsim
breseq                           partitionfinder                        r-gostats
brigand                          patch                                  r-gplots
bsseeker2                        patchelf                               r-graph
bucky                            pathfinder                             r-gridbase
bumpversion                      pax-utils                              r-gridextra
busco                            pbbam                                  r-gseabase
butter                           pbmpi                                  r-gss
bwa                              pcma                                   r-gsubfn
byobu                            pcre                                   r-gtable
bzip2                            pcre2                                  r-gtools
c-blosc                          pdf2svg                                r-gtrellis
c-lime                           pdftk                                  r-gviz
caffe                            pdsh                                   r-haven
cairo                            pdt                                    r-hexbin
caliper                          pegtl                                  r-highr
callpath                         pennant                                r-hmisc
camellia                         percept                                r-hms
candle-benchmarks                perl                                   r-htmltable
cantera                          perl-algorithm-diff                    r-htmltools
canu                             perl-app-cmd                           r-htmlwidgets
cap3                             perl-array-utils                       r-httpuv
cares                            perl-b-hooks-endofscope                r-httr
cask                             perl-bio-perl                          r-hwriter
casper                           perl-bit-vector                        r-hypergraph
catalyst                         perl-cairo                             r-ica
catch                            perl-capture-tiny                      r-igraph
cbench                           perl-carp-clan                         r-illuminaio
cblas                            perl-class-data-inheritable            r-impute
cbtf                             perl-class-inspector                   r-influencer
cbtf-argonavis                   perl-class-load                        r-inline
cbtf-argonavis-gui               perl-class-load-xs                     r-interactivedisplaybase
cbtf-krell                       perl-contextual-return                 r-ipred
cbtf-lanl                        perl-cpan-meta-check                   r-iranges
ccache                           perl-data-optlist                      r-irdisplay
cctools                          perl-data-stag                         r-irkernel
cdbfasta                         perl-dbd-mysql                         r-irlba
cdd                              perl-dbfile                            r-iso
cddlib                           perl-dbi                               r-iterators
cdhit                            perl-devel-cycle                       r-janitor
cdo                              perl-devel-globaldestruction           r-jaspar2018
ceed                             perl-devel-overloadinfo                r-jomo
cereal                           perl-devel-stacktrace                  r-jpeg
cfitsio                          perl-digest-md5                        r-jsonlite
cgal                             perl-dist-checkconflicts               r-kegg-db
cgm                              perl-encode-locale                     r-kegggraph
cgns                             perl-eval-closure                      r-keggrest
charliecloud                     perl-exception-class                   r-kernlab
charm                            perl-exporter-tiny                     r-kernsmooth
check                            perl-extutils-depends                  r-kknn
chlorop                          perl-extutils-makemaker                r-knitr
chombo                           perl-extutils-pkgconfig                r-labeling
cistem                           perl-file-copy-recursive               r-lambda-r
cityhash                         perl-file-listing                      r-laplacesdemon
clamr                            perl-file-pushd                        r-lars
clapack                          perl-file-sharedir-install             r-lattice
cleaveland4                      perl-file-slurp-tiny                   r-latticeextra
cleverleaf                       perl-file-slurper                      r-lava
clfft                            perl-file-which                        r-lazyeval
clhep                            perl-font-ttf                          r-leaflet
clingo                           perl-gd                                r-leaps
cloc                             perl-gd-graph                          r-learnbayes
cloog                            perl-gd-text                           r-lhs
cloverleaf                       perl-graph                             r-limma
cloverleaf3d                     perl-graph-readwrite                   r-lme4
clustalo                         perl-html-parser                       r-lmtest
clustalw                         perl-html-tagset                       r-locfit
cmake                            perl-http-cookies                      r-log4r
cmocka                           perl-http-daemon                       r-lpsolve
cmor                             perl-http-date                         r-lsei
cnmem                            perl-http-message                      r-lubridate
cnpy                             perl-http-negotiate                    r-magic
cntk                             perl-inline                            r-magrittr
cntk1bitsgd                      perl-inline-c                          r-makecdfenv
codar-cheetah                    perl-intervaltree                      r-maldiquant
coevp                            perl-io-html                           r-mapproj
cohmm                            perl-io-sessiondata                    r-maps
coinhsl                          perl-io-socket-ssl                     r-maptools
colm                             perl-io-string                         r-markdown
colordiff                        perl-json                              r-mass
comd                             perl-libwww-perl                       r-matr
compiz                           perl-list-moreutils                    r-matrix
compositeproto                   perl-log-log4perl                      r-matrixmodels
conduit                          perl-lwp                               r-matrixstats
constype                         perl-lwp-mediatypes                    r-mclust
converge                         perl-lwp-protocol-https                r-mcmcglmm
coreutils                        perl-math-cdf                          r-mco
corset                           perl-math-matrixreal                   r-mda
cosmomc                          perl-module-build                      r-memoise
cosp2                            perl-module-implementation             r-mergemaid
cp2k                             perl-module-runtime                    r-methodss3
cppad                            perl-module-runtime-conflicts          r-mgcv
cppcheck                         perl-moose                             r-mgraster
cpprestsdk                       perl-mozilla-ca                        r-mice
cppunit                          perl-mro-compat                        r-mime
cppzmq                           perl-namespace-clean                   r-minfi
cpu-features                     perl-net-http                          r-minqa
cpuinfo                          perl-net-scp-expect                    r-misc3d
cram                             perl-net-ssleay                        r-mitml
cryptopp                         perl-package-deprecationmanager        r-mixtools
cscope                           perl-package-stash                     r-mlbench
csdp                             perl-package-stash-xs                  r-mlinterfaces
ctffind                          perl-padwalker                         r-mlr
cub                              perl-parallel-forkmanager              r-mlrmbo
cube                             perl-params-util                       r-mmwrweek
cuda                             perl-parse-recdescent                  r-mnormt
cuda-memtest                     perl-pdf-api2                          r-modelmetrics
cudnn                            perl-pegex                             r-modelr
cufflinks                        perl-perlio-gzip                       r-modeltools
cups                             perl-perlio-utf8-strict                r-mpm
curl                             perl-soap-lite                         r-msnbase
cvs                              perl-star-fusion                       r-multcomp
czmq                             perl-statistics-descriptive            r-multtest
dakota                           perl-statistics-pca                    r-munsell
daligner                         perl-sub-exporter                      r-mvtnorm
damageproto                      perl-sub-exporter-progressive          r-mzid
damselfly                        perl-sub-identify                      r-mzr
darshan-runtime                  perl-sub-install                       r-nanotime
darshan-util                     perl-sub-name                          r-ncbit
dash                             perl-sub-uplevel                       r-ncdf4
datamash                         perl-svg                               r-network
dataspaces                       perl-swissknife                        r-networkd3
davix                            perl-task-weaken                       r-nlme
dbus                             perl-term-readkey                      r-nloptr
dealii                           perl-test-cleannamespaces              r-nmf
dealii-parameter-gui             perl-test-deep                         r-nnet
deconseq-standalone              perl-test-differences                  r-nnls
dejagnu                          perl-test-exception                    r-nor1mix
delly2                           perl-test-fatal                        r-np
denovogear                       perl-test-memory-cycle                 r-numderiv
dia                              perl-test-most                         r-oligoclasses
dialign-tx                       perl-test-needs                        r-oo
diamond                          perl-test-requires                     r-openssl
diffsplice                       perl-test-requiresinternet             r-org-hs-eg-db
direnv                           perl-test-warn                         r-organismdbi
discovar                         perl-test-warnings                     r-packrat
discovardenovo                   perl-text-csv                          r-pacman
dislin                           perl-text-diff                         r-pamr
dlpack                           perl-text-simpletable                  r-pan
dmlc-core                        perl-text-soundex                      r-parallelmap
dmxproto                         perl-text-unidecode                    r-paramhelpers
docbook-xml                      perl-time-hires                        r-party
docbook-xsl                      perl-time-piece                        r-partykit
dos2unix                         perl-try-tiny                          r-pathview
double-conversion                perl-uri                               r-pbapply
doxygen                          perl-uri-escape                        r-pbdzmq
dri2proto                        perl-version                           r-pbkrtest
dri3proto                        perl-want                              r-pcamethods
dsdp                             perl-www-robotrules                    r-pcapp
dsrc                             perl-xml-libxml                        r-permute
dtcmp                            perl-xml-parser                        r-pfam-db
dyninst                          perl-xml-parser-lite                   r-phangorn
ea-utils                         perl-xml-simple                        r-phantompeakqualtools
easybuild                        perl-yaml-libyaml                      r-phyloseq
ebms                             petsc                                  r-picante
eccodes                          pexsi                                  r-pkgconfig
eclipse-gcj-parser               pfft                                   r-pkgmaker
ecp-proxy-apps                   pflotran                               r-plogr
ed                               pfunit                                 r-plot3d
editres                          pgdspider                              r-plotly
eigen                            pgi                                    r-plotrix
elasticsearch                    phantompeakqualtools                   r-pls
elemental                        phast                                  r-plyr
elfutils                         phasta                                 r-pmcmr
elk                              phist                                  r-png
elpa                             phylip                                 r-powerlaw
emacs                            picard                                 r-prabclus
emboss                           pidx                                   r-praise
encodings                        pigz                                   r-preprocesscore
environment-modules              pilon                                  r-prettyunits
eospac                           pindel                                 r-proc
es                               piranha                                r-prodlim
esmf                             pism                                   r-progress
essl                             pixman                                 r-protgenerics
ethminer                         pkg-config                             r-proto
etsf-io                          pkgconf                                r-proxy
everytrace                       planck-likelihood                      r-pryr
everytrace-example               plasma                                 r-psych
evieext                          platypus                               r-ptw
exabayes                         plink                                  r-purrr
examinimd                        plplot                                 r-quadprog
exampm                           plumed                                 r-quantmod
exasp2                           pmgr-collective                        r-quantreg
exmcutils                        pmix                                   r-quantro
exodusii                         pnfft                                  r-qvalue
exonerate                        pngwriter                              r-r6
expat                            pnmpi                                  r-randomforest
expect                           poamsa                                 r-ranger
express                          pocl                                   r-rappdirs
extrae                           polymake                               r-raster
exuberant-ctags                  poppler                                r-rbgl
f90cache                         poppler-data                           r-rbokeh
fabtests                         porta                                  r-rcolorbrewer
falcon                           portage                                r-rcpp
farmhash                         postgresql                             r-rcpparmadillo
fast-gbs                         ppl                                    r-rcppblaze
fastjar                          prank                                  r-rcppcctz
fastmath                         presentproto                           r-rcppcnpy
fastme                           preseq                                 r-rcppeigen
fastphase                        price                                  r-rcppprogress
fastq-screen                     primer3                                r-rcurl
fastqc                           prinseq-lite                           r-rda
fastqvalidator                   printproto                             r-readr
fasttree                         prng                                   r-readxl
fastx-toolkit                    probconsrna                            r-registry
fenics                           prodigal                               r-rematch
fermi                            proj                                   r-reordercluster
fermikit                         protobuf                               r-reportingtools
fermisciencetools                proxymngr                              r-repr
ferret                           pruners-ninja                          r-reprex
ffmpeg                           ps-lite                                r-reshape
fftw                             psi4                                   r-reshape2
fimpute                          pslib                                  r-rex
findutils                        psm                                    r-rgdal
fio                              psmc                                   r-rgenoud
fish                             pstreams                               r-rgeos
fixesproto                       pugixml                                r-rgl
flac                             pumi                                   r-rgooglemaps
flang                            pv                                     r-rgraphviz
flann                            pvm                                    r-rhdf5
flash                            py-3to2                                r-rhtslib
flecsale                         py-4suite-xml                          r-rinside
flecsi                           py-abipy                               r-rjags
flex                             py-adios                               r-rjava
flint                            py-affine                              r-rjson
flit                             py-alabaster                           r-rjsonio
fltk                             py-apache-libcloud                     r-rlang
flux                             py-apipkg                              r-rmarkdown
fluxbox                          py-appdirs                             r-rminer
fmt                              py-appnope                             r-rmpfr
foam-extend                      py-apscheduler                         r-rmpi
folly                            py-argcomplete                         r-rmysql
font-adobe-100dpi                py-argparse                            r-rngtools
font-adobe-75dpi                 py-ase                                 r-robustbase
font-adobe-utopia-100dpi         py-asn1crypto                          r-rocr
font-adobe-utopia-75dpi          py-astroid                             r-rodbc
font-adobe-utopia-type1          py-astropy                             r-roxygen2
font-alias                       py-attrs                               r-rpart
font-arabic-misc                 py-autopep8                            r-rpart-plot
font-bh-100dpi                   py-avro                                r-rpostgresql
font-bh-75dpi                    py-avro-json-serializer                r-rprojroot
font-bh-lucidatypewriter-100dpi  py-babel                               r-rsamtools
font-bh-lucidatypewriter-75dpi   py-backports-abc                       r-rsnns
font-bh-ttf                      py-backports-functools-lru-cache       r-rsolnp
font-bh-type1                    py-backports-shutil-get-terminal-size  r-rsqlite
font-bitstream-100dpi            py-backports-ssl-match-hostname        r-rstan
font-bitstream-75dpi             py-basemap                             r-rstudioapi
font-bitstream-speedo            py-bcbio-gff                           r-rtracklayer
font-bitstream-type1             py-beautifulsoup4                      r-rtsne
font-cronyx-cyrillic             py-binwalk                             r-rvcheck
font-cursor-misc                 py-biom-format                         r-rvest
font-daewoo-misc                 py-biopython                           r-rzmq
font-dec-misc                    py-bitarray                            r-s4vectors
font-ibm-type1                   py-bitstring                           r-samr
font-isas-misc                   py-bleach                              r-sandwich
font-jis-misc                    py-blessings                           r-scales
font-micro-misc                  py-bokeh                               r-scatterplot3d
font-misc-cyrillic               py-boltons                             r-sdmtools
font-misc-ethiopic               py-bottleneck                          r-segmented
font-misc-meltho                 py-breakseq2                           r-selectr
font-misc-misc                   py-brian                               r-seqinr
font-mutt-misc                   py-brian2                              r-seqlogo
font-schumacher-misc             py-bsddb3                              r-seurat
font-screen-cyrillic             py-bx-python                           r-sf
font-sony-misc                   py-cartopy                             r-sfsmisc
font-sun-misc                    py-cclib                               r-shape
font-util                        py-cdat-lite                           r-shiny
font-winitzki-cyrillic           py-cdo                                 r-shinydashboard
font-xfree86-type1               py-certifi                             r-shortread
fontcacheproto                   py-cffi                                r-siggenes
fontconfig                       py-chardet                             r-simpleaffy
fontsproto                       py-checkm-genome                       r-smoof
fonttosfnt                       py-click                               r-sn
fp16                             py-cligj                               r-snow
fpc                              py-cloudpickle                         r-snowfall
fr-hit                           py-cnvkit                              r-snprelate
freebayes                        py-cogent                              r-som
freeglut                         py-colorama                            r-somaticsignatures
freetype                         py-colormath                           r-sourcetools
fseq                             py-configparser                        r-sp
fsl                              py-counter                             r-sparsem
fslsfonts                        py-coverage                            r-spatial
fstobdf                          py-cpuinfo                             r-spdep
ftgl                             py-crispresso                          r-speedglm
funhpc                           py-crossmap                            r-spem
fyba                             py-cryptography                        r-splitstackshape
gapbs                            py-csvkit                              r-sqldf
gapcloser                        py-current                             r-squash
gapfiller                        py-cutadapt                            r-stanheaders
gasnet                           py-cvxopt                              r-statmod
gatk                             py-cycler                              r-statnet-common
gaussian                         py-cython                              r-stringi
gawk                             py-dask                                r-stringr
gblocks                          py-dateutil                            r-strucchange
gcc                              py-dbf                                 r-subplex
gccmakedep                       py-decorator                           r-summarizedexperiment
gccxml                           py-deeptools                           r-survey
gconf                            py-dendropy                            r-survival
gcta                             py-dev                                 r-sva
gdal                             py-dill                                r-tarifx
gdb                              py-discover                            r-tclust
gdbm                             py-dlcpar                              r-tensora
gdk-pixbuf                       py-docopt                              r-testit
gdl                              py-docutils                            r-testthat
geant4                           py-doxypy                              r-tfbstools
gearshifft                       py-doxypypy                            r-tfmpvalue
gemmlowp                         py-dryscrape                           r-th-data
genemark-et                      py-dxchange                            r-threejs
genomefinisher                   py-dxfile                              r-tibble
genometools                      py-easybuild-easyblocks                r-tidycensus
geopm                            py-easybuild-easyconfigs               r-tidyr
geos                             py-easybuild-framework                 r-tidyselect
gettext                          py-edffile                             r-tidyverse
gflags                           py-editdistance                        r-tiff
ghost                            py-elasticsearch                       r-tigris
ghostscript                      py-elephant                            r-timedate
ghostscript-fonts                py-emcee                               r-tmixclust
giflib                           py-entrypoints                         r-topgo
git                              py-enum34                              r-trimcluster
git-imerge                       py-epydoc                              r-truncnorm
git-lfs                          py-espresso                            r-trust
gl2ps                            py-espressopp                          r-tseries
glew                             py-et-xmlfile                          r-tsne
glfmultiples                     py-eventlet                            r-ttr
glib                             py-execnet                             r-udunits2
glimmer                          py-fastaindex                          r-units
glm                              py-fasteners                           r-utf8
global                           py-faststructure                       r-utils
globalarrays                     py-fiscalyear                          r-uuid
globus-toolkit                   py-flake8                              r-variantannotation
glog                             py-flask                               r-varselrf
gloo                             py-flask-compress                      r-vcd
glpk                             py-flask-socketio                      r-vegan
glproto                          py-flexx                               r-vgam
glvis                            py-fparser                             r-vipor
gmake                            py-funcsigs                            r-viridis
gmap-gsnap                       py-functools32                         r-viridislite
gmime                            py-future                              r-visnetwork
gmp                              py-futures                             r-vsn
gmsh                             py-gdbgui                              r-whisker
gnat                             py-genders                             r-withr
gnu-prolog                       py-genshi                              r-xde
gnupg                            py-gevent                              r-xgboost
gnuplot                          py-git-review                          r-xlconnect
gnutls                           py-git2                                r-xlconnectjars
go                               py-gnuplot                             r-xlsx
go-bootstrap                     py-goatools                            r-xlsxjars
gobject-introspection            py-gpaw                                r-xmapbridge
googletest                       py-greenlet                            r-xml
gotcha                           py-griddataformats                     r-xml2
gource                           py-guidata                             r-xtable
gperf                            py-guiqwt                              r-xts
gperftools                       py-h5py                                r-xvector
gplates                          py-html2text                           r-yaml
grackle                          py-html5lib                            r-yapsa
gradle                           py-htseq                               r-yaqcaffy
grandr                           py-httpbin                             r-yarn
graph500                         py-hypothesis                          r-zlibbioc
graphicsmagick                   py-idna                                r-zoo
graphlib                         py-igraph                              racon
graphmap                         py-illumina-utils                      raft
graphviz                         py-imagesize                           ragel
grib-api                         py-iminuit                             raja
groff                            py-importlib                           randfold
gromacs                          py-ipaddress                           random123
gsl                              py-ipdb                                randrproto
gslib                            py-ipykernel                           rapidjson
gtkorvo-atl                      py-ipython                             ravel
gtkorvo-cercs-env                py-ipython-genutils                    raxml
gtkorvo-dill                     py-ipywidgets                          ray
gtkorvo-enet                     py-isort                               rdma-core
gtkplus                          py-itsdangerous                        rdp-classifier
gts                              py-jdcal                               re2c
guidance                         py-jedi                                readfq
guile                            py-jinja2                              readline
gurobi                           py-joblib                              recordproto
h5hut                            py-jpype                               redundans
h5part                           py-jsonschema                          relion
h5utils                          py-junit-xml                           rempi
h5z-zfp                          py-jupyter-client                      rename
hacckernels                      py-jupyter-console                     rendercheck
hadoop                           py-jupyter-core                        renderproto
hapcut2                          py-jupyter-notebook                    repeatmasker
hapdip                           py-keras                               resourceproto
haploview                        py-kiwisolver                          revbayes
harfbuzz                         py-latexcodec                          rgb
harminv                          py-lazy                                rhash
hdf                              py-lazy-object-proxy                   rlwrap
hdf5                             py-lazyarray                           rmlab
hdf5-blosc                       py-libconf                             rna-seqc
help2man                         py-libensemble                         rngstreams
hepmc                            py-line-profiler                       rockstar
heppdt                           py-linecache2                          root
hic-pro                          py-lit                                 rose
highfive                         py-llvmlite                            rr
highwayhash                      py-lmfit                               rsbench
hiop                             py-localcider                          rsem
hisat2                           py-locket                              rstart
hisea                            py-lockfile                            rsync
hmmer                            py-logilab-common                      rtags
hoomd-blue                       py-lrudict                             rtax
hpccg                            py-lxml                                ruby
hpctoolkit                       py-lzstring                            ruby-gnuplot
hpctoolkit-externals             py-macholib                            ruby-narray
hpgmg                            py-machotools                          ruby-ronn
hpl                              py-macs2                               ruby-rubyinline
hpx                              py-maestrowf                           ruby-svn2git
hpx5                             py-mako                                ruby-terminal-table
hsakmt                           py-mappy                               rust
hstr                             py-markdown                            rust-bindgen
htop                             py-markupsafe                          sabre
htslib                           py-matplotlib                          sailfish
httpie                           py-mccabe                              salmon
hub                              py-mdanalysis                          sambamba
hunspell                         py-meep                                samblaster
hwloc                            py-memory-profiler                     samrai
hybpiper                         py-methylcode                          samtools
hydra                            py-mg-rast-tools                       sandbox
hydrogen                         py-misopy                              sas
hypre                            py-mistune                             satsuma2
i3                               py-mock                                savanna
ibmisc                           py-moltemplate                         saws
iceauth                          py-mongo                               sbt
icedtea                          py-monotonic                           scala
icet                             py-monty                               scalasca
ico                              py-more-itertools                      scalpel
icu4c                            py-mpi4py                              scan-for-matches
id3lib                           py-mpmath                              scons
idba                             py-multiprocess                        scorec-core
igraph                           py-multiqc                             scorep
igv                              py-mx                                  scotch
igvtools                         py-mxnet                               scr
ilmbase                          py-myhdl                               screen
image-magick                     py-mysqldb1                            scripts
imake                            py-natsort                             scrnsaverproto
imp                              py-nbconvert                           sctk
impute2                          py-nbformat                            sdl2
infernal                         py-neo                                 sdl2-image
inputproto                       py-nestle                              sed
intel                            py-netcdf4                             seqan
intel-daal                       py-netifaces                           seqprep
intel-gpu-tools                  py-networkx                            seqtk
intel-ipp                        py-nose                                serf
intel-mkl                        py-nosexcover                          sessreg
intel-mkl-dnn                    py-numba                               setxkbmap
intel-mpi                        py-numexpr                             sga
intel-parallel-studio            py-numexpr3                            shapeit
intel-tbb                        py-numpy                               shared-mime-info
intel-xed                        py-numpydoc                            shiny-server
intltool                         py-olefile                             shocklibs
ior                              py-ont-fast5-api                       shoremap
iozone                           py-openpmd-validator                   shortbred
ipopt                            py-openpyxl                            shortstack
isaac                            py-openslide-python                    showfont
isaac-server                     py-ordereddict                         sickle
isl                              py-oset                                siesta
itstool                          py-owslib                              signalp
itsx                             py-packaging                           signify
jags                             py-palettable                          silo
jansson                          py-pandas                              simplemoc
jasper                           py-paramiko                            simul
jbigkit                          py-partd                               simulationio
jchronoss                        py-pathlib2                            singularity
jdk                              py-pathos                              sleef
jellyfish                        py-pathspec                            slepc
jemalloc                         py-patsy                               slurm
jmol                             py-pbr                                 smalt
jq                               py-perf                                smproxy
json-c                           py-performance                         snakemake
json-cwx                         py-periodictable                       snap
json-glib                        py-petsc4py                            snap-berkeley
jsoncpp                          py-pexpect                             snap-korf
judy                             py-phonopy                             snappy
julia                            py-pickleshare                         snbone
k8                               py-pil                                 sniffles
kahip                            py-pillow                              snpeff
kaiju                            py-pip                                 snphylo
kaks-calculator                  py-pipits                              snptest
kaldi                            py-pkgconfig                           soap2
kallisto                         py-plotly                              soapdenovo-trans
kbproto                          py-pluggy                              soapdenovo2
kdiff3                           py-ply                                 soapindel
kealib                           py-pmw                                 soapsnp
kentutils                        py-poster                              sofa-c
kmergenie                        py-pox                                 somatic-sniper
kokkos                           py-ppft                                sortmerna
kraken                           py-prettytable                         sosflow
krb5                             py-proj                                sowing
krims                            py-projectq                            sox
kripke                           py-prompt-toolkit                      spades
kvasir-mpl                       py-protobuf                            spark
laghos                           py-psutil                              sparsehash
lammps                           py-psyclone                            sparta
last                             py-ptyprocess                          spdlog
latte                            py-pudb                                spectrum-mpi
launchmon                        py-py                                  speex
lazyten                          py-py2bit                              spglib
lbann                            py-py2cairo                            sph2pipe
lbxproxy                         py-py2neo                              spherepack
lcals                            py-py4j                                spindle
lcms                             py-pyani                               spot
ldc                              py-pyasn1                              sqlite
ldc-bootstrap                    py-pybedtools                          sqlitebrowser
legion                           py-pybigwig                            squid
leveldb                          py-pybind11                            sra-toolkit
lftp                             py-pybtex                              sspace-longread
libaec                           py-pybtex-docutils                     sspace-standard
libaio                           py-pychecker                           sst-dumpi
libapplewm                       py-pycodestyle                         sst-macro
libarchive                       py-pycparser                           stacks
libassuan                        py-pycrypto                            staden-io-lib
libatomic-ops                    py-pycurl                              star
libbeagle                        py-pydatalog                           star-ccm-plus
libbsd                           py-pydispatcher                        startup-notification
libbson                          py-pydot                               stat
libcanberra                      py-pyelftools                          stc
libcap                           py-pyepsg                              stow
libceed                          py-pyfaidx                             strace
libcerf                          py-pyfasta                             stream
libcheck                         py-pyfftw                              strelka
libcint                          py-pyflakes                            stress
libcircle                        py-pygdbmi                             stringtie
libconfig                        py-pygments                            structure
libcroco                         py-pygobject                           sublime-text
libctl                           py-pygpu                               subread
libdivsufsort                    py-pygtk                               subversion
libdmx                           py-pylint                              suite-sparse
libdrm                           py-pymatgen                            sumaclust
libdwarf                         py-pyminifier                          sundials
libedit                          py-pymol                               superlu
libelf                           py-pympler                             superlu-dist
libemos                          py-pynn                                superlu-mt
libepoxy                         py-pypar                               supernova
libev                            py-pyparsing                           sw4lite
libevent                         py-pypeflow                            swap-assembler
libevpath                        py-pyprof2html                         swarm
libfabric                        py-pyqt                                swfft
libffi                           py-pyrad                               swiftsim
libffs                           py-pysam                               swig
libfontenc                       py-pyscaf                              symengine
libfs                            py-pyserial                            sympol
libgcrypt                        py-pyshp                               sz
libgd                            py-pyside                              tabix
libgeotiff                       py-pysocks                             talloc
libgit2                          py-pysqlite                            tantan
libgpg-error                     py-pytables                            tar
libgpuarray                      py-pytest                              targetp
libgridxc                        py-pytest-cov                          task
libgtextutils                    py-pytest-flake8                       taskd
libharu                          py-pytest-httpbin                      tasmanian
libhio                           py-pytest-mock                         tassel
libice                           py-pytest-runner                       tau
libiconv                         py-pytest-xdist                        tcl
libint                           py-python-daemon                       tcl-tcllib
libjpeg                          py-python-engineio                     tcl-tclxml
libjpeg-turbo                    py-python-gitlab                       tclap
libksba                          py-python-levenshtein                  tcoffee
liblbxutil                       py-python-socketio                     tcptrace
liblockfile                      py-pythonqwt                           tcsh
libmatheval                      py-pytz                                tealeaf
libmaxminddb                     py-pyutilib                            tetgen
libmesh                          py-pyvcf                               tethex
libmng                           py-pywavelets                          texinfo
libmongoc                        py-pyyaml                              texlive
libmonitor                       py-qtawesome                           the-platinum-searcher
libnbc                           py-qtconsole                           the-silver-searcher
libnl                            py-qtpy                                thrift
libogg                           py-quantities                          thrust
liboldx                          py-quast                               tig
libpcap                          py-radical-utils                       tinyxml
libpciaccess                     py-ranger                              tinyxml2
libpfm4                          py-rasterio                            tioga
libpipeline                      py-readme-renderer                     tk
libpng                           py-regex                               tmalign
libpsl                           py-reportlab                           tmhmm
libpthread-stubs                 py-requests                            tmux
libquo                           py-requests-toolbelt                   tmuxinator
librom                           py-restview                            tophat
libshm                           py-rope                                tppred
libsigsegv                       py-rpy2                                transabyss
libsm                            py-rsa                                 transdecoder
libsodium                        py-rseqc                               transposome
libspatialindex                  py-rtree                               transset
libsplash                        py-saga-python                         trapproto
libssh                           py-scandir                             tree
libssh2                          py-scientificpython                    trf
libsvm                           py-scikit-image                        triangle
libszip                          py-scikit-learn                        trilinos
libtermkey                       py-scipy                               trimgalore
libtiff                          py-seaborn                             trimmomatic
libtool                          py-setuptools                          trinity
libunistring                     py-setuptools-git                      trnascan-se
libunwind                        py-setuptools-scm                      turbine
libuuid                          py-sfepy                               turbomole
libuv                            py-sh                                  tut
libvorbis                        py-shapely                             twm
libvterm                         py-shiboken                            tycho2
libwebsockets                    py-simplegeneric                       typhon
libwindowswm                     py-simplejson                          typhonio
libx11                           py-singledispatch                      uberftp
libxau                           py-sip                                 ucx
libxaw                           py-six                                 udunits2
libxaw3d                         py-slepc4py                            ufo-core
libxc                            py-slurm-pipeline                      ufo-filters
libxcb                           py-sncosmo                             umpire
libxcomposite                    py-snowballstemmer                     unblur
libxcursor                       py-snuggs                              uncrustify
libxdamage                       py-spectra                             unibilium
libxdmcp                         py-spefile                             unison
libxevie                         py-spglib                              units
libxext                          py-sphinx                              unixodbc
libxfixes                        py-sphinx-bootstrap-theme              unuran
libxfont                         py-sphinx-rtd-theme                    unzip
libxfont2                        py-sphinxcontrib-bibtex                usearch
libxfontcache                    py-sphinxcontrib-programoutput         util-linux
libxft                           py-sphinxcontrib-websupport            util-macros
libxi                            py-spyder                              uuid
libxinerama                      py-spykeutils                          valgrind
libxkbcommon                     py-sqlalchemy                          vampirtrace
libxkbfile                       py-statsmodels                         vardictjava
libxkbui                         py-stevedore                           varscan
libxml2                          py-storm                               vc
libxmu                           py-subprocess32                        vcftools
libxp                            py-symengine                           vcsh
libxpm                           py-symfit                              vdt
libxpresent                      py-sympy                               vecgeom
libxprintapputil                 py-tabulate                            veclibfort
libxprintutil                    py-tappy                               vegas2
libxrandr                        py-terminado                           velvet
libxrender                       py-testinfra                           verilator
libxres                          py-tetoolkit                           videoproto
libxscrnsaver                    py-theano                              viennarna
libxshmfence                     py-tifffile                            viewres
libxslt                          py-toml                                vim
libxsmm                          py-tomopy                              virtualgl
libxstream                       py-toolz                               visit
libxt                            py-tornado                             vizglow
libxtrap                         py-tqdm                                vmatch
libxtst                          py-traceback2                          voropp
libxv                            py-traitlets                           votca-csg
libxvmc                          py-tuiview                             votca-ctp
libxxf86dga                      py-twisted                             votca-tools
libxxf86misc                     py-typing                              votca-xtp
libxxf86vm                       py-tzlocal                             vpfft
libyogrt                         py-udunits                             vpic
libzip                           py-umi-tools                           vsearch
likwid                           py-unittest2                           vt
linkphase3                       py-unittest2py3k                       vtk
linux-headers                    py-urllib3                             vtkh
listres                          py-urwid                               vtkm
llvm                             py-vcversioner                         wannier90
llvm-openmp-ompt                 py-virtualenv                          wcslib
lmdb                             py-virtualenv-clone                    wget
lmod                             py-virtualenvwrapper                   wgsim
lndir                            py-vmd-python                          windowswmproto
log4cplus                        py-vsc-base                            wireshark
log4cxx                          py-vsc-install                         wt
loki                             py-wcsaxes                             wx
lordec                           py-wcwidth                             wxpropgrid
lrslib                           py-webkit-server                       x11perf
lrzip                            py-weblogo                             xapian-core
lsof                             py-werkzeug                            xauth
ltrace                           py-wheel                               xbacklight
lua                              py-widgetsnbextension                  xbiff
lua-bitlib                       py-wrapt                               xbitmaps
lua-jit                          py-xarray                              xbraid
lua-lpeg                         py-xattr                               xcalc
lua-luafilesystem                py-xlrd                                xcb-demo
lua-luaposix                     py-xlsxwriter                          xcb-proto
lua-mpack                        py-xmlrunner                           xcb-util
luit                             py-xopen                               xcb-util-cursor
lulesh                           py-xpyb                                xcb-util-errors
lumpy-sv                         py-xvfbwrapper                         xcb-util-image
lwgrp                            py-yamlreader                          xcb-util-keysyms
lwm2                             py-yapf                                xcb-util-renderutil
lz4                              py-yt                                  xcb-util-wm
lzma                             py-zmq                                 xcb-util-xrm
lzo                              py-zope-event                          xclip
m4                               py-zope-interface                      xclipboard
macsio                           python                                 xclock
mad-numdiff                      qbank                                  xcmiscproto
mafft                            qbox                                   xcmsdb
magics                           qhull                                  xcompmgr
magma                            qmcpack                                xconsole
makedepend                       qmd-progress                           xcursor-themes
mallocmc                         qrupdate                               xcursorgen
man-db                           qt                                     xdbedizzy
manta                            qt-creator                             xditview
maq                              qtgraph                                xdm
mariadb                          qthreads                               xdpyinfo
masa                             quantum-espresso                       xdriinfo
masurca                          quinoa                                 xedit
matio                            qwt                                    xerces-c
matlab                           r                                      xev
maven                            r-a4                                   xextproto
maverick                         r-a4base                               xeyes
mawk                             r-a4classif                            xf86bigfontproto
mbedtls                          r-a4core                               xf86dga
mc                               r-a4preproc                            xf86dgaproto
mcl                              r-a4reporting                          xf86driproto
mdtest                           r-abadata                              xf86miscproto
meep                             r-abaenrichment                        xf86rushproto
mefit                            r-abind                                xf86vidmodeproto
megahit                          r-absseq                               xfd
memaxes                          r-acde                                 xfindproxy
meme                             r-acepack                              xfontsel
memkind                          r-acgh                                 xfs
meraculous                       r-acme                                 xfsinfo
mercurial                        r-ada                                  xfwp
mesa                             r-adabag                               xgamma
mesa-glu                         r-ade4                                 xgc
meshkit                          r-adegenet                             xhost
meson                            r-adsplit                              xineramaproto
mesquite                         r-affxparser                           xinit
metabat                          r-affy                                 xinput
metaphysicl                      r-affycomp                             xios
metasv                           r-affycompatible                       xkbcomp
metis                            r-affycontam                           xkbdata
mfem                             r-affycoretools                        xkbevd
microbiomeutil                   r-affydata                             xkbprint
minced                           r-affyexpress                          xkbutils
mindthegap                       r-affyilm                              xkeyboard-config
miniaero                         r-affyio                               xkill
miniamr                          r-affypdnn                             xload
miniasm                          r-affyplm                              xlogo
miniconda2                       r-affyqcreport                         xlsatoms
miniconda3                       r-affyrnadegradation                   xlsclients
minife                           r-agdex                                xlsfonts
minighost                        r-agilp                                xmag
minigmg                          r-agimicrorna                          xman
minimap2                         r-aims                                 xmessage
minimd                           r-aldex2                               xmh
miniqmc                          r-allelicimbalance                     xmlf90
minisign                         r-alpine                               xmlto
minismac2d                       r-als                                  xmodmap
minitri                          r-alsace                               xmore
minixyce                         r-altcdfenvs                           xorg-cf-files
mira                             r-ampliqueso                           xorg-docs
mirdeep2                         r-analysispageserver                   xorg-gtest
mitofates                        r-anaquin                              xorg-server
mitos                            r-aneufinder                           xorg-sgml-doctools
mkfontdir                        r-aneufinderdata                       xphelloworld
mkfontscale                      r-annaffy                              xplor-nih
mlhka                            r-annotate                             xplsprinters
moab                             r-annotationdbi                        xpr
modern-wheel                     r-annotationfilter                     xprehashprinterlist
molcas                           r-annotationforge                      xprop
mono                             r-annotationhub                        xproto
mosh                             r-ape                                  xproxymanagementprotocol
mothur                           r-assertthat                           xqilla
motif                            r-backports                            xrandr
motioncor2                       r-bamsignals                           xrdb
mozjs                            r-base64                               xrefresh
mpark-variant                    r-base64enc                            xrootd
mpc                              r-bbmisc                               xrx
mpe2                             r-beanplot                             xsbench
mpest                            r-bh                                   xscope
mpfr                             r-bindr                                xsdk
mpibash                          r-bindrcpp                             xsdktrilinos
mpiblast                         r-biobase                              xset
mpich                            r-biocgenerics                         xsetmode
mpifileutils                     r-biocinstaller                        xsetpointer
mpilander                        r-biocparallel                         xsetroot
mpileaks                         r-biocstyle                            xsimd
mpip                             r-biom-utils                           xsm
mpir                             r-biomart                              xstdcmap
mpix-launch-swift                r-biomformat                           xtensor
mrbayes                          r-biostrings                           xtensor-python
mrnet                            r-biovizbase                           xterm
mrtrix3                          r-bit                                  xtl
mscgen                           r-bit64                                xtrans
msgpack-c                        r-bitops                               xtrap
mshadow                          r-blob                                 xts
multitail                        r-bookdown                             xvidtune
multiverso                       r-boot                                 xvinfo
mummer                           r-brew                                 xwd
mumps                            r-broom                                xwininfo
munge                            r-bsgenome                             xwud
muparser                         r-bumphunter                           xz
muscle                           r-c50                                  yajl
muse                             r-callr                                yambo
muster                           r-car                                  yaml-cpp
mvapich2                         r-caret                                yasm
mxml                             r-category                             yorick
mxnet                            r-catools                              z3
nag                              r-cdcfluview                           zeromq
nalu                             r-cellranger                           zfp
nalu-wind                        r-cghflasso                            zip
namd                             r-checkmate                            zlib
nano                             r-checkpoint                           zoltan
nanoflann                        r-chemometrics                         zsh
nanopb                           r-chron                                zstd

The packages are listed by name in alphabetical order. A pattern to match with no wildcards, * or ?, will be treated as though it started and ended with *, so util is equivalent to *util*. All patterns will be treated as case-insensitive. You can also add the -d to search the description of the package in addition to the name. Some examples:

All packages whose names contain “sql”:

$ spack list sql
perl-dbd-mysql  py-mysqldb1  py-sqlalchemy  r-rpostgresql  r-sqldf  sqlitebrowser
postgresql      py-pysqlite  r-rmysql       r-rsqlite      sqlite

All packages whose names or descriptions contain documentation:

$ spack list --search-description documentation
compositeproto     libxfixes     py-docutils                  r-ggplot2   r-stanheaders
damageproto        libxpresent   py-epydoc                    r-quadprog  sowing
double-conversion  man-db        py-markdown                  r-rcpp      texinfo
doxygen            perl-dbfile   py-sphinx                    r-rinside   xorg-docs
gflags             py-alabaster  py-sphinxcontrib-websupport  r-roxygen2  xorg-sgml-doctools

spack info

To get more information on a particular package from spack list, use spack info. Just supply the name of a package:

$ spack info mpich
AutotoolsPackage:   mpich

Description:
    MPICH is a high performance and widely portable implementation of the
    Message Passing Interface (MPI) standard.

Homepage: http://www.mpich.org

Tags: 
    None

Preferred version:  
    3.2.1      http://www.mpich.org/static/downloads/3.2.1/mpich-3.2.1.tar.gz

Safe versions:  
    develop    [git] git://github.com/pmodels/mpich
    3.2.1      http://www.mpich.org/static/downloads/3.2.1/mpich-3.2.1.tar.gz
    3.2        http://www.mpich.org/static/downloads/3.2/mpich-3.2.tar.gz
    3.1.4      http://www.mpich.org/static/downloads/3.1.4/mpich-3.1.4.tar.gz
    3.1.3      http://www.mpich.org/static/downloads/3.1.3/mpich-3.1.3.tar.gz
    3.1.2      http://www.mpich.org/static/downloads/3.1.2/mpich-3.1.2.tar.gz
    3.1.1      http://www.mpich.org/static/downloads/3.1.1/mpich-3.1.1.tar.gz
    3.1        http://www.mpich.org/static/downloads/3.1/mpich-3.1.tar.gz
    3.0.4      http://www.mpich.org/static/downloads/3.0.4/mpich-3.0.4.tar.gz

Variants:
    Name [Default]    Allowed values        Description


    device [ch3]      ch3, ch4              Abstract Device Interface
                                            (ADI) implementation. The ch4
                                            device is currently in
                                            experimental state
    hydra [on]        True, False           Build the hydra process
                                            manager
    netmod [tcp]      tcp, mxm, ofi, ucx    Network module. Only single
                                            netmod builds are supported.
                                            For ch3 device configurations,
                                            this presumes the ch3:nemesis
                                            communication channel.
                                            ch3:sock is not supported by
                                            this spack package at this
                                            time.
    pmi [on]          True, False           Build with PMI support
    romio [on]        True, False           Enable ROMIO MPI I/O
                                            implementation
    verbs [off]       True, False           Build support for OpenFabrics
                                            verbs.

Installation Phases:
    autoreconf    configure    build    install

Build Dependencies:
    libfabric

Link Dependencies:
    libfabric

Run Dependencies:
    None

Virtual Packages: 
    mpich@3: provides mpi@:3.0
    mpich@1: provides mpi@:1.3
    mpich provides mpi

Most of the information is self-explanatory. The safe versions are versions that Spack knows the checksum for, and it will use the checksum to verify that these versions download without errors or viruses.

Dependencies and virtual dependencies are described in more detail later.

spack versions

To see more available versions of a package, run spack versions. For example:

$ spack versions libelf
==> Safe versions (already checksummed):
  0.8.13  0.8.12
==> Remote versions (not yet checksummed):
  0.8.11  0.8.10  0.8.9  0.8.8  0.8.7  0.8.6  0.8.5  0.8.4  0.8.3  0.8.2  0.8.0  0.7.0  0.6.4  0.5.2

There are two sections in the output. Safe versions are versions for which Spack has a checksum on file. It can verify that these versions are downloaded correctly.

In many cases, Spack can also show you what versions are available out on the web—these are remote versions. Spack gets this information by scraping it directly from package web pages. Depending on the package and how its releases are organized, Spack may or may not be able to find remote versions.

Installing and uninstalling

spack install

spack install will install any package shown by spack list. For example, To install the latest version of the mpileaks package, you might type this:

$ spack install mpileaks

If mpileaks depends on other packages, Spack will install the dependencies first. It then fetches the mpileaks tarball, expands it, verifies that it was downloaded without errors, builds it, and installs it in its own directory under $SPACK_ROOT/opt. You’ll see a number of messages from spack, a lot of build output, and a message that the packages is installed:

$ spack install mpileaks
==> Installing mpileaks
==> mpich is already installed in ~/spack/opt/linux-debian7-x86_64/gcc@4.4.7/mpich@3.0.4.
==> callpath is already installed in ~/spack/opt/linux-debian7-x86_64/gcc@4.4.7/callpath@1.0.2-5dce4318.
==> adept-utils is already installed in ~/spack/opt/linux-debian7-x86_64/gcc@4.4.7/adept-utils@1.0-5adef8da.
==> Trying to fetch from https://github.com/hpc/mpileaks/releases/download/v1.0/mpileaks-1.0.tar.gz
######################################################################## 100.0%
==> Staging archive: ~/spack/var/spack/stage/mpileaks@1.0%gcc@4.4.7 arch=linux-debian7-x86_64-59f6ad23/mpileaks-1.0.tar.gz
==> Created stage in ~/spack/var/spack/stage/mpileaks@1.0%gcc@4.4.7 arch=linux-debian7-x86_64-59f6ad23.
==> No patches needed for mpileaks.
==> Building mpileaks.

... build output ...

==> Successfully installed mpileaks.
  Fetch: 2.16s.  Build: 9.82s.  Total: 11.98s.
[+] ~/spack/opt/linux-debian7-x86_64/gcc@4.4.7/mpileaks@1.0-59f6ad23

The last line, with the [+], indicates where the package is installed.

Building a specific version

Spack can also build specific versions of a package. To do this, just add @ after the package name, followed by a version:

$ spack install mpich@3.0.4

Any number of versions of the same package can be installed at once without interfering with each other. This is good for multi-user sites, as installing a version that one user needs will not disrupt existing installations for other users.

In addition to different versions, Spack can customize the compiler, compile-time options (variants), compiler flags, and platform (for cross compiles) of an installation. Spack is unique in that it can also configure the dependencies a package is built with. For example, two configurations of the same version of a package, one built with boost 1.39.0, and the other version built with version 1.43.0, can coexist.

This can all be done on the command line using the spec syntax. Spack calls the descriptor used to refer to a particular package configuration a spec. In the commands above, mpileaks and mpileaks@3.0.4 are both valid specs. We’ll talk more about how you can use them to customize an installation in Specs & dependencies.

spack uninstall

To uninstall a package, type spack uninstall <package>. This will ask the user for confirmation before completely removing the directory in which the package was installed.

$ spack uninstall mpich

If there are still installed packages that depend on the package to be uninstalled, spack will refuse to uninstall it.

To uninstall a package and every package that depends on it, you may give the --dependents option.

$ spack uninstall --dependents mpich

will display a list of all the packages that depend on mpich and, upon confirmation, will uninstall them in the right order.

A command like

$ spack uninstall mpich

may be ambiguous if multiple mpich configurations are installed. For example, if both mpich@3.0.2 and mpich@3.1 are installed, mpich could refer to either one. Because it cannot determine which one to uninstall, Spack will ask you either to provide a version number to remove the ambiguity or use the --all option to uninstall all of the matching packages.

You may force uninstall a package with the --force option

$ spack uninstall --force mpich

but you risk breaking other installed packages. In general, it is safer to remove dependent packages before removing their dependencies or use the --dependents option.

Non-Downloadable Tarballs

The tarballs for some packages cannot be automatically downloaded by Spack. This could be for a number of reasons:

  1. The author requires users to manually accept a license agreement before downloading (jdk and galahad).
  2. The software is proprietary and cannot be downloaded on the open Internet.

To install these packages, one must create a mirror and manually add the tarballs in question to it (see Mirrors):

  1. Create a directory for the mirror. You can create this directory anywhere you like, it does not have to be inside ~/.spack:

    $ mkdir ~/.spack/manual_mirror
    
  2. Register the mirror with Spack by creating ~/.spack/mirrors.yaml:

    mirrors:
      manual: file://~/.spack/manual_mirror
    
  3. Put your tarballs in it. Tarballs should be named <package>/<package>-<version>.tar.gz. For example:

    $ ls -l manual_mirror/galahad
    
    -rw-------. 1 me me 11657206 Jun 21 19:25 galahad-2.60003.tar.gz
    
  4. Install as usual:

    $ spack install galahad
    

Seeing installed packages

We know that spack list shows you the names of available packages, but how do you figure out which are already installed?

spack find

spack find shows the specs of installed packages. A spec is like a name, but it has a version, compiler, architecture, and build options associated with it. In spack, you can have many installations of the same package with different specs.

Running spack find with no arguments lists installed packages:

$ spack find
==> 74 installed packages.
-- linux-debian7-x86_64 / gcc@4.4.7 --------------------------------
ImageMagick@6.8.9-10  libdwarf@20130729  py-dateutil@2.4.0
adept-utils@1.0       libdwarf@20130729  py-ipython@2.3.1
atk@2.14.0            libelf@0.8.12      py-matplotlib@1.4.2
boost@1.55.0          libelf@0.8.13      py-nose@1.3.4
bzip2@1.0.6           libffi@3.1         py-numpy@1.9.1
cairo@1.14.0          libmng@2.0.2       py-pygments@2.0.1
callpath@1.0.2        libpng@1.6.16      py-pyparsing@2.0.3
cmake@3.0.2           libtiff@4.0.3      py-pyside@1.2.2
dbus@1.8.6            libtool@2.4.2      py-pytz@2014.10
dbus@1.9.0            libxcb@1.11        py-setuptools@11.3.1
dyninst@8.1.2         libxml2@2.9.2      py-six@1.9.0
fontconfig@2.11.1     libxml2@2.9.2      python@2.7.8
freetype@2.5.3        llvm@3.0           qhull@1.0
gdk-pixbuf@2.31.2     memaxes@0.5        qt@4.8.6
glib@2.42.1           mesa@8.0.5         qt@5.4.0
graphlib@2.0.0        mpich@3.0.4        readline@6.3
gtkplus@2.24.25       mpileaks@1.0       sqlite@3.8.5
harfbuzz@0.9.37       mrnet@4.1.0        stat@2.1.0
hdf5@1.8.13           ncurses@5.9        tcl@8.6.3
icu@54.1              netcdf@4.3.3       tk@src
jpeg@9a               openssl@1.0.1h     vtk@6.1.0
launchmon@1.0.1       pango@1.36.8       xcb-proto@1.11
lcms@2.6              pixman@0.32.6      xz@5.2.0
libdrm@2.4.33         py-dateutil@2.4.0  zlib@1.2.8

-- linux-debian7-x86_64 / gcc@4.9.2 --------------------------------
libelf@0.8.10  mpich@3.0.4

Packages are divided into groups according to their architecture and compiler. Within each group, Spack tries to keep the view simple, and only shows the version of installed packages.

spack find can filter the package list based on the package name, spec, or a number of properties of their installation status. For example, missing dependencies of a spec can be shown with --missing, packages which were explicitly installed with spack install <package> can be singled out with --explicit and those which have been pulled in only as dependencies with --implicit.

In some cases, there may be different configurations of the same version of a package installed. For example, there are two installations of libdwarf@20130729 above. We can look at them in more detail using spack find --deps, and by asking only to show libdwarf packages:

$ spack find --deps libdwarf
==> 2 installed packages.
-- linux-debian7-x86_64 / gcc@4.4.7 --------------------------------
    libdwarf@20130729-d9b90962
        ^libelf@0.8.12
    libdwarf@20130729-b52fac98
        ^libelf@0.8.13

Now we see that the two instances of libdwarf depend on different versions of libelf: 0.8.12 and 0.8.13. This view can become complicated for packages with many dependencies. If you just want to know whether two packages’ dependencies differ, you can use spack find --long:

$ spack find --long libdwarf
==> 2 installed packages.
-- linux-debian7-x86_64 / gcc@4.4.7 --------------------------------
libdwarf@20130729-d9b90962  libdwarf@20130729-b52fac98

Now the libdwarf installs have hashes after their names. These are hashes over all of the dependencies of each package. If the hashes are the same, then the packages have the same dependency configuration.

If you want to know the path where each package is installed, you can use spack find --paths:

$ spack find --paths
==> 74 installed packages.
-- linux-debian7-x86_64 / gcc@4.4.7 --------------------------------
    ImageMagick@6.8.9-10  ~/spack/opt/linux-debian7-x86_64/gcc@4.4.7/ImageMagick@6.8.9-10-4df950dd
    adept-utils@1.0       ~/spack/opt/linux-debian7-x86_64/gcc@4.4.7/adept-utils@1.0-5adef8da
    atk@2.14.0            ~/spack/opt/linux-debian7-x86_64/gcc@4.4.7/atk@2.14.0-3d09ac09
    boost@1.55.0          ~/spack/opt/linux-debian7-x86_64/gcc@4.4.7/boost@1.55.0
    bzip2@1.0.6           ~/spack/opt/linux-debian7-x86_64/gcc@4.4.7/bzip2@1.0.6
    cairo@1.14.0          ~/spack/opt/linux-debian7-x86_64/gcc@4.4.7/cairo@1.14.0-fcc2ab44
    callpath@1.0.2        ~/spack/opt/linux-debian7-x86_64/gcc@4.4.7/callpath@1.0.2-5dce4318
...

And, finally, you can restrict your search to a particular package by supplying its name:

$ spack find --paths libelf
-- linux-debian7-x86_64 / gcc@4.4.7 --------------------------------
    libelf@0.8.11  ~/spack/opt/linux-debian7-x86_64/gcc@4.4.7/libelf@0.8.11
    libelf@0.8.12  ~/spack/opt/linux-debian7-x86_64/gcc@4.4.7/libelf@0.8.12
    libelf@0.8.13  ~/spack/opt/linux-debian7-x86_64/gcc@4.4.7/libelf@0.8.13

spack find actually does a lot more than this. You can use specs to query for specific configurations and builds of each package. If you want to find only libelf versions greater than version 0.8.12, you could say:

$ spack find libelf@0.8.12:
-- linux-debian7-x86_64 / gcc@4.4.7 --------------------------------
    libelf@0.8.12  libelf@0.8.13

Finding just the versions of libdwarf built with a particular version of libelf would look like this:

$ spack find --long libdwarf ^libelf@0.8.12
==> 1 installed packages.
-- linux-debian7-x86_64 / gcc@4.4.7 --------------------------------
libdwarf@20130729-d9b90962

We can also search for packages that have a certain attribute. For example, spack find libdwarf +debug will show only installations of libdwarf with the ‘debug’ compile-time option enabled.

The full spec syntax is discussed in detail in Specs & dependencies.

Specs & dependencies

We know that spack install, spack uninstall, and other commands take a package name with an optional version specifier. In Spack, that descriptor is called a spec. Spack uses specs to refer to a particular build configuration (or configurations) of a package. Specs are more than a package name and a version; you can use them to specify the compiler, compiler version, architecture, compile options, and dependency options for a build. In this section, we’ll go over the full syntax of specs.

Here is an example of a much longer spec than we’ve seen thus far:

mpileaks @1.2:1.4 %gcc@4.7.5 +debug -qt arch=bgq_os ^callpath @1.1 %gcc@4.7.2

If provided to spack install, this will install the mpileaks library at some version between 1.2 and 1.4 (inclusive), built using gcc at version 4.7.5 for the Blue Gene/Q architecture, with debug options enabled, and without Qt support. Additionally, it says to link it with the callpath library (which it depends on), and to build callpath with gcc 4.7.2. Most specs will not be as complicated as this one, but this is a good example of what is possible with specs.

More formally, a spec consists of the following pieces:

  • Package name identifier (mpileaks above)
  • @ Optional version specifier (@1.2:1.4)
  • % Optional compiler specifier, with an optional compiler version (gcc or gcc@4.7.3)
  • + or - or ~ Optional variant specifiers (+debug, -qt, or ~qt) for boolean variants
  • name=<value> Optional variant specifiers that are not restricted to boolean variants
  • name=<value> Optional compiler flag specifiers. Valid flag names are cflags, cxxflags, fflags, cppflags, ldflags, and ldlibs.
  • target=<value> os=<value> Optional architecture specifier (target=haswell os=CNL10)
  • ^ Dependency specs (^callpath@1.1)

There are two things to notice here. The first is that specs are recursively defined. That is, each dependency after ^ is a spec itself. The second is that everything is optional except for the initial package name identifier. Users can be as vague or as specific as they want about the details of building packages, and this makes spack good for beginners and experts alike.

To really understand what’s going on above, we need to think about how software is structured. An executable or a library (these are generally the artifacts produced by building software) depends on other libraries in order to run. We can represent the relationship between a package and its dependencies as a graph. Here is the full dependency graph for mpileaks:

digraph { mpileaks -> mpich mpileaks -> callpath -> mpich callpath -> dyninst dyninst -> libdwarf -> libelf dyninst -> libelf }

Each box above is a package and each arrow represents a dependency on some other package. For example, we say that the package mpileaks depends on callpath and mpich. mpileaks also depends indirectly on dyninst, libdwarf, and libelf, in that these libraries are dependencies of callpath. To install mpileaks, Spack has to build all of these packages. Dependency graphs in Spack have to be acyclic, and the depends on relationship is directional, so this is a directed, acyclic graph or DAG.

The package name identifier in the spec is the root of some dependency DAG, and the DAG itself is implicit. Spack knows the precise dependencies among packages, but users do not need to know the full DAG structure. Each ^ in the full spec refers to some dependency of the root package. Spack will raise an error if you supply a name after ^ that the root does not actually depend on (e.g. mpileaks ^emacs@23.3).

Spack further simplifies things by only allowing one configuration of each package within any single build. Above, both mpileaks and callpath depend on mpich, but mpich appears only once in the DAG. You cannot build an mpileaks version that depends on one version of mpich and on a callpath version that depends on some other version of mpich. In general, such a configuration would likely behave unexpectedly at runtime, and Spack enforces this to ensure a consistent runtime environment.

The point of specs is to abstract this full DAG from Spack users. If a user does not care about the DAG at all, she can refer to mpileaks by simply writing mpileaks. If she knows that mpileaks indirectly uses dyninst and she wants a particular version of dyninst, then she can refer to mpileaks ^dyninst@8.1. Spack will fill in the rest when it parses the spec; the user only needs to know package names and minimal details about their relationship.

When spack prints out specs, it sorts package names alphabetically to normalize the way they are displayed, but users do not need to worry about this when they write specs. The only restriction on the order of dependencies within a spec is that they appear after the root package. For example, these two specs represent exactly the same configuration:

mpileaks ^callpath@1.0 ^libelf@0.8.3
mpileaks ^libelf@0.8.3 ^callpath@1.0

You can put all the same modifiers on dependency specs that you would put on the root spec. That is, you can specify their versions, compilers, variants, and architectures just like any other spec. Specifiers are associated with the nearest package name to their left. For example, above, @1.1 and %gcc@4.7.2 associates with the callpath package, while @1.2:1.4, %gcc@4.7.5, +debug, -qt, and target=haswell os=CNL10 all associate with the mpileaks package.

In the diagram above, mpileaks depends on mpich with an unspecified version, but packages can depend on other packages with constraints by adding more specifiers. For example, mpileaks could depend on mpich@1.2: if it can only build with version 1.2 or higher of mpich.

Below are more details about the specifiers that you can add to specs.

Version specifier

A version specifier comes somewhere after a package name and starts with @. It can be a single version, e.g. @1.0, @3, or @1.2a7. Or, it can be a range of versions, such as @1.0:1.5 (all versions between 1.0 and 1.5, inclusive). Version ranges can be open, e.g. :3 means any version up to and including 3. This would include 3.4 and 3.4.2. 4.2: means any version above and including 4.2. Finally, a version specifier can be a set of arbitrary versions, such as @1.0,1.5,1.7 (1.0, 1.5, or 1.7). When you supply such a specifier to spack install, it constrains the set of versions that Spack will install.

If the version spec is not provided, then Spack will choose one according to policies set for the particular spack installation. If the spec is ambiguous, i.e. it could match multiple versions, Spack will choose a version within the spec’s constraints according to policies set for the particular Spack installation.

Details about how versions are compared and how Spack determines if one version is less than another are discussed in the developer guide.

Compiler specifier

A compiler specifier comes somewhere after a package name and starts with %. It tells Spack what compiler(s) a particular package should be built with. After the % should come the name of some registered Spack compiler. This might include gcc, or intel, but the specific compilers available depend on the site. You can run spack compilers to get a list; more on this below.

The compiler spec can be followed by an optional compiler version. A compiler version specifier looks exactly like a package version specifier. Version specifiers will associate with the nearest package name or compiler specifier to their left in the spec.

If the compiler spec is omitted, Spack will choose a default compiler based on site policies.

Variants

Variants are named options associated with a particular package. They are optional, as each package must provide default values for each variant it makes available. Variants can be specified using a flexible parameter syntax name=<value>. For example, spack install libelf debug=True will install libelf build with debug flags. The names of particular variants available for a package depend on what was provided by the package author. spack info <package> will provide information on what build variants are available.

For compatibility with earlier versions, variants which happen to be boolean in nature can be specified by a syntax that represents turning options on and off. For example, in the previous spec we could have supplied libelf +debug with the same effect of enabling the debug compile time option for the libelf package.

Depending on the package a variant may have any default value. For libelf here, debug is False by default, and we turned it on with debug=True or +debug. If a variant is True by default you can turn it off by either adding -name or ~name to the spec.

There are two syntaxes here because, depending on context, ~ and - may mean different things. In most shells, the following will result in the shell performing home directory substitution:

mpileaks ~debug   # shell may try to substitute this!
mpileaks~debug    # use this instead

If there is a user called debug, the ~ will be incorrectly expanded. In this situation, you would want to write libelf -debug. However, - can be ambiguous when included after a package name without spaces:

mpileaks-debug     # wrong!
mpileaks -debug    # right

Spack allows the - character to be part of package names, so the above will be interpreted as a request for the mpileaks-debug package, not a request for mpileaks built without debug options. In this scenario, you should write mpileaks~debug to avoid ambiguity.

When spack normalizes specs, it prints them out with no spaces boolean variants using the backwards compatibility syntax and uses only ~ for disabled boolean variants. The - and spaces on the command line are provided for convenience and legibility.

Compiler Flags

Compiler flags are specified using the same syntax as non-boolean variants, but fulfill a different purpose. While the function of a variant is set by the package, compiler flags are used by the compiler wrappers to inject flags into the compile line of the build. Additionally, compiler flags are inherited by dependencies. spack install libdwarf cppflags="-g" will install both libdwarf and libelf with the -g flag injected into their compile line.

Notice that the value of the compiler flags must be quoted if it contains any spaces. Any of cppflags=-O3, cppflags="-O3", cppflags='-O3', and cppflags="-O3 -fPIC" are acceptable, but cppflags=-O3 -fPIC is not. Additionally, if they value of the compiler flags is not the last thing on the line, it must be followed by a space. The commmand spack install libelf cppflags="-O3"%intel will be interpreted as an attempt to set cppflags=”-O3%intel”`.

The six compiler flags are injected in the order of implicit make commands in GNU Autotools. If all flags are set, the order is $cppflags $cflags|$cxxflags $ldflags <command> $ldlibs for C and C++ and $fflags $cppflags $ldflags <command> $ldlibs for Fortran.

Compiler environment variables and additional RPATHs

In the exceptional case a compiler requires setting special environment variables, like an explicit library load path. These can bet set in an extra section in the compiler configuration. The user can also specify additional RPATHs that the compiler will add to all executables generated by that compiler. This is useful for forcing certain compilers to RPATH their own runtime libraries, so that executables will run without the need to set LD_LIBRARY_PATH.

compilers:
  - compiler:
      spec: gcc@4.9.3
      paths:
        cc: /opt/gcc/bin/gcc
        c++: /opt/gcc/bin/g++
        f77: /opt/gcc/bin/gfortran
        fc: /opt/gcc/bin/gfortran
      environment:
        set:
          LD_LIBRARY_PATH : /opt/gcc/lib
      extra_rpaths:
      - /path/to/some/compiler/runtime/directory
      - /path/to/some/other/compiler/runtime/directory

Architecture specifiers

The architecture can be specified by using the reserved words target and/or os (target=x86-64 os=debian7). You can also use the triplet form of platform, operating system and processor.

$ spack install libelf arch=cray-CNL10-haswell

Users on non-Cray systems won’t have to worry about specifying the architecture. Spack will autodetect what kind of operating system is on your machine as well as the processor. For more information on how the architecture can be used on Cray machines, see Spack on Cray

Virtual dependencies

The dependence graph for mpileaks we saw above wasn’t quite accurate. mpileaks uses MPI, which is an interface that has many different implementations. Above, we showed mpileaks and callpath depending on mpich, which is one particular implementation of MPI. However, we could build either with another implementation, such as openmpi or mvapich.

Spack represents interfaces like this using virtual dependencies. The real dependency DAG for mpileaks looks like this:

digraph { mpi [color=red] mpileaks -> mpi mpileaks -> callpath -> mpi callpath -> dyninst dyninst -> libdwarf -> libelf dyninst -> libelf }

Notice that mpich has now been replaced with mpi. There is no real MPI package, but some packages provide the MPI interface, and these packages can be substituted in for mpi when mpileaks is built.

You can see what virtual packages a particular package provides by getting info on it:

$ spack info mpich
AutotoolsPackage:   mpich

Description:
    MPICH is a high performance and widely portable implementation of the
    Message Passing Interface (MPI) standard.

Homepage: http://www.mpich.org

Tags: 
    None

Preferred version:  
    3.2.1      http://www.mpich.org/static/downloads/3.2.1/mpich-3.2.1.tar.gz

Safe versions:  
    develop    [git] git://github.com/pmodels/mpich
    3.2.1      http://www.mpich.org/static/downloads/3.2.1/mpich-3.2.1.tar.gz
    3.2        http://www.mpich.org/static/downloads/3.2/mpich-3.2.tar.gz
    3.1.4      http://www.mpich.org/static/downloads/3.1.4/mpich-3.1.4.tar.gz
    3.1.3      http://www.mpich.org/static/downloads/3.1.3/mpich-3.1.3.tar.gz
    3.1.2      http://www.mpich.org/static/downloads/3.1.2/mpich-3.1.2.tar.gz
    3.1.1      http://www.mpich.org/static/downloads/3.1.1/mpich-3.1.1.tar.gz
    3.1        http://www.mpich.org/static/downloads/3.1/mpich-3.1.tar.gz
    3.0.4      http://www.mpich.org/static/downloads/3.0.4/mpich-3.0.4.tar.gz

Variants:
    Name [Default]    Allowed values        Description


    device [ch3]      ch3, ch4              Abstract Device Interface
                                            (ADI) implementation. The ch4
                                            device is currently in
                                            experimental state
    hydra [on]        True, False           Build the hydra process
                                            manager
    netmod [tcp]      tcp, mxm, ofi, ucx    Network module. Only single
                                            netmod builds are supported.
                                            For ch3 device configurations,
                                            this presumes the ch3:nemesis
                                            communication channel.
                                            ch3:sock is not supported by
                                            this spack package at this
                                            time.
    pmi [on]          True, False           Build with PMI support
    romio [on]        True, False           Enable ROMIO MPI I/O
                                            implementation
    verbs [off]       True, False           Build support for OpenFabrics
                                            verbs.

Installation Phases:
    autoreconf    configure    build    install

Build Dependencies:
    libfabric

Link Dependencies:
    libfabric

Run Dependencies:
    None

Virtual Packages: 
    mpich@3: provides mpi@:3.0
    mpich@1: provides mpi@:1.3
    mpich provides mpi

Spack is unique in that its virtual packages can be versioned, just like regular packages. A particular version of a package may provide a particular version of a virtual package, and we can see above that mpich versions 1 and above provide all mpi interface versions up to 1, and mpich versions 3 and above provide mpi versions up to 3. A package can depend on a particular version of a virtual package, e.g. if an application needs MPI-2 functions, it can depend on mpi@2: to indicate that it needs some implementation that provides MPI-2 functions.

Constraining virtual packages

When installing a package that depends on a virtual package, you can opt to specify the particular provider you want to use, or you can let Spack pick. For example, if you just type this:

$ spack install mpileaks

Then spack will pick a provider for you according to site policies. If you really want a particular version, say mpich, then you could run this instead:

$ spack install mpileaks ^mpich

This forces spack to use some version of mpich for its implementation. As always, you can be even more specific and require a particular mpich version:

$ spack install mpileaks ^mpich@3

The mpileaks package in particular only needs MPI-1 commands, so any MPI implementation will do. If another package depends on mpi@2 and you try to give it an insufficient MPI implementation (e.g., one that provides only mpi@:1), then Spack will raise an error. Likewise, if you try to plug in some package that doesn’t provide MPI, Spack will raise an error.

Specifying Specs by Hash

Complicated specs can become cumbersome to enter on the command line, especially when many of the qualifications are necessary to distinguish between similar installs. To avoid this, when referencing an existing spec, Spack allows you to reference specs by their hash. We previously discussed the spec hash that Spack computes. In place of a spec in any command, substitute /<hash> where <hash> is any amount from the beginning of a spec hash.

For example, lets say that you accidentally installed two different mvapich2 installations. If you want to uninstall one of them but don’t know what the difference is, you can run:

$ spack find --long mvapich2
==> 2 installed packages.
-- linux-centos7-x86_64 / gcc@6.3.0 ----------
qmt35td mvapich2@2.2%gcc
er3die3 mvapich2@2.2%gcc

You can then uninstall the latter installation using:

$ spack uninstall /er3die3

Or, if you want to build with a specific installation as a dependency, you can use:

$ spack install trilinos ^/er3die3

If the given spec hash is sufficiently long as to be unique, Spack will replace the reference with the spec to which it refers. Otherwise, it will prompt for a more qualified hash.

Note that this will not work to reinstall a dependency uninstalled by spack uninstall --force.

spack providers

You can see what packages provide a particular virtual package using spack providers. If you wanted to see what packages provide mpi, you would just run:

$ spack providers mpi
intel-mpi              mpich     mpich@3:   mvapich2  openmpi@1.6.5   openmpi@2.0.0:
intel-parallel-studio  mpich@1:  mpilander  openmpi   openmpi@1.7.5:  spectrum-mpi

And if you only wanted to see packages that provide MPI-2, you would add a version specifier to the spec:

$ spack providers mpi@2
intel-mpi              mpich     mpilander  openmpi        openmpi@1.7.5:  spectrum-mpi
intel-parallel-studio  mpich@3:  mvapich2   openmpi@1.6.5  openmpi@2.0.0:

Notice that the package versions that provide insufficient MPI versions are now filtered out.

Extensions & Python support

Spack’s installation model assumes that each package will live in its own install prefix. However, certain packages are typically installed within the directory hierarchy of other packages. For example, modules in interpreted languages like Python are typically installed in the $prefix/lib/python-2.7/site-packages directory.

Spack has support for this type of installation as well. In Spack, a package that can live inside the prefix of another package is called an extension. Suppose you have Python installed like so:

$ spack find python
==> 1 installed packages.
-- linux-debian7-x86_64 / gcc@4.4.7 --------------------------------
python@2.7.8

spack extensions

You can find extensions for your Python installation like this:

$ spack extensions python
==> python@2.7.8%gcc@4.4.7 arch=linux-debian7-x86_64-703c7a96
==> 36 extensions:
geos          py-ipython     py-pexpect    py-pyside            py-sip
py-basemap    py-libxml2     py-pil        py-pytz              py-six
py-biopython  py-mako        py-pmw        py-rpy2              py-sympy
py-cython     py-matplotlib  py-pychecker  py-scientificpython  py-virtualenv
py-dateutil   py-mpi4py      py-pygments   py-scikit-learn
py-epydoc     py-mx          py-pylint     py-scipy
py-gnuplot    py-nose        py-pyparsing  py-setuptools
py-h5py       py-numpy       py-pyqt       py-shiboken

==> 12 installed:
-- linux-debian7-x86_64 / gcc@4.4.7 --------------------------------
py-dateutil@2.4.0    py-nose@1.3.4       py-pyside@1.2.2
py-dateutil@2.4.0    py-numpy@1.9.1      py-pytz@2014.10
py-ipython@2.3.1     py-pygments@2.0.1   py-setuptools@11.3.1
py-matplotlib@1.4.2  py-pyparsing@2.0.3  py-six@1.9.0

==> None activated.

The extensions are a subset of what’s returned by spack list, and they are packages like any other. They are installed into their own prefixes, and you can see this with spack find --paths:

$ spack find --paths py-numpy
==> 1 installed packages.
-- linux-debian7-x86_64 / gcc@4.4.7 --------------------------------
    py-numpy@1.9.1  ~/spack/opt/linux-debian7-x86_64/gcc@4.4.7/py-numpy@1.9.1-66733244

However, even though this package is installed, you cannot use it directly when you run python:

$ spack load python
$ python
Python 2.7.8 (default, Feb 17 2015, 01:35:25)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-11)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named numpy
>>>

Extensions & Environment Modules

There are two ways to get numpy working in Python. The first is to use Using module files via Spack. You can simply use or load the module for the extension, and it will be added to the PYTHONPATH in your current shell.

For tcl modules:

$ spack load python
$ spack load py-numpy

or, for dotkit:

$ spack use python
$ spack use py-numpy

Now import numpy will succeed for as long as you keep your current session open.

Activating Extensions

It is often desirable to have certain packages always available as part of a Python installation. Spack offers a more permanent solution for this case. Instead of requiring users to load particular environment modules, you can activate the package within the Python installation:

spack activate

$ spack activate py-numpy
==> Activated extension py-setuptools@11.3.1%gcc@4.4.7 arch=linux-debian7-x86_64-3c74eb69 for python@2.7.8%gcc@4.4.7.
==> Activated extension py-nose@1.3.4%gcc@4.4.7 arch=linux-debian7-x86_64-5f70f816 for python@2.7.8%gcc@4.4.7.
==> Activated extension py-numpy@1.9.1%gcc@4.4.7 arch=linux-debian7-x86_64-66733244 for python@2.7.8%gcc@4.4.7.

Several things have happened here. The user requested that py-numpy be activated in the python installation it was built with. Spack knows that py-numpy depends on py-nose and py-setuptools, so it activated those packages first. Finally, once all dependencies were activated in the python installation, py-numpy was activated as well.

If we run spack extensions again, we now see the three new packages listed as activated:

$ spack extensions python
==> python@2.7.8%gcc@4.4.7  arch=linux-debian7-x86_64-703c7a96
==> 36 extensions:
geos          py-ipython     py-pexpect    py-pyside            py-sip
py-basemap    py-libxml2     py-pil        py-pytz              py-six
py-biopython  py-mako        py-pmw        py-rpy2              py-sympy
py-cython     py-matplotlib  py-pychecker  py-scientificpython  py-virtualenv
py-dateutil   py-mpi4py      py-pygments   py-scikit-learn
py-epydoc     py-mx          py-pylint     py-scipy
py-gnuplot    py-nose        py-pyparsing  py-setuptools
py-h5py       py-numpy       py-pyqt       py-shiboken

==> 12 installed:
-- linux-debian7-x86_64 / gcc@4.4.7 --------------------------------
py-dateutil@2.4.0    py-nose@1.3.4       py-pyside@1.2.2
py-dateutil@2.4.0    py-numpy@1.9.1      py-pytz@2014.10
py-ipython@2.3.1     py-pygments@2.0.1   py-setuptools@11.3.1
py-matplotlib@1.4.2  py-pyparsing@2.0.3  py-six@1.9.0

==> 3 currently activated:
-- linux-debian7-x86_64 / gcc@4.4.7 --------------------------------
py-nose@1.3.4  py-numpy@1.9.1  py-setuptools@11.3.1

Now, when a user runs python, numpy will be available for import without the user having to explicitly loaded. python@2.7.8 now acts like a system Python installation with numpy installed inside of it.

Spack accomplishes this by symbolically linking the entire prefix of the py-numpy into the prefix of the python package. To the python interpreter, it looks like numpy is installed in the site-packages directory.

The only limitation of activation is that you can only have a single version of an extension activated at a time. This is because multiple versions of the same extension would conflict if symbolically linked into the same prefix. Users who want a different version of a package can still get it by using environment modules, but they will have to explicitly load their preferred version.

spack activate --force

If, for some reason, you want to activate a package without its dependencies, you can use spack activate --force:

$ spack activate --force py-numpy
==> Activated extension py-numpy@1.9.1%gcc@4.4.7 arch=linux-debian7-x86_64-66733244 for python@2.7.8%gcc@4.4.7.

spack deactivate

We’ve seen how activating an extension can be used to set up a default version of a Python module. Obviously, you may want to change that at some point. spack deactivate is the command for this. There are several variants:

  • spack deactivate <extension> will deactivate a single extension. If another activated extension depends on this one, Spack will warn you and exit with an error.

  • spack deactivate --force <extension> deactivates an extension regardless of packages that depend on it.

  • spack deactivate --all <extension> deactivates an extension and all of its dependencies. Use --force to disregard dependents.

  • spack deactivate --all <extendee> deactivates all activated extensions of a package. For example, to deactivate all python extensions, use:

    $ spack deactivate --all python
    

Filesystem requirements

By default, Spack needs to be run from a filesystem that supports flock locking semantics. Nearly all local filesystems and recent versions of NFS support this, but parallel filesystems or NFS volumes may be configured without flock support enabled. You can determine how your filesystems are mounted with mount. The output for a Lustre filesystem might look like this:

$ mount | grep lscratch
mds1-lnet0@o2ib100:/lsd on /p/lscratchd type lustre (rw,nosuid,lazystatfs,flock)
mds2-lnet0@o2ib100:/lse on /p/lscratche type lustre (rw,nosuid,lazystatfs,flock)

Note the flock option on both Lustre mounts.

If you do not see this or a similar option for your filesystem, you have a few options. First, you can move your Spack installation to a filesystem that supports locking. Second, you could ask your system administrator to enable flock for your filesystem.

If none of those work, you can disable locking in one of two ways:

  1. Run Spack with the -L or --disable-locks option to disable locks on a call-by-call basis.
  2. Edit config.yaml and set the locks option to false to always disable locking.

Warning

If you disable locking, concurrent instances of Spack will have no way to avoid stepping on each other. You must ensure that there is only one instance of Spack running at a time. Otherwise, Spack may end up with a corrupted database file, or you may not be able to see all installed packages in commands like spack find.

If you are unfortunate enough to run into this situation, you may be able to fix it by running spack reindex.

This issue typically manifests with the error below:

$ ./spack find
Traceback (most recent call last):
File "./spack", line 176, in <module>
  main()
File "./spack", line 154,' in main
  return_val = command(parser, args)
File "./spack/lib/spack/spack/cmd/find.py", line 170, in find
  specs = set(spack.installed_db.query(\**q_args))
File "./spack/lib/spack/spack/database.py", line 551, in query
  with self.read_transaction():
File "./spack/lib/spack/spack/database.py", line 598, in __enter__
  if self._enter() and self._acquire_fn:
File "./spack/lib/spack/spack/database.py", line 608, in _enter
  return self._db.lock.acquire_read(self._timeout)
File "./spack/lib/spack/llnl/util/lock.py", line 103, in acquire_read
  self._lock(fcntl.LOCK_SH, timeout)   # can raise LockError.
File "./spack/lib/spack/llnl/util/lock.py", line 64, in _lock
  fcntl.lockf(self._fd, op | fcntl.LOCK_NB)
IOError: [Errno 38] Function not implemented

A nicer error message is TBD in future versions of Spack.

Getting Help

spack help

If you don’t find what you need here, the help subcommand will print out out a list of all of spack’s options and subcommands:

$ spack help
usage: spack [-hkV] [--color {always,never,auto}] COMMAND ...

A flexible package manager that supports multiple versions,
configurations, platforms, and compilers.

These are common spack commands:

query packages:
  list                  list and search available packages
  info                  get detailed information on a particular package
  find                  list and search installed packages

build packages:
  install               build and install packages
  uninstall             remove installed packages
  spec                  show what would be installed, given a spec

environment:
  load                  add package to environment using `module load`
  module                manipulate module files
  unload                remove package from environment using `module unload`
  view                  produce a single-rooted directory view of packages

create packages:
  create                create a new package file
  edit                  open package files in $EDITOR

system:
  arch                  print architecture information about this machine
  compilers             list available compilers

optional arguments:
  -h, --help            show this help message and exit
  -k, --insecure        do not check ssl certificates when downloading
  -V, --version         show version number and exit
  --color {always,never,auto}
                        when to colorize output (default: auto)

more help:
  spack help --all       list all commands and options
  spack help <command>   help on a specific command
  spack help --spec      help on the spec syntax
  spack docs             open http://spack.rtfd.io/ in a browser

Adding an argument, e.g. spack help <subcommand>, will print out usage information for a particular subcommand:

$ spack help install
usage: spack install [-hnvy] [--only {package,dependencies}] [-j JOBS] [--overwrite] [--keep-prefix] [--keep-stage]
                     [--dont-restage] [--use-cache] [--show-log-on-error] [--source] [--fake] [-f SPEC_YAML_FILE]
                     [--clean | --dirty] [--test {root,all} | --run-tests] [--log-format {None,junit,cdash}]
                     [--log-file LOG_FILE] [--cdash-upload-url CDASH_UPLOAD_URL]
                     ...

build and install packages

positional arguments:
  package               spec of the package to install

optional arguments:
  -h, --help            show this help message and exit
  --only {package,dependencies}
                        select the mode of installation.
                        the default is to install the package along with all its dependencies.
                        alternatively one can decide to install only the package or only
                        the dependencies
  -j JOBS, --jobs JOBS  explicitely set number of make jobs. default is #cpus
  --overwrite           reinstall an existing spec, even if it has dependents
  --keep-prefix         don't remove the install prefix if installation fails
  --keep-stage          don't remove the build stage if installation succeeds
  --dont-restage        if a partial install is detected, don't delete prior state
  --use-cache           check for pre-built Spack packages in mirrors
  --show-log-on-error   print full build log to stderr if build fails
  --source              install source files in prefix
  -n, --no-checksum     do not use checksums to verify downloadeded files (unsafe)
  -v, --verbose         display verbose build output while installing
  --fake                fake install for debug purposes.
  -f SPEC_YAML_FILE, --file SPEC_YAML_FILE
                        install from file. Read specs to install from .yaml files
  --clean               unset harmful variables in the build environment (default)
  --dirty               preserve user environment in the spack build environment (danger!)
  --test {root,all}     If 'root' is chosen, run package tests during
                        installation for top-level packages (but skip tests for dependencies).
                        if 'all' is chosen, run package tests during installation for all
                        packages. If neither are chosen, don't run tests for any packages.
  --run-tests           run package tests during installation (same as --test=all)
  --log-format {None,junit,cdash}
                        format to be used for log files
  --log-file LOG_FILE   filename for the log file. if not passed a default will be used
  --cdash-upload-url CDASH_UPLOAD_URL
                        CDash URL where reports will be uploaded
  -y, --yes-to-all      assume "yes" is the answer to every confirmation request

Alternately, you can use spack --help in place of spack help, or spack <subcommand> --help to get help on a particular subcommand.