Multiple compilers and compiler versions are available for building software using Spack, on Great Lakes, Armis2 and Lighthouse. Compilers can be made available to Spack by specifying them manually in compilers.yaml (or spack.yaml for custom environments), or automatically by running $ spack compiler find
. To view the list of compilers available, run $ spack compilers
$ spack compilers
or $ spack compiler list
==> Available compilers -- gcc rhel8-x86_64 --------------------------------------------- [email protected] [email protected] [email protected] [email protected] -- intel rhel8-x86_64 ------------------------------------------- [email protected]
Compiler Info
To view the specific compiler information, run $ spack compiler info
. For example, $ spack compiler info [email protected]
[email protected]: paths: ----- cc = /sw/pkgs/arc/gcc/13.2.0/bin/gcc ----- cxx = /sw/pkgs/arc/gcc/13.2.0/bin/g++ ----- f77 = /sw/pkgs/arc/gcc/13.2.0/bin/gfortran ----- fc = /sw/pkgs/arc/gcc/13.2.0/bin/gfortran modules = [] operating system = rhel8
Selecting a Compiler when Installing Software
A compiler and its version can be specified when using the spack install <pkg-name>
command, a compiler is specified with % and its version using @, for example, to install gmake using GCC 10.3.0, run: $ spack install gmake%[email protected]