From 8cc9a6cd6f6e97c3cab4e61dea6a54aaba455ec9 Mon Sep 17 00:00:00 2001 From: sam Date: Fri, 4 Apr 2025 10:16:48 +0200 Subject: [PATCH] update optarch usage for EB 5 --- docs/controlling-compiler-optimization-flags.md | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/docs/controlling-compiler-optimization-flags.md b/docs/controlling-compiler-optimization-flags.md index ec3b4a3d58..31187b150a 100644 --- a/docs/controlling-compiler-optimization-flags.md +++ b/docs/controlling-compiler-optimization-flags.md @@ -76,22 +76,17 @@ should use, rather than the ones used by default (depending on the compiler in t Like any other configuration setting, this can also be specified via `$EASYBUILD_OPTARCH`, or by defining `optarch` in an EasyBuild configuration file (cfr. [Consistency across supported configuration types][configuration_consistency]). -For example, by specifying `--optarch=march=core2`, EasyBuild will use `-march=core2` rather than the default +For example, by specifying `--optarch=-march=core2`, EasyBuild will use `-march=core2` rather than the default flag `--march=native` (when using GCC compilers). Likewise, to avoid using the default `-xHost` flag with the Intel compilers and using `-xSSSE3` instead, -you can define `$EASYBUILD_OPTARCH` to be equal to `xSSSE3`. - -!!! note - The first dash (`-`) is added automagically to the value specified to `--optarch`, - because of technicalities with the current implementation. +you can define `$EASYBUILD_OPTARCH` to be equal to `-xSSSE3`. The `--optarch` configuration option gives you flexibility to define the specific target architecture optimization flags you want, but requires that you take care of specifying different flags for different compilers and choose the right flags depending on your specific processor architecture. - ### Optimizing for a generic processor architecture via `--optarch=GENERIC` {: #controlling_compiler_optimization_flags_optarch_generic } To make EasyBuild optimize for a *generic* processor architecture, `--optarch` can be set to '`GENERIC`'. @@ -121,16 +116,14 @@ compiler used on the packages to be installed. The syntax is `;`, where `:` separates the compiler name from the compiler flags, and `;` separates different compilers. This is an example for the Intel and GCC compilers: -`--optarch='Intel:xHost;GCC:march=x86-64 -mtune=generic'`. As in the simple cases, EasyBuild adds one `-` to the -flags specified, so the flags passed to the Intel and GCC compilers in this case are `-xHost` and -`-march=x86-64 -mtune=generic`. Please note the quotes to escape the space in the GCC flags. +`--optarch='Intel:-xHost;GCC:-march=x86-64 -mtune=generic'`. Please note the quotes to escape the space in the GCC flags. Additionally, `GENERIC` is also supported on a compiler basis, allowing to specify a generic compilation for the -desired compilers. This is an example of this usage: `--optarch=Intel:xHost;GCC:GENERIC`. Of course, this is +desired compilers. This is an example of this usage: `--optarch=Intel:-xHost;GCC:GENERIC`. Of course, this is supported just for compiler toolchains that recognize `GENERIC`. The options for each compiler are set independently. That means that if a GCC-based toolchain is used, but the only -compiler specified is `Intel` (for example with `--optarch=Intel:xCORE-AVX2`), then EasyBuild will behave as if +compiler specified is `Intel` (for example with `--optarch=Intel:-xCORE-AVX2`), then EasyBuild will behave as if `--optarch` was not specified for this toolchain. The compiler name corresponds to the value of the `COMPILER_FAMILY` constant of the toolchain. Two common examples