From 98b87609f9fe8a48e356d701d96d28bd07468bf7 Mon Sep 17 00:00:00 2001 From: Ingmar Schoegl Date: Fri, 26 Nov 2021 10:02:29 -0600 Subject: [PATCH] [SCons] Change icc compilation options * -vec-report0 is deprecated * -diag-disable 1478 is not needed (has no effect) * `Wcheck` (perform compile-time code checking for certain code) is changed to to `Wall` (enable warning and error diagnostics) as most warnings are due to upstream issues in fmtlib * disable fast math optimization Beyond, fix CYTHON_FALLTHROUGH for icc --- SConstruct | 2 +- interfaces/cython/SConscript | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/SConstruct b/SConstruct index 81675cc86..6ec9fdcf7 100644 --- a/SConstruct +++ b/SConstruct @@ -212,7 +212,6 @@ config_options = [ optimization level.""", { "cl": "/MD /nologo /D_SCL_SECURE_NO_WARNINGS /D_CRT_SECURE_NO_WARNINGS", - "icc": "-vec-report0 -diag-disable 1478", "clang": "-fcolor-diagnostics", "default": "", }), @@ -443,6 +442,7 @@ config_options = [ "Additional compiler flags passed to the C/C++ compiler when 'optimize=yes'.", { "cl": "/O2", + "icc": "-O3 -fp-model precise", "icx": "-O3 -fp-model precise", # cannot assume finite math "gcc": "-O3 -Wno-inline", "default": "-O3", diff --git a/interfaces/cython/SConscript b/interfaces/cython/SConscript index 13bef59db..369e30a75 100644 --- a/interfaces/cython/SConscript +++ b/interfaces/cython/SConscript @@ -70,6 +70,9 @@ if ( if localenv["HAS_CLANG"] and py_version_short == parse_version("3.8"): localenv.Append(CXXFLAGS='-Wno-deprecated-declarations') +if "icc" in localenv["CC"]: + localenv.Append(CPPDEFINES={"CYTHON_FALLTHROUGH":" __attribute__((fallthrough))"}) + if localenv['OS'] == 'Darwin': localenv.Append(LINKFLAGS='-undefined dynamic_lookup') elif localenv['OS'] == 'Windows':