From 616cc28d82da8981b853cccf365439905f8efdba Mon Sep 17 00:00:00 2001 From: Martin Kroeker Date: Sun, 26 May 2024 12:59:11 +0200 Subject: [PATCH 1/2] Override icx's default fast math mode to ensure correct NaN handling --- Makefile.x86_64 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Makefile.x86_64 b/Makefile.x86_64 index c0dbe84c8..e9831327f 100644 --- a/Makefile.x86_64 +++ b/Makefile.x86_64 @@ -8,6 +8,11 @@ endif endif endif +ifeq ($(C_COMPILER), CLANG) +ifeq ($(findstring icx,$(CC)),icx) +CCOMMON_OPT += -fp-model=consistent +endif +endif ifneq ($(DYNAMIC_ARCH),1) ADD_CPUFLAGS = 1 From 8b4996a2d59f554d5aafe14332aa0582c203a6d6 Mon Sep 17 00:00:00 2001 From: Martin Kroeker Date: Sun, 26 May 2024 13:16:03 +0200 Subject: [PATCH 2/2] Override icx's default fast math mode to ensure correct NaN handling --- cmake/cc.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmake/cc.cmake b/cmake/cc.cmake index a162986f8..9dce9ea35 100644 --- a/cmake/cc.cmake +++ b/cmake/cc.cmake @@ -4,6 +4,10 @@ ## Sets C related variables. include(CheckCCompilerFlag) +if (${CMAKE_C_COMPILER_ID} MATCHES "IntelLLVM") + set(CCOMMON_OPT "${CCOMMON_OPT} -fp-model=consistent") +endif () + if (${CMAKE_C_COMPILER_ID} STREQUAL "GNU" OR ${CMAKE_C_COMPILER_ID} STREQUAL "LSB" OR ${CMAKE_C_COMPILER_ID} MATCHES "Clang") set(CCOMMON_OPT "${CCOMMON_OPT} -Wall") set(COMMON_PROF "${COMMON_PROF} -fno-inline")