Skip to content

Commit 1628c0f

Browse files
authored
Merge pull request #317 from smoors/optarch
add caveat about --optarch with --robot
2 parents 0948855 + d94d8bc commit 1628c0f

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

docs/controlling-compiler-optimization-flags.md

+14-12
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,15 @@ See these links for more details w.r.t. OpenBLAS:
6767
* <https://github.com/xianyi/OpenBLAS/blob/develop/TargetList.txt>
6868
* <https://github.com/xianyi/OpenBLAS/issues/685>
6969

70+
#### Using `--optarch` with `--robot` {: #controlling_compiler_optimization_flags_optarch_caveats_robot }
71+
72+
Keep in mind, when using `--optarch=<flags>` as described below in combination with `--robot`, any dependencies that
73+
haven’t been installed yet will also be built with `--optarch=<flags>`. To specify compiler flags only for
74+
the given easyconfig, use the [`toolchainopts`][vsd_avail_easyconfig_params] easyconfig parameter, for example:
75+
76+
```python
77+
toolchainopts = {'optarch': '<flags>'}
78+
```
7079

7180
### Specifying target architecture specific optimization flags to use via `--optarch=<flags>` {: #controlling_compiler_optimization_flags_optarch_flags }
7281

@@ -76,22 +85,17 @@ should use, rather than the ones used by default (depending on the compiler in t
7685
Like any other configuration setting, this can also be specified via `$EASYBUILD_OPTARCH`, or by defining `optarch`
7786
in an EasyBuild configuration file (cfr. [Consistency across supported configuration types][configuration_consistency]).
7887

79-
For example, by specifying `--optarch=march=core2`, EasyBuild will use `-march=core2` rather than the default
88+
For example, by specifying `--optarch=-march=core2`, EasyBuild will use `-march=core2` rather than the default
8089
flag `--march=native` (when using GCC compilers).
8190

8291
Likewise, to avoid using the default `-xHost` flag with the Intel compilers and using `-xSSSE3` instead,
83-
you can define `$EASYBUILD_OPTARCH` to be equal to `xSSSE3`.
84-
85-
!!! note
86-
The first dash (`-`) is added automagically to the value specified to `--optarch`,
87-
because of technicalities with the current implementation.
92+
you can define `$EASYBUILD_OPTARCH` to be equal to `-xSSSE3`.
8893

8994
The `--optarch` configuration option gives you flexibility to define the specific target architecture optimization
9095
flags you want, but requires that you take care of specifying different flags for different compilers and choose
9196
the right flags depending on your specific processor architecture.
9297

9398

94-
9599
### Optimizing for a generic processor architecture via `--optarch=GENERIC` {: #controlling_compiler_optimization_flags_optarch_generic }
96100

97101
To make EasyBuild optimize for a *generic* processor architecture, `--optarch` can be set to '`GENERIC`'.
@@ -121,16 +125,14 @@ compiler used on the packages to be installed.
121125

122126
The syntax is `<compiler:flags>;<compiler:flags>`, where `:` separates the compiler name from the compiler flags,
123127
and `;` separates different compilers. This is an example for the Intel and GCC compilers:
124-
`--optarch='Intel:xHost;GCC:march=x86-64 -mtune=generic'`. As in the simple cases, EasyBuild adds one `-` to the
125-
flags specified, so the flags passed to the Intel and GCC compilers in this case are `-xHost` and
126-
`-march=x86-64 -mtune=generic`. Please note the quotes to escape the space in the GCC flags.
128+
`--optarch='Intel:-xHost;GCC:-march=x86-64 -mtune=generic'`. Please note the quotes to escape the space in the GCC flags.
127129

128130
Additionally, `GENERIC` is also supported on a compiler basis, allowing to specify a generic compilation for the
129-
desired compilers. This is an example of this usage: `--optarch=Intel:xHost;GCC:GENERIC`. Of course, this is
131+
desired compilers. This is an example of this usage: `--optarch=Intel:-xHost;GCC:GENERIC`. Of course, this is
130132
supported just for compiler toolchains that recognize `GENERIC`.
131133

132134
The options for each compiler are set independently. That means that if a GCC-based toolchain is used, but the only
133-
compiler specified is `Intel` (for example with `--optarch=Intel:xCORE-AVX2`), then EasyBuild will behave as if
135+
compiler specified is `Intel` (for example with `--optarch=Intel:-xCORE-AVX2`), then EasyBuild will behave as if
134136
`--optarch` was not specified for this toolchain.
135137

136138
The compiler name corresponds to the value of the `COMPILER_FAMILY` constant of the toolchain. Two common examples

0 commit comments

Comments
 (0)