Show Menu
Cheatography

Spack_AMD Cheat Sheet by

spack commands to run AMD Toolchain

Prereq­uisites

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:
amdfft­w@2.2
%
is optional compiler specifier
Ex:
amdfft­w@2.2 %aocc@2.2
+
or
-
or
~
are optional variant specifiers for boolean variants
Ex:
+debug
,
-qt
, or
~qt
name=<­val­ue>
is optional variant specifier
Ex:
amdbli­s@2.2 thread­s=o­penmp
name=<­val­ue>
is optional compiler flag specifiers
Valid flag names are
cflags
,
cxxflags
,
fflags
,
cppflags
,
ldflags
, and
ldlibs
target­=<v­alu­e> os=<va­lue>
are
optional archit­ecture specifier
Ex:
target­=zen2 os=aocc
^
Dependency specs
Ex:
amdfftw ^openm­pi@­4.0.3

Config­uration

spack config edit [-h] [--pri­nt-­file]
section
get and set config­uration options,
section:
compil­ers­/mi­rro­rs/­rep­os/­pac­kag­es/­mod­ule­s/c­onf­ig/­ups­treams
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 dependents
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
needed
spack install [-j, --jobs JOBS] [-v, --verbose] [--cac­he-­only] [--source]
packag­e_specs
build and install packages
spack setup [-v, --verbose]
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

Enviro­nments

spack add [-h] [-l LIST_NAME]
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

System

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

Developer

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

Extensions

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­ommand]
get help on spack and its commands

References

 

Comments

No comments yet. Add yours below!

Add a Comment

Your Comment

Please enter your name.

    Please enter your email address

      Please enter your Comment.