Skip to content

Commit 6e6f806

Browse files
committed
Rename several _FLAGS to _OPTIONS as that is what they actually are.
1 parent 8f13bb3 commit 6e6f806

File tree

7 files changed

+30
-30
lines changed

7 files changed

+30
-30
lines changed

easybuild/toolchains/compiler/clang.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ class Clang(Compiler):
104104

105105
COMPILER_CC = 'clang'
106106
COMPILER_CXX = 'clang++'
107-
COMPILER_C_UNIQUE_FLAGS = []
107+
COMPILER_C_UNIQUE_OPTIONS = []
108108

109109
LIB_MULTITHREAD = ['pthread']
110110
LIB_MATH = ['m']

easybuild/toolchains/compiler/craype.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def __init__(self, *args, **kwargs):
9898
"""Constructor."""
9999
super(CrayPECompiler, self).__init__(*args, **kwargs)
100100
# 'register' additional toolchain options that correspond to a compiler flag
101-
self.COMPILER_FLAGS.extend(['-dynamic', '-mpich-mt'])
101+
self.COMPILER_OPTIONS.extend(['dynamic', 'mpich-mt'])
102102

103103
# use name of PrgEnv module as name of module that provides compiler
104104
self.COMPILER_MODULE_NAME = ['PrgEnv-%s' % self.PRGENV_MODULE_NAME_SUFFIX]
@@ -139,7 +139,7 @@ class CrayPEGCC(CrayPECompiler):
139139
def __init__(self, *args, **kwargs):
140140
"""CrayPEGCC constructor."""
141141
super(CrayPEGCC, self).__init__(*args, **kwargs)
142-
for precflag in self.COMPILER_PREC_FLAGS:
142+
for precflag in self.COMPILER_PREC_OPTIONS:
143143
self.COMPILER_UNIQUE_OPTION_MAP[precflag] = Gcc.COMPILER_UNIQUE_OPTION_MAP[precflag]
144144

145145

@@ -151,7 +151,7 @@ class CrayPEIntel(CrayPECompiler):
151151
def __init__(self, *args, **kwargs):
152152
"""CrayPEIntel constructor."""
153153
super(CrayPEIntel, self).__init__(*args, **kwargs)
154-
for precflag in self.COMPILER_PREC_FLAGS:
154+
for precflag in self.COMPILER_PREC_OPTIONS:
155155
self.COMPILER_UNIQUE_OPTION_MAP[precflag] = IntelIccIfort.COMPILER_UNIQUE_OPTION_MAP[precflag]
156156

157157

@@ -164,7 +164,7 @@ def __init__(self, *args, **kwargs):
164164
"""CrayPEPGI constructor."""
165165
super(CrayPEPGI, self).__init__(*args, **kwargs)
166166
self.COMPILER_UNIQUE_OPTION_MAP['openmp'] = '-mp'
167-
for precflag in self.COMPILER_PREC_FLAGS:
167+
for precflag in self.COMPILER_PREC_OPTIONS:
168168
self.COMPILER_UNIQUE_OPTION_MAP[precflag] = Pgi.COMPILER_UNIQUE_OPTION_MAP[precflag]
169169

170170

@@ -177,5 +177,5 @@ def __init__(self, *args, **kwargs):
177177
"""CrayPEIntel constructor."""
178178
super(CrayPECray, self).__init__(*args, **kwargs)
179179
self.COMPILER_UNIQUE_OPTION_MAP['openmp'] = '-homp'
180-
for precflag in self.COMPILER_PREC_FLAGS:
180+
for precflag in self.COMPILER_PREC_OPTIONS:
181181
self.COMPILER_UNIQUE_OPTION_MAP[precflag] = []

easybuild/toolchains/compiler/gcc.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,12 @@ class Gcc(Compiler):
110110

111111
COMPILER_CC = 'gcc'
112112
COMPILER_CXX = 'g++'
113-
COMPILER_C_UNIQUE_FLAGS = []
113+
COMPILER_C_UNIQUE_OPTIONS = []
114114

115115
COMPILER_F77 = 'gfortran'
116116
COMPILER_F90 = 'gfortran'
117117
COMPILER_FC = 'gfortran'
118-
COMPILER_F_UNIQUE_FLAGS = ['-f2c']
118+
COMPILER_F_UNIQUE_OPTIONS = ['f2c']
119119

120120
LIB_MULTITHREAD = ['pthread']
121121
LIB_MATH = ['m']

easybuild/toolchains/compiler/inteliccifort.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,12 @@ class IntelIccIfort(Compiler):
8585

8686
COMPILER_CC = 'icc'
8787
COMPILER_CXX = 'icpc'
88-
COMPILER_C_UNIQUE_FLAGS = ['-intel-static', '-no-icc']
88+
COMPILER_C_UNIQUE_OPTIONS = ['intel-static', 'no-icc']
8989

9090
COMPILER_F77 = 'ifort'
9191
COMPILER_F90 = 'ifort'
9292
COMPILER_FC = 'ifort'
93-
COMPILER_F_UNIQUE_FLAGS = ['-intel-static']
93+
COMPILER_F_UNIQUE_OPTIONS = ['intel-static']
9494

9595
LINKER_TOGGLE_STATIC_DYNAMIC = {
9696
'static': '-Bstatic',

easybuild/tools/options.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ def override_options(self):
398398
"for example: 3.5,5.0,7.2", 'strlist', 'extend', None),
399399
'debug-lmod': ("Run Lmod modules tool commands in debug module", None, 'store_true', False),
400400
'default-opt-level': ("Specify default optimisation level", 'choice', 'store', DEFAULT_OPT_LEVEL,
401-
Compiler.COMPILER_OPT_FLAGS),
401+
Compiler.COMPILER_OPT_OPTIONS),
402402
'deprecated': ("Run pretending to be (future) version, to test removal of deprecated code.",
403403
None, 'store', None),
404404
'detect-loaded-modules': ("Detect loaded EasyBuild-generated modules, act accordingly; "

easybuild/tools/toolchain/compiler.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
from easybuild.tools.toolchain.constants import COMPILER_VARIABLES
3939
from easybuild.tools.toolchain.toolchain import Toolchain
4040

41-
# default optimization 'level' (see COMPILER_SHARED_OPTION_MAP/COMPILER_OPT_FLAGS)
41+
# default optimization 'level' (see COMPILER_SHARED_OPTION_MAP/COMPILER_OPT_OPTIONS)
4242
DEFAULT_OPT_LEVEL = 'defaultopt'
4343

4444
# 'GENERIC' can be used to enable generic compilation instead of optimized compilation (which is the default)
@@ -127,20 +127,20 @@ class Compiler(Toolchain):
127127
COMPILER_OPTIMAL_ARCHITECTURE_OPTION = None
128128
COMPILER_GENERIC_OPTION = None
129129

130-
COMPILER_FLAGS = ['debug', 'ieee', 'openmp', 'pic', 'shared', 'static', 'unroll', 'verbose'] # any compiler
131-
COMPILER_OPT_FLAGS = ['noopt', 'lowopt', DEFAULT_OPT_LEVEL, 'opt'] # optimisation args, ordered !
132-
COMPILER_PREC_FLAGS = ['strict', 'precise', 'defaultprec', 'loose', 'veryloose'] # precision flags, ordered !
130+
COMPILER_OPTIONS = ['debug', 'ieee', 'openmp', 'pic', 'shared', 'static', 'unroll', 'verbose'] # any compiler
131+
COMPILER_OPT_OPTIONS = ['noopt', 'lowopt', DEFAULT_OPT_LEVEL, 'opt'] # optimisation args, ordered !
132+
COMPILER_PREC_OPTIONS = ['strict', 'precise', 'defaultprec', 'loose', 'veryloose'] # precision flags, ordered !
133133

134134
COMPILER_CC = None
135135
COMPILER_CXX = None
136-
COMPILER_C_FLAGS = ['-cstd']
137-
COMPILER_C_UNIQUE_FLAGS = []
136+
COMPILER_C_OPTIONS = ['cstd']
137+
COMPILER_C_UNIQUE_OPTIONS = []
138138

139139
COMPILER_F77 = None
140140
COMPILER_F90 = None
141141
COMPILER_FC = None
142-
COMPILER_F_FLAGS = ['-i8', '-r8']
143-
COMPILER_F_UNIQUE_FLAGS = []
142+
COMPILER_F_OPTIONS = ['i8', 'r8']
143+
COMPILER_F_UNIQUE_OPTIONS = []
144144

145145
LINKER_TOGGLE_STATIC_DYNAMIC = None
146146
LINKER_TOGGLE_START_STOP_GROUP = {
@@ -245,20 +245,20 @@ def _set_compiler_vars(self):
245245
def _set_compiler_flags(self):
246246
"""Collect the flags set, and add them as variables too"""
247247

248-
flags = [self.options.option(x) for x in self.COMPILER_FLAGS if self.options.get(x, False)]
249-
cflags = [self.options.option(x) for x in self.COMPILER_C_FLAGS + self.COMPILER_C_UNIQUE_FLAGS
248+
flags = [self.options.option(x) for x in self.COMPILER_OPTIONS if self.options.get(x, False)]
249+
cflags = [self.options.option(x) for x in self.COMPILER_C_OPTIONS + self.COMPILER_C_UNIQUE_OPTIONS
250250
if self.options.get(x, False)]
251-
fflags = [self.options.option(x) for x in self.COMPILER_F_FLAGS + self.COMPILER_F_UNIQUE_FLAGS
251+
fflags = [self.options.option(x) for x in self.COMPILER_F_OPTIONS + self.COMPILER_F_UNIQUE_OPTIONS
252252
if self.options.get(x, False)]
253253

254254
# Allow a user-defined default optimisation
255255
default_opt_level = build_option('default_opt_level')
256-
if default_opt_level not in self.COMPILER_OPT_FLAGS:
256+
if default_opt_level not in self.COMPILER_OPT_OPTIONS:
257257
raise EasyBuildError("Unknown value for default optimisation: %s (possibilities are %s)" %
258-
(default_opt_level, self.COMPILER_OPT_FLAGS))
258+
(default_opt_level, self.COMPILER_OPT_OPTIONS))
259259

260260
# 1st one is the one to use. add default at the end so len is at least 1
261-
optflags = ([self.options.option(x) for x in self.COMPILER_OPT_FLAGS if self.options.get(x, False)] +
261+
optflags = ([self.options.option(x) for x in self.COMPILER_OPT_OPTIONS if self.options.get(x, False)] +
262262
[self.options.option(default_opt_level)])[:1]
263263

264264
# only apply if the vectorize toolchainopt is explicitly set
@@ -280,7 +280,7 @@ def _set_compiler_flags(self):
280280
elif self.options.get('optarch', False):
281281
optarchflags.append(self.options.option('optarch'))
282282

283-
precflags = [self.options.option(x) for x in self.COMPILER_PREC_FLAGS if self.options.get(x, False)] + \
283+
precflags = [self.options.option(x) for x in self.COMPILER_PREC_OPTION if self.options.get(x, False)] + \
284284
[self.options.option('defaultprec')]
285285

286286
self.variables.nextend('OPTFLAGS', optflags + optarchflags)

test/framework/toolchain.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -785,9 +785,9 @@ def test_optarch_aarch64_heuristic(self):
785785
def test_compiler_dependent_optarch(self):
786786
"""Test whether specifying optarch on a per compiler basis works."""
787787
flag_vars = ['CFLAGS', 'CXXFLAGS', 'FCFLAGS', 'FFLAGS', 'F90FLAGS']
788-
intel_options = [('intelflag', 'intelflag'), ('GENERIC', '-xSSE2'), ('', '')]
789-
gcc_options = [('gccflag', 'gccflag'), ('-march=nocona', '-march=nocona'), ('', '')]
790-
gcccore_options = [('gcccoreflag', 'gcccoreflag'), ('GENERIC', '-march=x86-64 -mtune=generic'), ('', '')]
788+
intel_options = [('intelflag', '-intelflag'), ('GENERIC', '-xSSE2'), ('', '')]
789+
gcc_options = [('gccflag', '-gccflag'), ('-march=nocona', '-march=nocona'), ('', '')]
790+
gcccore_options = [('gcccoreflag', '-gcccoreflag'), ('GENERIC', '-march=x86-64 -mtune=generic'), ('', '')]
791791

792792
tc_intel = ('iccifort', '2018.1.163')
793793
tc_gcc = ('GCC', '6.4.0-2.28')
@@ -1356,7 +1356,7 @@ def test_fft_env_vars_intel(self):
13561356
def test_fosscuda(self):
13571357
"""Test whether fosscuda is handled properly."""
13581358
tc = self.get_toolchain("fosscuda", version="2018a")
1359-
opts = {'cuda_gencode': ['arch=compute_35,code=sm_35', 'arch=compute_10,code=compute_10'], 'openmp': True}
1359+
opts = {'cuda_gencode': ['-arch=compute_35,code=sm_35', 'a-rch=compute_10,code=compute_10'], 'openmp': True}
13601360
tc.set_options(opts)
13611361
with self.mocked_stdout_stderr():
13621362
tc.prepare()

0 commit comments

Comments
 (0)