From 76ec29f832083ef95c56afbd1e11fc29856a0770 Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Thu, 12 May 2022 17:59:35 +0200 Subject: [PATCH] Fix build with Eigen3 and Imtel compiler. --- tools/cmake/Flags.cmake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/cmake/Flags.cmake b/tools/cmake/Flags.cmake index 5afc1f0837..de55de01d4 100644 --- a/tools/cmake/Flags.cmake +++ b/tools/cmake/Flags.cmake @@ -191,7 +191,8 @@ endif() if (CMAKE_C_COMPILER_ID MATCHES "Intel") # honor parentheses when determining the order of expression evaluation. - set(optCFLAGS "${optCFLAGS} -fprotect-parens ") + # disallow optimizations for floating-point arithmetic with Nans or +-Infs (breaks Eigen3) + set(optCFLAGS "${optCFLAGS} -fprotect-parens -fno-finite-math-only") endif() if(NOT enable_debug) -- 2.20.1