Skip to content

Commit

Permalink
Merge pull request #1 from boegel/add-ieee-754-conformance-as-option
Browse files Browse the repository at this point in the history
make sure 'ieee' toolchain option is picked up, enhance test for precision options to also check for 'ieee'
  • Loading branch information
akesandgren authored Nov 3, 2016
2 parents 4c7ea33 + dd8d618 commit 7cb317e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
2 changes: 1 addition & 1 deletion easybuild/tools/toolchain/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ class Compiler(Toolchain):
COMPILER_OPTIMAL_ARCHITECTURE_OPTION = None
COMPILER_GENERIC_OPTION = None

COMPILER_FLAGS = ['debug', 'verbose', 'static', 'shared', 'openmp', 'pic', 'unroll'] # any compiler
COMPILER_FLAGS = ['debug', 'ieee', 'openmp', 'pic', 'shared', 'static', 'unroll', 'verbose'] # any compiler
COMPILER_OPT_FLAGS = ['noopt', 'lowopt', DEFAULT_OPT_LEVEL, 'opt'] # optimisation args, ordered !
COMPILER_PREC_FLAGS = ['strict', 'precise', 'defaultprec', 'loose', 'veryloose'] # precision flags, ordered !

Expand Down
24 changes: 14 additions & 10 deletions test/framework/toolchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,27 +364,31 @@ def test_precision_flags(self):

flag_vars = ['CFLAGS', 'CXXFLAGS', 'FCFLAGS', 'FFLAGS', 'F90FLAGS']

# check default precision flag
# check default precision: no specific flag for GCC
tc = self.get_toolchain("goalf", version="1.1.0-no-OFED")
tc.set_options({})
tc.prepare()
for var in flag_vars:
flags = tc.get_variable(var)
val = ' '.join(['-%s' % f for f in tc.COMPILER_UNIQUE_OPTION_MAP['defaultprec']])
self.assertTrue(val in flags)
self.assertEqual(os.getenv(var), "-O2 -march=native")

# check other precision flags
for opt in ['strict', 'precise', 'loose', 'veryloose']:
prec_flags = {
'ieee': "-mieee-fp -fno-trapping-math",
'strict': "-mieee-fp -mno-recip",
'precise': "-mno-recip",
'loose': "-mrecip -mno-ieee-fp",
'veryloose': "-mrecip=all -mno-ieee-fp",
}
for prec in prec_flags:
for enable in [True, False]:
tc = self.get_toolchain("goalf", version="1.1.0-no-OFED")
tc.set_options({opt: enable})
tc.set_options({prec: enable})
tc.prepare()
val = ' '.join(['-%s' % f for f in tc.COMPILER_UNIQUE_OPTION_MAP[opt]])
for var in flag_vars:
flags = tc.get_variable(var)
if enable:
self.assertTrue(val in flags)
self.assertEqual(os.getenv(var), "-O2 -march=native %s" % prec_flags[prec])
else:
self.assertTrue(val not in flags)
self.assertEqual(os.getenv(var), "-O2 -march=native")
self.modtool.purge()

def test_cgoolf_toolchain(self):
Expand Down

0 comments on commit 7cb317e

Please sign in to comment.