AMD Toolchain with SPACK

Micro Benchmarks/Synthetic

SPACK HPC Applications

Setting up Spack

Steps to clone from the Spack community and set the environment for Spack:

# Install Spack into SPACK_ROOT directory
$ export SPACK_ROOT=/path/to/spack
# Now get Spack
$ git clone $SPACK_ROOT
# You can add following lines to your .bashrc or .profile file to set the paths
$ export SPACK_ROOT=/path/to/spack
$ source ${SPACK_ROOT}/share/spack/

Listing the available compilers

Spack has the ability to build packages with multiple compilers and compiler versions. Spack searches for compilers on your machine automatically the first time it is run. It does this by inspecting your $PATH.

You can see which compilers Spack has found by running spack compilers or spack compiler list:

Spack compilers
# To list available compilers
$ spack compilers
==> Available compilers
— aocc rhel8-x86_64 ——————————————–
aocc@2.3.0 aocc@2.2.1 aocc@2.2.0
— gcc rhel8-x86_64 ———————————————

If you do not see a compiler in this list, but you want to use it with Spack, you can simply run spack compiler find with the path to where the compiler is installed.

Build Your Own Compiler

Install GCC using Spack
# To install gcc@10.2.0
$ spack install gcc@10.2.0
# To add gcc@10.2.0 to your list of compilers
$ spack cd -i gcc@10.2.0
$ spack compiler add $PWD
# or you can add by spack compiler find
$ spack compiler find <Path to gcc@10.2.0>

Some Basic Commands

Some basic commands
# Update your git Repo
$ git pull
# To source spack env
$ source ${SPACK_ROOT}/share/spack/
# Show information for package Stream
$ spack info stream
# Shows installed packages of stream
$ spack find stream
# Show available compilers
$ spack compilers
# To edit compiler.yaml file
$ spack config edit compilers
# Show spack recipe for Stream package
$ spack edit stream
# Show build configuration for Stream
$ spack spec stream
# Install Stream package
$ spack install stream
# Uninstall Stream package
$ spack uninstall stream
# Go to location spack package location
$ spack cd -p stream
# Go to Stream installed location
$ spack cd -i stream
# List installed details of Stream
$ spack find -Ldvf stream
# Install specific version with @
$ spack install stream@5.10
# Specify a compiler with %
$ spack install stream@5.10 %aocc
# Add compile time opts with +
$ spack install stream +openmp
# Add custom compiler flags
$ spack install stream cflags="-O3"