rustc

rustc (rustc) is the reference and most popular Rust compiler. The compiler program’s name is simply rustc. In all software stacks, the module name is rust. To load a specific version, run

module load rust/VERSION

To load the default version, run

module load rust

Targeting CPU Architecture

By default, the rust will compile code targeting some generic version of the CPU the compiler is run on. On an x86-64 node, this means being compatible with the original 64-bit AMD and Intel processors from 2003 and thus no AVX/AVX2/AVX-512 without SSE fallback. The compiler uses the -C target-cpu=ARCH option to control the architecture.

If you use cargo, you can use the RUSTFLAGS environment variable instead:

export RUSTFLAGS="-C target-cpu=ARCH"

The ARCH values for the different CPU architectures (Spack naming) we provide are

Architecture/Target (Spack naming)ARCH value for rustc
Most generic version of node compiler is running ongeneric
The CPU of the node the compiler is running onnative
haswellhaswell
broadwellbroadwell
skylake_avx512skylake-avx512
cascadelakecascadelake
sapphirerapidssapphirerapids
zen2znver2
zen3znver3