-
Notifications
You must be signed in to change notification settings - Fork 197
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow user to define the default compiler optimsation level #1565
Changes from 3 commits
835ada3
41b94eb
2fdfb26
4d0f36a
110dc8d
f66f193
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,7 +35,7 @@ | |
from easybuild.tools.toolchain.toolchain import Toolchain | ||
|
||
|
||
# 'GENERIC' can beused to enable generic compilation instead of optimized compilation (which is the default) | ||
# 'GENERIC' can be used to enable generic compilation instead of optimized compilation (which is the default) | ||
# by doing eb --optarch=GENERIC | ||
OPTARCH_GENERIC = 'GENERIC' | ||
|
||
|
@@ -231,9 +231,17 @@ def _set_compiler_flags(self): | |
fflags = [self.options.option(x) for x in self.COMPILER_F_FLAGS + self.COMPILER_F_UNIQUE_FLAGS \ | ||
if self.options.get(x, False)] | ||
|
||
# Allow a user-defined default optimisation | ||
default_opt_level = build_option('default_opt_level') | ||
if default_opt_level in self.COMPILER_OPT_FLAGS: | ||
default_opt = default_opt_level | ||
else: | ||
raise EasyBuildError("Unknown value for default optimisation: %s (possibilities are %s)" % | ||
(default_opt_level, self.COMPILER_OPT_FLAGS)) | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Invalid option already picked up by the option parser...could remove the if/else? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm, leave it there, it's pretty cheap, and we may change things later such that |
||
# 1st one is the one to use. add default at the end so len is at least 1 | ||
optflags = [self.options.option(x) for x in self.COMPILER_OPT_FLAGS if self.options.get(x, False)] + \ | ||
[self.options.option('defaultopt')] | ||
[self.options.option(default_opt)] | ||
|
||
optarchflags = [] | ||
if build_option('optarch') == OPTARCH_GENERIC: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about
and then also use
default_opt_level
below