Show Menu

Spack_AMD Cheat Sheet by

spack commands to run AMD Toolchain


1. Python 2 (2.6 or 2.7) or 3 (3.5 - 3.9) to run Spack
2. A C/C++ compiler for building
3. The make executable for building
4. The tar, gzip, bzip2, xz and optionally zstd execut­ables for extracting source code
5. The patch command to apply patches
6. The git and curl commands for fetching
7. If using the gpg subcom­mand, gnupg2 is required

Specs & depend­encies

@ is optional version specifier (@1.2­:1.4)
Ex: amdff­tw@2.2
% is optional compiler specifier
Ex: amdff­tw@2.2 %aocc@2.2
+ or - or ~ are optional variant specifiers for boolean variants
Ex: +debug, -qt, or ~qt
name=­<va­lue­> is optional variant specifier
Ex: amdbl­is@2.2 thread­s=o­penmp
name=­<va­lue­> is optional compiler flag specifiers
Valid flag names are cflags, cxxfl­ags, fflags, cppfl­ags,
ldflags, and ldlibs
targe­t=<­val­ue> os=<va­lue­> are
optional archit­ecture specifier
Ex: targe­t=zen2 os=aocc
^ Dependency specs
Ex: amdfftw ^openm­pi@­4.0.3


spack config edit [-h] [--pri­nt-­file] section
get and set config­uration options,
section: compi­ler­s/m­irr­ors­/re­pos­/pa­cka­ges­/mo­dul­es/­con­fig­/up­str­eams
spack config update [-hy] section
update config­uration options

Query packages

spack info package
get detailed inform­ation on a
particular packages are on disk as installed
spack depend­encies packag­e/p­ack­age­_specs
show depend­encies of a package
spack depend­ents package
show packages that depend on another
spack find [-ldvf] [package]
list and search installed packages
spack graph packag­e/p­ack­age­_specs
generate graphs of package dependency relati­onships
spack list
list and search available packages
spack location [-i, --inst­all­-dir] [-p, --pack­age­-dir] package
print out locations of packages and spack direct­ories
spack providers virtua­l_p­ackage
list packages that provide a particular virtual package

Build packages

spack clean [-a, --all] [-s, --stage] [-p, --pyth­on-­cache] [packa­ge(s)]
remove temporary build files and/or
downloaded archives
spack gc [-y, --yes-­to-­all]
remove specs that are now no longer
spack install [-j, --jobs JOBS] [-v, --verbose] [--cac­he-­only] [--sou­rce] packag­e_specs
build and install packages
spack setup [-v, --verb­ose] packag­e_specs
create a config­uration script and module,
but don’t build
spack spec [-l, --long] [-I, --inst­all­-st­atus] package(s)
show what would be installed,
given a spec
spack uninstall [-R, --depe­ndents] [-y, --yes-­to-­all] packag­e_specs
remove installed packages

Create packages

spack create [-hfb] [--kee­p-s­tage] [-n NAME] [url]
create a new package file, url:url of package archive
spack edit [-h] [package]
open package files in $EDITOR
spack versions [-hs] [-c CONCUR­RENCY] package
list available versions of a package


spack add [-h] [-l LIST_N­AME] packag­e_specs
add a spec to an enviro­nment
spack concretize [-f, --force]
concretize an enviro­nment and write a lockfile
spack env create [--wit­hou­t-view] env [envfile]
create virtual enviro­nments
spack env list
list all virtual enviro­nments
spack env activate [-v, --with­-view]
manage virtual enviro­nments
spack env remove [-hy] env [envfile]
remove virtual enviro­nments


spack arch [-h] [--kno­wn-­tar­gets] [-p | -o | -t] [-f | -b]
print archit­ecture inform­ation about this machine
spack compiler find add_paths
find compilers from given path
spack compiler remove compil­er_spec
remove given compiler
spack compiler list / spack compilers
list compilers available
spack compiler info [-h] compil­er_spec
show compiler inform­ation


spack cd [-i, --inst­all­-dir] [-p, --pack­age­-dir] packag­e_spec
cd to spack direct­ories in the shell
spack flake8 specif­ic_­fil­es_­to_­check
runs source code style checks on Spack. requires flake8

User enviro­nment

spack load packag­e_specs
add installed package to the user enviro­nment
spack unload packag­e_specs
remove package from the user enviro­nment


spack activate instal­led­_spec
activate a package extension on installed package spec
spack extensions [-s {packa­ges­,in­sta­lle­d,a­cti­vat­ed,­all}] packag­e_spec
list extensions for package

More help

spack docs [-h]
open spack docume­ntation in a web browser
spack help [-ha] [--spec] help_c­omm­and]
get help on spack and its commands


Help Us Go Positive!

We offset our carbon usage with Ecologi. Click the link below to help us!

We offset our carbon footprint via Ecologi


No comments yet. Add yours below!

Add a Comment

Your Comment

Please enter your name.

    Please enter your email address

      Please enter your Comment.