Skip to content

Commit 4c7ea33

Browse files
committed
Add an toolchain compiler option for enforcing IEEE-754 conformance.
This very useful for building for instance LAPACK and ScaLAPACK which should be built to not trap on Nan/Inf/denormals since the code handles that internally.
1 parent a2e6645 commit 4c7ea33

4 files changed

Lines changed: 4 additions & 0 deletions

File tree

easybuild/toolchains/compiler/gcc.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ class Gcc(Compiler):
5757
'loop': ['ftree-switch-conversion', 'floop-interchange', 'floop-strip-mine', 'floop-block'],
5858
'lto': 'flto',
5959
'openmp': 'fopenmp',
60+
'ieee': ['mieee-fp', 'fno-trapping-math'],
6061
'strict': ['mieee-fp', 'mno-recip'],
6162
'precise':['mno-recip'],
6263
'defaultprec':[],

easybuild/toolchains/compiler/inteliccifort.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ class IntelIccIfort(Compiler):
5959
'r8': 'r8',
6060
'optarch': 'xHost',
6161
'openmp': 'fopenmp', # both -qopenmp/-fopenmp are valid for enabling OpenMP (-openmp is deprecated)
62+
'ieee': 'fltconsistency',
6263
'strict': ['fp-speculation=strict', 'fp-model strict'],
6364
'precise': ['fp-model precise'],
6465
'defaultprec': ['ftz', 'fp-speculation=safe', 'fp-model source'],

easybuild/toolchains/compiler/pgi.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ class Pgi(Compiler):
5959
'r8': 'r8',
6060
'optarch': '', # PGI by default generates code for the arch it is running on!
6161
'openmp': 'mp',
62+
'ieee': 'Kieee',
6263
'strict': ['Mnoflushz','Kieee'],
6364
'precise': ['Mnoflushz'],
6465
'defaultprec': ['Mflushz'],

easybuild/tools/toolchain/compiler.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ class Compiler(Toolchain):
6363
COMPILER_SHARED_OPTS = {
6464
'cciscxx': (False, "Use CC as CXX"), # also MPI
6565
'pic': (False, "Use PIC"), # also FFTW
66+
'ieee': (False, "Adhere to IEEE-754 rules"),
6667
'noopt': (False, "Disable compiler optimizations"),
6768
'lowopt': (False, "Low compiler optimizations"),
6869
DEFAULT_OPT_LEVEL: (False, "Default compiler optimizations"), # not set, but default

0 commit comments

Comments
 (0)