On 21/10/16 09:22, Markus Geimer wrote:
Hi all,
I noticed that some easyconfigs (e.g., ncurses) specify
toolchainopts = {'optarch': True}
This makes me wonder about three things. First, I was under
the impression that 'optarch = True' was the default, i.e.,
isn't the above setting in the easyconfig redundant?
Yes, it is indeed redundant, the 'optarch' toolchain option is enabled
by default.
Second,
does it play nicely with '--optarch=foo' or '--optarch=GENERIC'?
Which setting takes precedence?
I think it does what you'd expect. They work together, one doesn't take
precedence over the other, because they have different semantics.
The 'optarch' toolchain option specifies that the use of
architecture-specific optimization flags should be used (and it's
enabled by default).
This leads to using -xHost for the Intel compilers in $CFLAGS & co, for
example.
If is set to False, the architecture-specific optimization flags will
not be included in $CFLAGS.
The --optarch configuration option allows you to control *what*
architecture-specific optimization flags are, so you can override the
default.
This is described in detail at
http://easybuild.readthedocs.io/en/latest/Controlling_compiler_optimization_flags.html
.
Using --optarch=foo, you specify that "-foo" should be used instead of
the default arch-specific opt flags (e.g. -xHost for Intel compilers),
but only if the 'optarch' toolchain option is set to True (see above).
--optarch=GENERIC is a special case...
It specifies that the build should be performed for a very generic
architecture; for example, for the Intel compiler it will use -xSSE2
(rather than -xHost).
In this case the 'optarch' toolchain option is blatently ignored, i.e.
building with the generic architecture compiler flag(s) will always be
done, regardless of the value of the 'optarch' toolchain option.
See also
http://easybuild.readthedocs.io/en/latest/Controlling_compiler_optimization_flags.html#optimizing-for-a-generic-processor-architecture-via-optarch-generic
.
And third, if the config option
takes precedence, is there a need/way to explicitly *disable*
optarch in an easyconfig?
You can use "toolchainopts = {'optarch': False}", which will avoid the
use of -xHost using Intel compilers, but the generic architecture
compiler flag -xSSE2 will still be used if --optarch=GENERIC is used (so
I guess in that case it does take precedence).
You can specify an empty string to the --optarch configuration option to
completely override using any architecture-related compiler options.
If the 'optarch' toolchain option is True, it will use the value passed
to --optarch (an empty string); it 'optarch' toolchain option is False,
it will not use any flags (which is equivalent to using an empty string).
Does that answer your questions?
Do you feel any enhancements need to be made to the documentation to
clarify things?
regards,
Kenneth
Thanks,
Markus
--
Dr. Markus Geimer
Juelich Supercomputing Centre
Institute for Advanced Simulation
Forschungszentrum Juelich GmbH
52425 Juelich, Germany
Phone: +49-2461-61-1773
Fax: +49-2461-61-6656
E-mail: [email protected]
WWW: http://www.fz-juelich.de/jsc/
------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------
Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzender des Aufsichtsrats: MinDir Dr. Karl Eugen Huthmacher
Geschaeftsfuehrung: Prof. Dr.-Ing. Wolfgang Marquardt (Vorsitzender),
Karsten Beneke (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt
------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------