Skip to content

compilers.yaml

Read the official Spack documentation

The compilers.yaml file contains details of where existing compilers are located, along with the basic compilation arguments used by them:

Content of compilers.yaml (click to expand)
compilers:
- compiler:
    spec: gcc@=11.4.1
    paths:
      cc: /bin/gcc
      cxx: /bin/g++
      f77: /bin/gfortran
      fc: /bin/gfortran
    flags: {}
    operating_system: rocky9
    target: x86_64
    modules: []
    environment: {}
    extra_rpaths: []
- compiler:
    spec: gcc@=12.2.0
    paths:
      cc: /share/apps/rocky9/spack/apps/linux-rocky9-x86_64_v4/gcc-11.4.1/gcc/12.2.0-6frskzg/bin/gcc
      cxx: /share/apps/rocky9/spack/apps/linux-rocky9-x86_64_v4/gcc-11.4.1/gcc/12.2.0-6frskzg/bin/g++
      f77: /share/apps/rocky9/spack/apps/linux-rocky9-x86_64_v4/gcc-11.4.1/gcc/12.2.0-6frskzg/bin/gfortran
      fc: /share/apps/rocky9/spack/apps/linux-rocky9-x86_64_v4/gcc-11.4.1/gcc/12.2.0-6frskzg/bin/gfortran
    flags: {}
    operating_system: rocky9
    target: x86_64
    modules: []
    environment: {}
    extra_rpaths: []
- compiler:
    spec: oneapi@=2024.1.0
    paths:
      cc: /share/apps/rocky9/spack/apps/linux-rocky9-x86_64_v4/gcc-12.2.0/intel-oneapi-compilers/2024.1.0-bdqsx5f/compiler/2024.1/bin/icx
      cxx: /share/apps/rocky9/spack/apps/linux-rocky9-x86_64_v4/gcc-12.2.0/intel-oneapi-compilers/2024.1.0-bdqsx5f/compiler/2024.1/bin/icpx
      f77: /share/apps/rocky9/spack/apps/linux-rocky9-x86_64_v4/gcc-12.2.0/intel-oneapi-compilers/2024.1.0-bdqsx5f/compiler/2024.1/bin/ifx
      fc: /share/apps/rocky9/spack/apps/linux-rocky9-x86_64_v4/gcc-12.2.0/intel-oneapi-compilers/2024.1.0-bdqsx5f/compiler/2024.1/bin/ifx
    flags: {}
    operating_system: rocky9
    target: x86_64
    modules: []
    environment: {}
    extra_rpaths: []

Contained within the file above are:

  • GCC 11.4.1, which is installed as part of the Rocky 9 operating system that runs on all Apocrita nodes
  • GCC 12.2.0, which is installed centrally already via Spack and is what the vast majority of centrally installed applications available as modules were compiled against
  • Intel 2024.1.0, which you may or may not require, and can be deleted as appropriate

You can provide a Spack install command with a specific compiler using the % sigil, as per the Spack documentation, e.g.:

spack install nano@6.3 %gcc@12.2.0

We will return to more example installation commands later in this tutorial.