From 9f7ca05b71bc9705fc7e55f95784440bd04831df Mon Sep 17 00:00:00 2001 From: Ingmar Schoegl Date: Mon, 6 Dec 2021 17:57:11 -0600 Subject: [PATCH] [SCons] Enable optimized icx compilation Co-authored-by: @tpg2114 Optimized compilation works if options include '-fp-model strict' (or 'precise'). Segfaults can be reproduced with gcc if option '-ffinite-math-only' is selected. --- SConstruct | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/SConstruct b/SConstruct index b9396892c..81675cc86 100644 --- a/SConstruct +++ b/SConstruct @@ -437,11 +437,16 @@ config_options = [ """Enable extra compiler optimizations specified by the 'optimize_flags' variable, instead of the flags specified by the 'no_optimize_flags' variable.""", - {"icx": False, "default": True}), + True), Option( "optimize_flags", "Additional compiler flags passed to the C/C++ compiler when 'optimize=yes'.", - {"cl": "/O2", "gcc": "-O3 -Wno-inline", "default": "-O3"}), + { + "cl": "/O2", + "icx": "-O3 -fp-model precise", # cannot assume finite math + "gcc": "-O3 -Wno-inline", + "default": "-O3", + }), Option( "no_optimize_flags", "Additional compiler flags passed to the C/C++ compiler when 'optimize=no'.", @@ -473,7 +478,6 @@ config_options = [ of Cantera (for example, excluding code in the 'ext' directory).""", { "cl": "/W3", - "icx": "-Wall -Wno-tautological-constant-compare", "default": "-Wall", }), Option(