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
Modules
The following versions are available via the unified GWDG Modules.
List of Modules
| Node Type | Module Names | Requirements (Load First) |
|---|---|---|
| Grete (GPU) | rust/1.70.0 rust/1.81.0 rust/1.85.0 | |
| Emmy (CPU) | rust/1.70.0 rust/1.81.0 rust/1.85.0 |
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 on | generic |
| The CPU of the node the compiler is running on | native |
haswell | haswell |
broadwell | broadwell |
skylake_avx512 | skylake-avx512 |
cascadelake | cascadelake |
sapphirerapids | sapphirerapids |
zen2 | znver2 |
zen3 | znver3 |