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                           moab                                   r-colorspace
abyss                            molcas                                 r-complexheatmap
ack                              mono                                   r-corpcor
activeharmony                    mosh                                   r-corrplot
adept-utils                      mothur                                 r-covr
adios                            motioncor2                             r-cowplot
adios2                           mozjs                                  r-crayon
adlbx                            mpc                                    r-cubature
adol-c                           mpe2                                   r-cubist
albert                           mpest                                  r-curl
alglib                           mpfr                                   r-data-table
allinea-forge                    mpibash                                r-dbi
allinea-reports                  mpiblast                               r-delayedarray
allpaths-lg                      mpich                                  r-deldir
alquimia                         mpifileutils                           r-dendextend
alsa-lib                         mpileaks                               r-deoptim
amg                              mpip                                   r-deoptimr
amg2013                          mpir                                   r-deseq
ampliconnoise                    mpix-launch-swift                      r-deseq2
amr-exp-parabolic                mrbayes                                r-desolve
amrex                            mrnet                                  r-devtools
andi                             mrtrix3                                r-diagrammer
angsd                            msgpack-c                              r-dichromat
ant                              mshadow                                r-digest
antlr                            multitail                              r-diptest
ape                              multiverso                             r-dnacopy
apex                             mummer                                 r-domc
applewmproto                     mumps                                  r-doparallel
appres                           munge                                  r-dorng
apr                              muparser                               r-downloader
apr-util                         muscle                                 r-dplyr
archer                           muse                                   r-dt
argtable                         muster                                 r-dygraphs
arlecore                         mvapich2                               r-e1071
armadillo                        mxml                                   r-edger
arpack-ng                        mxnet                                  r-ellipse
ascent                           nag                                    r-ensembldb
asciidoc                         nalu                                   r-ergm
aspa                             namd                                   r-evaluate
aspell                           nano                                   r-expm
aspell6-de                       nanoflann                              r-factoextra
aspell6-en                       nasm                                   r-factominer
aspell6-es                       nauty                                  r-ff
assimp                           ncbi-rmblastn                          r-filehash
astra                            nccl                                   r-flashclust
astral                           nccmp                                  r-flexmix
astyle                           ncdu                                   r-foreach
atk                              ncftp                                  r-forecast
atlas                            ncl                                    r-foreign
atompaw                          nco                                    r-formatr
atop                             ncurses                                r-formula
augustus                         ncview                                 r-fpc
autoconf                         ndiff                                  r-fracdiff
autodock-vina                    nekbone                                r-futile-logger
autogen                          neovim                                 r-futile-options
automaded                        netcdf                                 r-gbm
automake                         netcdf-cxx                             r-gcrma
bamtools                         netcdf-cxx4                            r-gdata
bamutil                          netcdf-fortran                         r-geiger
bash                             netgauge                               r-genefilter
bash-completion                  netgen                                 r-geneplotter
bats                             netlib-lapack                          r-genomeinfodb
bazel                            netlib-scalapack                       r-genomeinfodbdata
bbcp                             nettle                                 r-genomicalignments
bbmap                            nextflow                               r-genomicfeatures
bcftools                         nfft                                   r-genomicranges
bcl2fastq2                       nghttp2                                r-geomorph
bdftopcf                         nginx                                  r-geoquery
bdw-gc                           ngmlr                                  r-geosphere
bear                             ninja                                  r-getoptlong
beast2                           ninja-fortran                          r-ggally
bedtools2                        nmap                                   r-ggbio
beforelight                      nnvm                                   r-ggdendro
benchmark                        node-js                                r-ggmap
berkeley-db                      notmuch                                r-ggplot2
bertini                          npb                                    r-ggpubr
bib2xhtml                        npm                                    r-ggrepel
bigreqsproto                     npth                                   r-ggsci
binutils                         nspr                                   r-ggvis
bioawk                           numactl                                r-gistr
bison                            numdiff                                r-git2r
bitmap                           nut                                    r-glmnet
blast-plus                       nwchem                                 r-globaloptions
blat                             ocaml                                  r-gmodels
blaze                            oce                                    r-gmp
bliss                            oclock                                 r-go-db
blitz                            octave                                 r-googlevis
bml                              octave-splines                         r-gostats
boost                            octopus                                r-gplots
boostmplcartesianproduct         of-adios-write                         r-graph
bowtie                           ompss                                  r-gridbase
bowtie2                          ompt-openmp                            r-gridextra
boxlib                           oniguruma                              r-gseabase
bpp-core                         ont-albacore                           r-gsubfn
bpp-phyl                         opari2                                 r-gtable
bpp-seq                          openbabel                              r-gtools
bpp-suite                        openblas                               r-gtrellis
braker                           opencoarrays                           r-gviz
branson                          opencv                                 r-hexbin
brigand                          openexr                                r-highr
bsseeker2                        openfast                               r-hmisc
bucky                            openfoam-com                           r-hms
busco                            openfoam-org                           r-htmltable
butter                           openfst                                r-htmltools
bwa                              openjpeg                               r-htmlwidgets
byobu                            openmc                                 r-httpuv
bzip2                            openmpi                                r-httr
c-blosc                          openscenegraph                         r-hwriter
caffe                            openspeedshop                          r-hypergraph
cairo                            openssh                                r-igraph
caliper                          openssl                                r-illuminaio
callpath                         opium                                  r-impute
candle-benchmarks                opus                                   r-influencer
cantera                          orfm                                   r-inline
canu                             orthomcl                               r-interactivedisplaybase
cap3                             osu-micro-benchmarks                   r-ipred
cares                            otf                                    r-iranges
cask                             otf2                                   r-irdisplay
catch                            p4est                                  r-irkernel
cbench                           p7zip                                  r-irlba
cblas                            pacbio-daligner                        r-iso
cbtf                             pacbio-damasker                        r-iterators
cbtf-argonavis                   pacbio-dazz-db                         r-jpeg
cbtf-argonavis-gui               pacbio-dextractor                      r-jsonlite
cbtf-krell                       pagit                                  r-kegg-db
cbtf-lanl                        pagmo                                  r-keggrest
ccache                           paml                                   r-kernlab
cctools                          panda                                  r-kernsmooth
cdbfasta                         pango                                  r-kknn
cdd                              papi                                   r-knitr
cddlib                           paradiseo                              r-labeling
cdhit                            parallel                               r-lambda-r
cdo                              parallel-netcdf                        r-laplacesdemon
cereal                           paraver                                r-lattice
cfitsio                          paraview                               r-latticeextra
cgal                             parmetis                               r-lava
cgm                              parmgridgen                            r-lazyeval
cgns                             parsimonator                           r-leaflet
charm                            parsplice                              r-leaps
check                            partitionfinder                        r-learnbayes
chlorop                          patch                                  r-limma
chombo                           patchelf                               r-lme4
cityhash                         pathfinder                             r-lmtest
clamr                            pax-utils                              r-locfit
cleaveland4                      pbmpi                                  r-log4r
cleverleaf                       pcma                                   r-lpsolve
clfft                            pcre                                   r-lsei
clhep                            pcre2                                  r-lubridate
cloc                             pdsh                                   r-magic
cloog                            pdt                                    r-magrittr
cloverleaf                       pegtl                                  r-makecdfenv
cloverleaf3d                     pennant                                r-maldiquant
clustalo                         perl                                   r-mapproj
clustalw                         perl-algorithm-diff                    r-maps
cmake                            perl-b-hooks-endofscope                r-maptools
cmocka                           perl-bio-perl                          r-markdown
cmor                             perl-capture-tiny                      r-mass
cnmem                            perl-class-data-inheritable            r-matrix
cnpy                             perl-class-load                        r-matrixmodels
cns-nospec                       perl-class-load-xs                     r-matrixstats
cntk                             perl-cpan-meta-check                   r-mclust
cntk1bitsgd                      perl-data-optlist                      r-mcmcglmm
codar-cheetah                    perl-data-stag                         r-mda
coevp                            perl-dbfile                            r-memoise
cohmm                            perl-dbi                               r-mergemaid
coinhsl                          perl-devel-cycle                       r-methodss3
comd                             perl-devel-globaldestruction           r-mgcv
compiz                           perl-devel-overloadinfo                r-mime
compositeproto                   perl-devel-stacktrace                  r-minfi
conduit                          perl-dist-checkconflicts               r-minqa
constype                         perl-eval-closure                      r-mlbench
converge                         perl-exception-class                   r-mlinterfaces
coreutils                        perl-extutils-makemaker                r-modelmetrics
corset                           perl-extutils-pkgconfig                r-modeltools
cosmomc                          perl-file-pushd                        r-mpm
cosp2                            perl-font-ttf                          r-msnbase
cp2k                             perl-gd                                r-multcomp
cppad                            perl-gd-graph                          r-multtest
cppcheck                         perl-gd-text                           r-munsell
cpprestsdk                       perl-intervaltree                      r-mvtnorm
cppunit                          perl-io-string                         r-mzid
cppzmq                           perl-math-cdf                          r-mzr
cram                             perl-module-build                      r-ncbit
cryptopp                         perl-module-runtime-conflicts          r-ncdf4
cscope                           perl-moose                             r-network
csdp                             perl-mro-compat                        r-networkd3
cub                              perl-namespace-clean                   r-nlme
cube                             perl-package-deprecationmanager        r-nloptr
cuda                             perl-package-stash                     r-nmf
cuda-memtest                     perl-package-stash-xs                  r-nnet
cudnn                            perl-padwalker                         r-nnls
cufflinks                        perl-params-util                       r-nor1mix
cups                             perl-pdf-api2                          r-np
curl                             perl-star-fusion                       r-numderiv
cvs                              perl-sub-exporter                      r-oligoclasses
czmq                             perl-sub-exporter-progressive          r-oo
dakota                           perl-sub-identify                      r-openssl
daligner                         perl-sub-install                       r-organismdbi
damageproto                      perl-sub-name                          r-packrat
damselfly                        perl-sub-uplevel                       r-pacman
darshan-runtime                  perl-term-readkey                      r-pamr
darshan-util                     perl-test-cleannamespaces              r-party
dash                             perl-test-deep                         r-partykit
datamash                         perl-test-differences                  r-pbdzmq
dataspaces                       perl-test-exception                    r-pbkrtest
dbus                             perl-test-fatal                        r-pcamethods
dealii                           perl-test-memory-cycle                 r-permute
dejagnu                          perl-test-most                         r-pfam-db
delly2                           perl-test-needs                        r-pkgconfig
dia                              perl-test-requires                     r-pkgmaker
dialign-tx                       perl-test-warn                         r-plogr
direnv                           perl-test-warnings                     r-plotrix
discovar                         perl-text-diff                         r-pls
dlpack                           perl-uri-escape                        r-plyr
dmlc-core                        perl-xml-parser                        r-pmcmr
dmxproto                         petsc                                  r-png
docbook-xml                      pexsi                                  r-prabclus
docbook-xsl                      pfft                                   r-praise
dos2unix                         pflotran                               r-preprocesscore
double-conversion                pgdspider                              r-prettyunits
doxygen                          pgi                                    r-prodlim
dri2proto                        phasta                                 r-progress
dri3proto                        phylip                                 r-protgenerics
dtcmp                            picard                                 r-proto
dyninst                          pidx                                   r-proxy
ea-utils                         pigz                                   r-pryr
easybuild                        piranha                                r-ptw
ebms                             pixman                                 r-purrr
eccodes                          pkg-config                             r-quadprog
ecp-proxy-apps                   pkgconf                                r-quantmod
editres                          planck-likelihood                      r-quantreg
eigen                            plasma                                 r-quantro
elemental                        plink                                  r-qvalue
elfutils                         plumed                                 r-r6
elk                              pmgr-collective                        r-randomforest
elpa                             pmix                                   r-raster
emacs                            pnfft                                  r-rbgl
emboss                           pngwriter                              r-rbokeh
encodings                        poamsa                                 r-rcolorbrewer
environment-modules              pocl                                   r-rcpp
es                               polymake                               r-rcpparmadillo
esmf                             porta                                  r-rcppeigen
espresso                         portage                                r-rcurl
etsf-io                          postgresql                             r-rda
everytrace                       ppl                                    r-readr
everytrace-example               prank                                  r-readxl
evieext                          presentproto                           r-registry
exabayes                         preseq                                 r-rematch
exampm                           price                                  r-reordercluster
exasp2                           primer3                                r-reportingtools
exmcutils                        printproto                             r-repr
exodusii                         probconsrna                            r-reprex
exonerate                        proj                                   r-reshape
expat                            protobuf                               r-reshape2
expect                           proxymngr                              r-rex
extrae                           pruners-ninja                          r-rgl
exuberant-ctags                  ps-lite                                r-rgooglemaps
f90cache                         psi4                                   r-rhtslib
falcon                           pstreams                               r-rinside
farmhash                         pugixml                                r-rjava
fastjar                          pumi                                   r-rjson
fastmath                         pvm                                    r-rjsonio
fastme                           py-3to2                                r-rlang
fastphase                        py-4suite-xml                          r-rmarkdown
fastq-screen                     py-abipy                               r-rminer
fastqc                           py-alabaster                           r-rmpfr
fastqvalidator                   py-apache-libcloud                     r-rmpi
fastx-toolkit                    py-apipkg                              r-rmysql
fenics                           py-appdirs                             r-rngtools
ferret                           py-appnope                             r-robustbase
ffmpeg                           py-apscheduler                         r-rocr
fftw                             py-argcomplete                         r-rodbc
fimpute                          py-argparse                            r-roxygen2
findutils                        py-ase                                 r-rpart
fio                              py-asn1crypto                          r-rpart-plot
fish                             py-astroid                             r-rpostgresql
fixesproto                       py-astropy                             r-rsamtools
flac                             py-attrs                               r-rsnns
flang                            py-autopep8                            r-rsqlite
flann                            py-babel                               r-rstan
flash                            py-backports-abc                       r-rstudioapi
flecsale                         py-backports-shutil-get-terminal-size  r-rtracklayer
flecsi                           py-backports-ssl-match-hostname        r-rvest
flex                             py-basemap                             r-rzmq
flint                            py-beautifulsoup4                      r-s4vectors
fltk                             py-binwalk                             r-samr
flux                             py-biom-format                         r-sandwich
fmt                              py-biopython                           r-scales
foam-extend                      py-bleach                              r-scatterplot3d
folly                            py-blessings                           r-segmented
font-adobe-100dpi                py-bokeh                               r-selectr
font-adobe-75dpi                 py-boltons                             r-seqinr
font-adobe-utopia-100dpi         py-bottleneck                          r-sfsmisc
font-adobe-utopia-75dpi          py-brian                               r-shape
font-adobe-utopia-type1          py-brian2                              r-shiny
font-alias                       py-bsddb3                              r-siggenes
font-arabic-misc                 py-cclib                               r-simpleaffy
font-bh-100dpi                   py-cdat-lite                           r-snow
font-bh-75dpi                    py-cdo                                 r-somaticsignatures
font-bh-lucidatypewriter-100dpi  py-certifi                             r-sourcetools
font-bh-lucidatypewriter-75dpi   py-cffi                                r-sp
font-bh-ttf                      py-chardet                             r-sparsem
font-bh-type1                    py-click                               r-spdep
font-bitstream-100dpi            py-colorama                            r-speedglm
font-bitstream-75dpi             py-colormath                           r-sqldf
font-bitstream-speedo            py-configparser                        r-stanheaders
font-bitstream-type1             py-counter                             r-statmod
font-cronyx-cyrillic             py-coverage                            r-statnet-common
font-cursor-misc                 py-cpuinfo                             r-stringi
font-daewoo-misc                 py-cryptography                        r-stringr
font-dec-misc                    py-csvkit                              r-strucchange
font-ibm-type1                   py-current                             r-subplex
font-isas-misc                   py-cutadapt                            r-summarizedexperiment
font-jis-misc                    py-cycler                              r-survey
font-micro-misc                  py-cython                              r-survival
font-misc-cyrillic               py-dask                                r-tarifx
font-misc-ethiopic               py-dateutil                            r-tensora
font-misc-meltho                 py-dbf                                 r-testit
font-misc-misc                   py-decorator                           r-testthat
font-mutt-misc                   py-deeptools                           r-th-data
font-schumacher-misc             py-dev                                 r-threejs
font-screen-cyrillic             py-dill                                r-tibble
font-sony-misc                   py-dlcpar                              r-tidyr
font-sun-misc                    py-docutils                            r-tiff
font-util                        py-doxypy                              r-timedate
font-winitzki-cyrillic           py-doxypypy                            r-trimcluster
font-xfree86-type1               py-dryscrape                           r-trust
fontcacheproto                   py-dxchange                            r-tseries
fontconfig                       py-dxfile                              r-ttr
fontsproto                       py-easybuild-easyblocks                r-utils
fonttosfnt                       py-easybuild-easyconfigs               r-uuid
fpc                              py-easybuild-framework                 r-variantannotation
freebayes                        py-edffile                             r-varselrf
freetype                         py-elasticsearch                       r-vcd
fseq                             py-elephant                            r-vegan
fsl                              py-emcee                               r-viridis
fslsfonts                        py-entrypoints                         r-viridislite
fstobdf                          py-enum34                              r-visnetwork
funhpc                           py-epydoc                              r-vsn
gapcloser                        py-espresso                            r-whisker
gapfiller                        py-espressopp                          r-withr
gasnet                           py-et-xmlfile                          r-xde
gaussian                         py-execnet                             r-xgboost
gawk                             py-fastaindex                          r-xlconnect
gblocks                          py-fasteners                           r-xlconnectjars
gcc                              py-faststructure                       r-xlsx
gccmakedep                       py-fiscalyear                          r-xlsxjars
gccxml                           py-flake8                              r-xmapbridge
gconf                            py-flask                               r-xml
gdal                             py-flexx                               r-xml2
gdb                              py-funcsigs                            r-xtable
gdbm                             py-functools32                         r-xts
gdk-pixbuf                       py-future                              r-xvector
geant4                           py-futures                             r-yaml
gearshifft                       py-genders                             r-yapsa
gemmlowp                         py-genshi                              r-yaqcaffy
genemark-et                      py-git-review                          r-yarn
genometools                      py-git2                                r-zlibbioc
geos                             py-gnuplot                             r-zoo
gettext                          py-griddataformats                     raft
gflags                           py-guidata                             raja
ghostscript                      py-guiqwt                              randfold
ghostscript-fonts                py-h5py                                random123
giflib                           py-html2text                           randrproto
git                              py-html5lib                            ravel
git-lfs                          py-httpbin                             raxml
gl2ps                            py-hypothesis                          ray
glew                             py-idna                                rdp-classifier
glib                             py-igraph                              readline
glm                              py-imagesize                           recordproto
global                           py-iminuit                             redundans
globalarrays                     py-importlib                           relion
globus-toolkit                   py-ipaddress                           rempi
glog                             py-ipdb                                rename
glpk                             py-ipykernel                           rendercheck
glproto                          py-ipython                             renderproto
gmake                            py-ipython-genutils                    repeatmasker
gmap-gsnap                       py-ipywidgets                          resourceproto
gmime                            py-itsdangerous                        revbayes
gmp                              py-jdcal                               rgb
gmsh                             py-jedi                                rhash
gnat                             py-jinja2                              rockstar
gnu-prolog                       py-joblib                              root
gnupg                            py-jpype                               rose
gnuplot                          py-jsonschema                          rr
gnutls                           py-junit-xml                           rsbench
go                               py-jupyter-client                      rsem
go-bootstrap                     py-jupyter-console                     rstart
gobject-introspection            py-jupyter-core                        rsync
googletest                       py-jupyter-notebook                    rtags
gource                           py-keras                               rtax
gperf                            py-latexcodec                          ruby
gperftools                       py-lazy                                rust
grackle                          py-lazyarray                           rust-bindgen
gradle                           py-libconf                             sabre
grandr                           py-line-profiler                       salmon
graphlib                         py-lit                                 sambamba
graphmap                         py-lmfit                               samrai
graphviz                         py-lockfile                            samtools
grib-api                         py-logilab-common                      sandbox
groff                            py-lxml                                sas
gromacs                          py-lzstring                            satsuma2
gsl                              py-macholib                            savanna
gtkorvo-atl                      py-machotools                          saws
gtkorvo-cercs-env                py-macs2                               sbt
gtkorvo-dill                     py-mako                                scala
gtkorvo-enet                     py-mappy                               scalasca
gtkplus                          py-markdown                            scalpel
gts                              py-markupsafe                          scons
guidance                         py-matplotlib                          scorec-core
guile                            py-mccabe                              scorep
h5hut                            py-mdanalysis                          scotch
h5part                           py-meep                                scr
h5utils                          py-memory-profiler                     screen
h5z-zfp                          py-methylcode                          scripts
hacckernels                      py-misopy                              scrnsaverproto
hadoop                           py-mistune                             sctk
hapcut2                          py-mock                                sdl2
haploview                        py-mongo                               sdl2-image
harfbuzz                         py-monotonic                           sed
harminv                          py-monty                               seqprep
hdf                              py-mpi4py                              seqtk
hdf5                             py-mpmath                              serf
hdf5-blosc                       py-multiprocess                        sessreg
help2man                         py-multiqc                             setxkbmap
hepmc                            py-mx                                  sga
heppdt                           py-mxnet                               shapeit
highfive                         py-myhdl                               shared-mime-info
highwayhash                      py-mysqldb1                            shiny-server
hisat2                           py-nbconvert                           shortstack
hmmer                            py-nbformat                            showfont
hoomd-blue                       py-neo                                 sickle
hpccg                            py-nestle                              signalp
hpctoolkit                       py-netcdf4                             silo
hpctoolkit-externals             py-netifaces                           simplemoc
hpgmg                            py-networkx                            simul
hpl                              py-nose                                simulationio
hpx                              py-nosexcover                          singularity
hpx5                             py-numexpr                             slepc
hsakmt                           py-numpy                               slurm
hstr                             py-numpydoc                            smalt
htop                             py-olefile                             smc
htslib                           py-ont-fast5-api                       smproxy
httpie                           py-openpyxl                            snakemake
hub                              py-ordereddict                         snap
hunspell                         py-oset                                snap-berkeley
hwloc                            py-packaging                           snap-korf
hybpiper                         py-palettable                          snappy
hydra                            py-pandas                              snbone
hypre                            py-paramiko                            sniffles
ibmisc                           py-pathlib2                            snptest
iceauth                          py-pathos                              soap2
icedtea                          py-pathspec                            soapindel
icet                             py-patsy                               soapsnp
ico                              py-pbr                                 somatic-sniper
icu4c                            py-periodictable                       sortmerna
id3lib                           py-petsc4py                            sosflow
idba                             py-pexpect                             sowing
igraph                           py-phonopy                             sox
ilmbase                          py-pickleshare                         spades
image-magick                     py-pil                                 spark
imake                            py-pillow                              sparsehash
impute2                          py-pip                                 sparta
infernal                         py-pipits                              spdlog
inputproto                       py-pkgconfig                           spectrum-mpi
intel                            py-ply                                 speex
intel-daal                       py-pmw                                 sph2pipe
intel-gpu-tools                  py-pox                                 spherepack
intel-ipp                        py-ppft                                spindle
intel-mkl                        py-prettytable                         spot
intel-mpi                        py-proj                                sqlite
intel-parallel-studio            py-prompt-toolkit                      squid
intel-tbb                        py-protobuf                            sra-toolkit
intltool                         py-psutil                              sspace-longread
ior                              py-ptyprocess                          sspace-standard
iozone                           py-pudb                                sst-dumpi
ipopt                            py-py                                  sst-macro
isaac                            py-py2bit                              stacks
isaac-server                     py-py2cairo                            staden-io-lib
isl                              py-py2neo                              star
itstool                          py-py4j                                star-ccm-plus
itsx                             py-pyasn1                              stat
jags                             py-pybigwig                            stc
jansson                          py-pybind11                            stream
jasper                           py-pybtex                              strelka
jdk                              py-pybtex-docutils                     stress
jellyfish                        py-pychecker                           stringtie
jemalloc                         py-pycodestyle                         structure
jmol                             py-pycparser                           sublime-text
jq                               py-pycrypto                            subread
json-c                           py-pycurl                              subversion
json-cwx                         py-pydatalog                           suite-sparse
jsoncpp                          py-pydispatcher                        sumaclust
judy                             py-pydot                               sundials
julia                            py-pyelftools                          superlu
kahip                            py-pyfasta                             superlu-dist
kaks-calculator                  py-pyfftw                              superlu-mt
kaldi                            py-pyflakes                            sw4lite
kallisto                         py-pygments                            swarm
kbproto                          py-pygobject                           swfft
kdiff3                           py-pygtk                               swiftsim
kealib                           py-pylint                              swig
kentutils                        py-pymatgen                            symengine
kmergenie                        py-pyminifier                          sympol
kokkos                           py-pympler                             sz
kraken                           py-pynn                                tabix
krims                            py-pypar                               talloc
kripke                           py-pyparsing                           tar
laghos                           py-pypeflow                            targetp
lammps                           py-pyprof2html                         task
last                             py-pyqt                                taskd
latte                            py-pyrad                               tassel
launchmon                        py-pysam                               tau
lazyten                          py-pyscaf                              tcl
lbann                            py-pyserial                            tcoffee
lbxproxy                         py-pyside                              tcsh
lcals                            py-pysocks                             tealeaf
lcms                             py-pytables                            tetgen
ldc                              py-pytest                              tethex
ldc-bootstrap                    py-pytest-cov                          texinfo
legion                           py-pytest-flake8                       texlive
leveldb                          py-pytest-httpbin                      the-platinum-searcher
lftp                             py-pytest-mock                         the-silver-searcher
libaec                           py-pytest-runner                       thrift
libaio                           py-pytest-xdist                        thrust
libapplewm                       py-python-daemon                       tig
libarchive                       py-python-gitlab                       tinyxml
libassuan                        py-pythonqwt                           tinyxml2
libatomic-ops                    py-pytz                                tk
libbeagle                        py-pywavelets                          tmalign
libbsd                           py-pyyaml                              tmhmm
libbson                          py-qtawesome                           tmux
libcanberra                      py-qtconsole                           tmuxinator
libcap                           py-qtpy                                tophat
libcerf                          py-quantities                          tppred
libcircle                        py-radical-utils                       transabyss
libconfig                        py-ranger                              transdecoder
libctl                           py-readme-renderer                     transposome
libdivsufsort                    py-regex                               transset
libdmx                           py-requests                            trapproto
libdrm                           py-restview                            tree
libdwarf                         py-rope                                trf
libedit                          py-rpy2                                triangle
libelf                           py-rsa                                 trilinos
libemos                          py-rtree                               trimgalore
libepoxy                         py-saga-python                         trimmomatic
libevent                         py-scientificpython                    turbine
libevpath                        py-scikit-image                        turbomole
libfabric                        py-scikit-learn                        tut
libffi                           py-scipy                               twm
libffs                           py-seaborn                             tycho2
libfontenc                       py-setuptools                          typhonio
libfs                            py-sh                                  uberftp
libgcrypt                        py-shiboken                            udunits2
libgd                            py-simplegeneric                       uncrustify
libgit2                          py-simplejson                          unibilium
libgpg-error                     py-singledispatch                      unison
libgpuarray                      py-sip                                 units
libgtextutils                    py-six                                 unixodbc
libharu                          py-slepc4py                            usearch
libhio                           py-sncosmo                             util-linux
libice                           py-snowballstemmer                     util-macros
libiconv                         py-spectra                             uuid
libint                           py-spefile                             valgrind
libjpeg                          py-spglib                              vampirtrace
libjpeg-turbo                    py-sphinx                              vardictjava
libksba                          py-sphinx-bootstrap-theme              varscan
liblbxutil                       py-sphinx-rtd-theme                    vc
libmatheval                      py-sphinxcontrib-bibtex                vcftools
libmesh                          py-sphinxcontrib-programoutput         vcsh
libmng                           py-sphinxcontrib-websupport            vdt
libmongoc                        py-spyder                              vecgeom
libmonitor                       py-spykeutils                          veclibfort
libnbc                           py-sqlalchemy                          vegas2
libogg                           py-statsmodels                         velvet
liboldx                          py-storm                               videoproto
libpcap                          py-subprocess32                        viennarna
libpciaccess                     py-symengine                           viewres
libpfm4                          py-symfit                              vim
libpipeline                      py-sympy                               virtualgl
libpng                           py-tabulate                            visit
libpsl                           py-tappy                               vizglow
libpthread-stubs                 py-terminado                           vmatch
libquo                           py-theano                              voropp
libsigsegv                       py-tifffile                            votca-csg
libsm                            py-tomopy                              votca-ctp
libsodium                        py-tornado                             votca-moo
libspatialindex                  py-tqdm                                votca-tools
libsplash                        py-traitlets                           votca-xtp
libssh2                          py-tuiview                             vpfft
libsvm                           py-twisted                             vpic
libszip                          py-typing                              vsearch
libtermkey                       py-tzlocal                             vtk
libtiff                          py-unittest2                           vtkh
libtool                          py-unittest2py3k                       vtkm
libunistring                     py-urllib3                             wannier90
libunwind                        py-urwid                               wget
libuuid                          py-vcversioner                         windowswmproto
libuv                            py-virtualenv                          wt
libvorbis                        py-vsc-base                            wx
libvterm                         py-vsc-install                         wxpropgrid
libwebsockets                    py-wcsaxes                             x11perf
libwindowswm                     py-wcwidth                             xapian-core
libx11                           py-webkit-server                       xauth
libxau                           py-werkzeug                            xbacklight
libxaw                           py-wheel                               xbiff
libxaw3d                         py-widgetsnbextension                  xbitmaps
libxc                            py-wrapt                               xcalc
libxcb                           py-xarray                              xcb-demo
libxcomposite                    py-xlrd                                xcb-proto
libxcursor                       py-xlsxwriter                          xcb-util
libxdamage                       py-xmlrunner                           xcb-util-cursor
libxdmcp                         py-xopen                               xcb-util-errors
libxevie                         py-xpyb                                xcb-util-image
libxext                          py-xvfbwrapper                         xcb-util-keysyms
libxfixes                        py-yapf                                xcb-util-renderutil
libxfont                         py-yt                                  xcb-util-wm
libxfont2                        py-zmq                                 xclip
libxfontcache                    python                                 xclipboard
libxft                           qbank                                  xclock
libxi                            qbox                                   xcmiscproto
libxinerama                      qhull                                  xcmsdb
libxkbfile                       qmcpack                                xcompmgr
libxkbui                         qmd-progress                           xconsole
libxml2                          qrupdate                               xcursor-themes
libxmu                           qt                                     xcursorgen
libxp                            qt-creator                             xdbedizzy
libxpm                           qtgraph                                xditview
libxpresent                      qthreads                               xdm
libxprintapputil                 quinoa                                 xdpyinfo
libxprintutil                    qwt                                    xdriinfo
libxrandr                        r                                      xedit
libxrender                       r-a4                                   xerces-c
libxres                          r-a4base                               xev
libxscrnsaver                    r-a4classif                            xextproto
libxshmfence                     r-a4core                               xeyes
libxslt                          r-a4preproc                            xf86bigfontproto
libxsmm                          r-a4reporting                          xf86dga
libxstream                       r-abadata                              xf86dgaproto
libxt                            r-abaenrichment                        xf86driproto
libxtrap                         r-abind                                xf86miscproto
libxtst                          r-absseq                               xf86rushproto
libxv                            r-acde                                 xf86vidmodeproto
libxvmc                          r-acepack                              xfd
libxxf86dga                      r-acgh                                 xfindproxy
libxxf86misc                     r-acme                                 xfontsel
libxxf86vm                       r-ada                                  xfs
libyogrt                         r-adabag                               xfsinfo
libzip                           r-ade4                                 xfwp
likwid                           r-adegenet                             xgamma
linkphase3                       r-adsplit                              xgc
linux-headers                    r-affxparser                           xhost
listres                          r-affy                                 xineramaproto
llvm                             r-affycomp                             xinit
llvm-lld                         r-affycompatible                       xinput
llvm-openmp-ompt                 r-affycontam                           xkbcomp
lmdb                             r-affycoretools                        xkbdata
lmod                             r-affydata                             xkbevd
lndir                            r-affyexpress                          xkbprint
log4cxx                          r-affyilm                              xkbutils
lrslib                           r-affyio                               xkeyboard-config
lrzip                            r-affypdnn                             xkill
lua                              r-affyplm                              xload
lua-bitlib                       r-affyqcreport                         xlogo
lua-jit                          r-affyrnadegradation                   xlsatoms
lua-lpeg                         r-agdex                                xlsclients
lua-luafilesystem                r-agilp                                xlsfonts
lua-luaposix                     r-agimicrorna                          xmag
lua-mpack                        r-aims                                 xman
luit                             r-aldex2                               xmessage
lulesh                           r-allelicimbalance                     xmh
lwgrp                            r-alpine                               xmlto
lwm2                             r-als                                  xmodmap
lz4                              r-alsace                               xmore
lzma                             r-altcdfenvs                           xorg-cf-files
lzo                              r-ampliqueso                           xorg-docs
m4                               r-analysispageserver                   xorg-gtest
macsio                           r-anaquin                              xorg-server
mad-numdiff                      r-aneufinder                           xorg-sgml-doctools
mafft                            r-aneufinderdata                       xphelloworld
magics                           r-annaffy                              xplor-nih
magma                            r-annotate                             xplsprinters
makedepend                       r-annotationdbi                        xpr
mallocmc                         r-annotationfilter                     xprehashprinterlist
man-db                           r-annotationforge                      xprop
mariadb                          r-annotationhub                        xproto
masa                             r-ape                                  xproxymanagementprotocol
matio                            r-assertthat                           xqilla
matlab                           r-backports                            xrandr
maven                            r-bamsignals                           xrdb
maverick                         r-base64                               xrefresh
mawk                             r-base64enc                            xrootd
mbedtls                          r-beanplot                             xrx
mcl                              r-bh                                   xsbench
mdtest                           r-biobase                              xscope
meep                             r-biocgenerics                         xsdk
memaxes                          r-biocinstaller                        xsdktrilinos
meme                             r-biocparallel                         xset
mercurial                        r-biomart                              xsetmode
mesa                             r-biostrings                           xsetpointer
mesa-glu                         r-biovizbase                           xsetroot
meshkit                          r-bit                                  xsm
meson                            r-bit64                                xstdcmap
mesquite                         r-bitops                               xterm
metaphysicl                      r-blob                                 xtrans
metis                            r-boot                                 xtrap
mfem                             r-brew                                 xts
microbiomeutil                   r-bsgenome                             xvidtune
miniaero                         r-bumphunter                           xvinfo
miniamr                          r-c50                                  xwd
miniconda2                       r-callr                                xwininfo
miniconda3                       r-car                                  xwud
minife                           r-caret                                xz
minighost                        r-category                             yajl
minigmg                          r-catools                              yaml-cpp
minimap2                         r-cellranger                           yasm
minimd                           r-checkmate                            yorick
minismac2d                       r-checkpoint                           z3
minitri                          r-chron                                zeromq
minixyce                         r-circlize                             zfp
mirdeep                          r-class                                zip
mitofates                        r-clipr                                zlib
mitos                            r-cluster                              zoltan
mkfontdir                        r-coda                                 zsh
mkfontscale                      r-codetools                            zstd
mlhka                            r-coin

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
postgresql  py-mysqldb1  py-sqlalchemy  r-rmysql  r-rpostgresql  r-rsqlite  r-sqldf  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        http://www.mpich.org/static/downloads/3.2/mpich-3.2.tar.gz

Safe versions:  
    develop    [git] git://github.com/pmodels/mpich
    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        http://www.mpich.org/static/downloads/3.2/mpich-3.2.tar.gz

Safe versions:  
    develop    [git] git://github.com/pmodels/mpich
    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@1.9   openmpi        openmpi@1.7.5:  spectrum-mpi
    intel-parallel-studio+mpi  mpich@1:  mvapich2  mvapich2@2.0:  openmpi@1.6.5  openmpi@2.0.0:

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     mvapich2      mvapich2@2.0:  openmpi@1.6.5   openmpi@2.0.0:
    intel-parallel-studio+mpi  mpich@3:  mvapich2@1.9  openmpi        openmpi@1.7.5:  spectrum-mpi

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

Spack currently 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 may be mounted without flock support enabled. You can determine how your filesystems are mounted with mount -p. The output for a Lustre filesystem might look like this:

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

Note the flock option on both Lustre mounts. If you do not see this or a similar option for your filesystem, you may need ot ask your system administrator to enable flock.

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 [-hkVcolor] <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 is auto

more help:
  spack help -a          list all available commands
  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 [-h] [--only {package,dependencies}] [-j JOBS]
                     [--overwrite] [--keep-prefix] [--keep-stage] [--restage]
                     [--use-cache] [--show-log-on-error] [--source] [-n] [-v]
                     [--fake] [-f] [--clean | --dirty]
                     [--test {root,all} | --run-tests] [--log-format {junit}]
                     [--log-file LOG_FILE] [-y]
                     ...

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  explicitly 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
  --restage             if a partial install is detected, 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 check packages against checksum
  -v, --verbose         display verbose build output while installing
  --fake                fake install for debug purposes.
  -f, --file            install from file. Read specs to install from .yaml
                        files
  --clean               sanitize the environment from variables that can
                        affect how packages find libraries or headers
  --dirty               maintain the current environment without trying to
                        sanitize it
  --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 {junit}  format to be used for log files
  --log-file LOG_FILE   filename for the log file. if not passed a default
                        will be used
  -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.