\documentclass[10pt,a4paper]{article} % Packages \usepackage{fancyhdr} % For header and footer \usepackage{multicol} % Allows multicols in tables \usepackage{tabularx} % Intelligent column widths \usepackage{tabulary} % Used in header and footer \usepackage{hhline} % Border under tables \usepackage{graphicx} % For images \usepackage{xcolor} % For hex colours %\usepackage[utf8x]{inputenc} % For unicode character support \usepackage[T1]{fontenc} % Without this we get weird character replacements \usepackage{colortbl} % For coloured tables \usepackage{setspace} % For line height \usepackage{lastpage} % Needed for total page number \usepackage{seqsplit} % Splits long words. %\usepackage{opensans} % Can't make this work so far. Shame. Would be lovely. \usepackage[normalem]{ulem} % For underlining links % Most of the following are not required for the majority % of cheat sheets but are needed for some symbol support. \usepackage{amsmath} % Symbols \usepackage{MnSymbol} % Symbols \usepackage{wasysym} % Symbols %\usepackage[english,german,french,spanish,italian]{babel} % Languages % Document Info \author{mohan2} \pdfinfo{ /Title (spack-amd.pdf) /Creator (Cheatography) /Author (mohan2) /Subject (Spack\_AMD Cheat Sheet) } % Lengths and widths \addtolength{\textwidth}{6cm} \addtolength{\textheight}{-1cm} \addtolength{\hoffset}{-3cm} \addtolength{\voffset}{-2cm} \setlength{\tabcolsep}{0.2cm} % Space between columns \setlength{\headsep}{-12pt} % Reduce space between header and content \setlength{\headheight}{85pt} % If less, LaTeX automatically increases it \renewcommand{\footrulewidth}{0pt} % Remove footer line \renewcommand{\headrulewidth}{0pt} % Remove header line \renewcommand{\seqinsert}{\ifmmode\allowbreak\else\-\fi} % Hyphens in seqsplit % This two commands together give roughly % the right line height in the tables \renewcommand{\arraystretch}{1.3} \onehalfspacing % Commands \newcommand{\SetRowColor}[1]{\noalign{\gdef\RowColorName{#1}}\rowcolor{\RowColorName}} % Shortcut for row colour \newcommand{\mymulticolumn}[3]{\multicolumn{#1}{>{\columncolor{\RowColorName}}#2}{#3}} % For coloured multi-cols \newcolumntype{x}[1]{>{\raggedright}p{#1}} % New column types for ragged-right paragraph columns \newcommand{\tn}{\tabularnewline} % Required as custom column type in use % Font and Colours \definecolor{HeadBackground}{HTML}{333333} \definecolor{FootBackground}{HTML}{666666} \definecolor{TextColor}{HTML}{333333} \definecolor{DarkBackground}{HTML}{A2DEA0} \definecolor{LightBackground}{HTML}{F3FAF3} \renewcommand{\familydefault}{\sfdefault} \color{TextColor} % Header and Footer \pagestyle{fancy} \fancyhead{} % Set header to blank \fancyfoot{} % Set footer to blank \fancyhead[L]{ \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{C} \SetRowColor{DarkBackground} \vspace{-7pt} {\parbox{\dimexpr\textwidth-2\fboxsep\relax}{\noindent \hspace*{-6pt}\includegraphics[width=5.8cm]{/web/www.cheatography.com/public/images/cheatography_logo.pdf}} } \end{tabulary} \columnbreak \begin{tabulary}{11cm}{L} \vspace{-2pt}\large{\bf{\textcolor{DarkBackground}{\textrm{Spack\_AMD Cheat Sheet}}}} \\ \normalsize{by \textcolor{DarkBackground}{mohan2} via \textcolor{DarkBackground}{\uline{cheatography.com/129210/cs/25514/}}} \end{tabulary} \end{multicols}} \fancyfoot[L]{ \footnotesize \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{LL} \SetRowColor{FootBackground} \mymulticolumn{2}{p{5.377cm}}{\bf\textcolor{white}{Cheatographer}} \\ \vspace{-2pt}mohan2 \\ \uline{cheatography.com/mohan2} \\ \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Cheat Sheet}} \\ \vspace{-2pt}Published 2nd December, 2020.\\ Updated 4th December, 2020.\\ Page {\thepage} of \pageref{LastPage}. \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Sponsor}} \\ \SetRowColor{white} \vspace{-5pt} %\includegraphics[width=48px,height=48px]{dave.jpeg} Measure your website readability!\\ www.readability-score.com \end{tabulary} \end{multicols}} \begin{document} \raggedright \raggedcolumns % Set font size to small. Switch to any value % from this page to resize cheat sheet text: % www.emerson.emory.edu/services/latex/latex_169.html \footnotesize % Small font. \begin{tabularx}{17.67cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{17.67cm}}{\bf\textcolor{white}{Prerequisites}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{17.67cm}}{1. Python 2 (2.6 or 2.7) or 3 (3.5 - 3.9) to run Spack} \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{17.67cm}}{2. A C/C++ compiler for building} \tn % Row Count 3 (+ 1) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{17.67cm}}{3. The `make` executable for building} \tn % Row Count 4 (+ 1) % Row 3 \SetRowColor{white} \mymulticolumn{1}{x{17.67cm}}{4. The `tar`, `gzip`, `bzip2`, `xz` and optionally `zstd` executables for extracting source code} \tn % Row Count 6 (+ 2) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{1}{x{17.67cm}}{5. The `patch` command to apply patches} \tn % Row Count 7 (+ 1) % Row 5 \SetRowColor{white} \mymulticolumn{1}{x{17.67cm}}{6. The `git` and `curl` commands for fetching} \tn % Row Count 8 (+ 1) % Row 6 \SetRowColor{LightBackground} \mymulticolumn{1}{x{17.67cm}}{7. If using the `gpg` subcommand, `gnupg2` is required} \tn % Row Count 10 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{x{8.635 cm} x{8.635 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{17.67cm}}{\bf\textcolor{white}{Specs \& dependencies}} \tn % Row 0 \SetRowColor{LightBackground} `@` is optional version specifier (`@1.2:1.4`) & Ex: `amdfftw@2.2` \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} `\%` is optional compiler specifier & Ex: `amdfftw@2.2 \%aocc@2.2` \tn % Row Count 5 (+ 2) % Row 2 \SetRowColor{LightBackground} `+` or `-` or `\textasciitilde{}` are optional variant specifiers for boolean variants & Ex: `+debug`, `-qt`, or `\textasciitilde{}qt` \tn % Row Count 9 (+ 4) % Row 3 \SetRowColor{white} `name=\textless{}value\textgreater{}` is optional variant specifier & Ex: `amdblis@2.2 threads=openmp` \tn % Row Count 12 (+ 3) % Row 4 \SetRowColor{LightBackground} `name=\textless{}value\textgreater{}` is optional compiler flag specifiers & Valid flag names are `cflags`, `cxxflags`, `fflags`, `cppflags`, \{\{nl\}\}`ldflags`, and `ldlibs` \tn % Row Count 17 (+ 5) % Row 5 \SetRowColor{white} `target=\textless{}value\textgreater{} os=\textless{}value\textgreater{}` are \{\{nl\}\}optional architecture specifier & Ex: `target=zen2 os=aocc` \tn % Row Count 21 (+ 4) % Row 6 \SetRowColor{LightBackground} `\textasciicircum{}` Dependency specs & Ex: `amdfftw \textasciicircum{}openmpi@4.0.3` \tn % Row Count 23 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{x{8.635 cm} x{8.635 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{17.67cm}}{\bf\textcolor{white}{Configuration}} \tn % Row 0 \SetRowColor{LightBackground} `spack config edit {[}-h{]} {[}-{}-print-file{]}` section & get and set configuration options, \{\{nl\}\} section: \seqsplit{`compilers/mirrors/repos/packages/modules/config/upstreams`} \tn % Row Count 6 (+ 6) % Row 1 \SetRowColor{white} `spack config update {[}-hy{]}` section & update configuration options \tn % Row Count 8 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{x{8.635 cm} x{8.635 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{17.67cm}}{\bf\textcolor{white}{Query packages}} \tn % Row 0 \SetRowColor{LightBackground} `spack info` package & get detailed information on a \{\{nl\}\} particular packages are on disk as installed \tn % Row Count 5 (+ 5) % Row 1 \SetRowColor{white} `spack dependencies` \seqsplit{package/package\_specs} & show dependencies of a package \tn % Row Count 8 (+ 3) % Row 2 \SetRowColor{LightBackground} `spack dependents` package & show packages that depend on another \tn % Row Count 10 (+ 2) % Row 3 \SetRowColor{white} `spack find {[}-ldvf{]} {[}package{]}` & list and search installed packages \tn % Row Count 12 (+ 2) % Row 4 \SetRowColor{LightBackground} `spack graph` \seqsplit{package/package\_specs} & generate graphs of package dependency relationships \tn % Row Count 15 (+ 3) % Row 5 \SetRowColor{white} `spack list` & list and search available packages \tn % Row Count 17 (+ 2) % Row 6 \SetRowColor{LightBackground} `spack location {[}-i, -{}-install-dir{]} {[}-p, -{}-package-dir{]}` package & print out locations of packages and spack directories \tn % Row Count 21 (+ 4) % Row 7 \SetRowColor{white} `spack providers` virtual\_package & list packages that provide a particular virtual package \tn % Row Count 24 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{x{8.635 cm} x{8.635 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{17.67cm}}{\bf\textcolor{white}{Build packages}} \tn % Row 0 \SetRowColor{LightBackground} `spack clean {[}-a, -{}-all{]} {[}-s, -{}-stage{]} {[}-p, -{}-python-cache{]} {[}package(s){]}` & remove temporary build files and/or \{\{nl\}\}downloaded archives \tn % Row Count 4 (+ 4) % Row 1 \SetRowColor{white} `spack gc {[}-y, -{}-yes-to-all{]}` & remove specs that are now no longer \{\{nl\}\}needed \tn % Row Count 7 (+ 3) % Row 2 \SetRowColor{LightBackground} `spack install {[}-j, -{}-jobs JOBS{]} {[}-v, -{}-verbose{]} {[}-{}-cache-only{]} {[}-{}-source{]}` package\_specs & build and install packages \tn % Row Count 12 (+ 5) % Row 3 \SetRowColor{white} `spack setup {[}-v, -{}-verbose{]}` package\_specs & create a configuration script and module,\{\{nl\}\} but don't build \tn % Row Count 16 (+ 4) % Row 4 \SetRowColor{LightBackground} `spack spec {[}-l, -{}-long{]} {[}-I, -{}-install-status{]}` package(s) & show what would be installed,\{\{nl\}\} given a spec \tn % Row Count 19 (+ 3) % Row 5 \SetRowColor{white} `spack uninstall {[}-R, -{}-dependents{]} {[}-y, -{}-yes-to-all{]}` package\_specs & remove installed packages \tn % Row Count 23 (+ 4) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{x{8.635 cm} x{8.635 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{17.67cm}}{\bf\textcolor{white}{Create packages}} \tn % Row 0 \SetRowColor{LightBackground} spack create {[}-hfb{]} {[}-{}-keep-stage{]} {[}-n NAME{]} {[}url{]} & create a new package file, url:url of package archive \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} spack edit {[}-h{]} {[}package{]} & open package files in \$EDITOR \tn % Row Count 5 (+ 2) % Row 2 \SetRowColor{LightBackground} spack versions {[}-hs{]} {[}-c CONCURRENCY{]} package & list available versions of a package \tn % Row Count 8 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{x{8.635 cm} x{8.635 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{17.67cm}}{\bf\textcolor{white}{Environments}} \tn % Row 0 \SetRowColor{LightBackground} `spack add {[}-h{]} {[}-l LIST\_NAME{]}` package\_specs & add a spec to an environment \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} `spack concretize {[}-f, -{}-force{]}` & concretize an environment and write a lockfile \tn % Row Count 6 (+ 3) % Row 2 \SetRowColor{LightBackground} `spack env create {[}-{}-without-view{]} env {[}envfile{]}` & create virtual environments \tn % Row Count 9 (+ 3) % Row 3 \SetRowColor{white} `spack env list` & list all virtual environments \tn % Row Count 11 (+ 2) % Row 4 \SetRowColor{LightBackground} `spack env activate {[}-v, -{}-with-view{]}` & manage virtual environments \tn % Row Count 13 (+ 2) % Row 5 \SetRowColor{white} `spack env remove {[}-hy{]} env {[}envfile{]}` & remove virtual environments \tn % Row Count 15 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{x{8.635 cm} x{8.635 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{17.67cm}}{\bf\textcolor{white}{System}} \tn % Row 0 \SetRowColor{LightBackground} `spack arch {[}-h{]} {[}-{}-known-targets{]} {[}-p | -o | -t{]} {[}-f | -b{]}` & print architecture information about this machine \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} `spack compiler find` add\_paths & find compilers from given path \tn % Row Count 5 (+ 2) % Row 2 \SetRowColor{LightBackground} `spack compiler remove` compiler\_spec & remove given compiler \tn % Row Count 7 (+ 2) % Row 3 \SetRowColor{white} `spack compiler list` / `spack compilers` & list compilers available \tn % Row Count 10 (+ 3) % Row 4 \SetRowColor{LightBackground} `spack compiler info {[}-h{]}` compiler\_spec & show compiler information \tn % Row Count 12 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{x{8.635 cm} x{8.635 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{17.67cm}}{\bf\textcolor{white}{Developer}} \tn % Row 0 \SetRowColor{LightBackground} `spack cd {[}-i, -{}-install-dir{]} {[}-p, -{}-package-dir{]}` package\_spec & cd to spack directories in the shell \tn % Row Count 4 (+ 4) % Row 1 \SetRowColor{white} `spack flake8` \seqsplit{specific\_files\_to\_check} & runs source code style checks on Spack. requires flake8 \tn % Row Count 7 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{x{7.0807 cm} x{10.1893 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{17.67cm}}{\bf\textcolor{white}{User environment}} \tn % Row 0 \SetRowColor{LightBackground} `spack load` package\_specs & add installed package to the user environment \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} `spack unload` package\_specs & remove package from the user environment \tn % Row Count 4 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{x{8.635 cm} x{8.635 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{17.67cm}}{\bf\textcolor{white}{Extensions}} \tn % Row 0 \SetRowColor{LightBackground} `spack activate` installed\_spec & activate a package extension on installed package spec \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} `spack extensions {[}-s \{packages,installed,activated,all\}{]}` package\_spec & list extensions for package \tn % Row Count 7 (+ 4) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{x{8.635 cm} x{8.635 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{17.67cm}}{\bf\textcolor{white}{More help}} \tn % Row 0 \SetRowColor{LightBackground} `spack docs {[}-h{]}` & open spack documentation in a web browser \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} `spack help {[}-ha{]} {[}-{}-spec{]} help\_command{]}` & get help on spack and its commands \tn % Row Count 6 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{x{5.6991 cm} x{11.5709 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{17.67cm}}{\bf\textcolor{white}{References}} \tn % Row 0 \SetRowColor{LightBackground} Spack commands & \seqsplit{https://spack.readthedocs.io/en/latest/command\_index.html\#command-reference} \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} \seqsplit{Prerequisites} & \seqsplit{https://spack.readthedocs.io/en/latest/getting\_started.html\#prerequisites} \tn % Row Count 6 (+ 3) % Row 2 \SetRowColor{LightBackground} Specs \& dependencies & \seqsplit{https://spack.readthedocs.io/en/latest/basic\_usage.html\#specs-dependencies} \tn % Row Count 9 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \end{document}