From eff2458042246830fe35feec38c240a86a282d0a Mon Sep 17 00:00:00 2001 From: Ouadie EL FAROUKI Date: Mon, 4 Mar 2024 13:40:34 +0000 Subject: [PATCH] Rectified fix for icpx error with benchmarks (#503) Updated Wno-error fix for benchmarks with icpx to cover googlebench subdirectory --- benchmark/CMakeLists.txt | 10 ++++++++++ benchmark/portblas/CMakeLists.txt | 9 --------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/benchmark/CMakeLists.txt b/benchmark/CMakeLists.txt index 1d4f1fa83..bc93270b2 100644 --- a/benchmark/CMakeLists.txt +++ b/benchmark/CMakeLists.txt @@ -55,6 +55,16 @@ endif() # set BENCHMARK_ENABLE_TESTING to OFF for google bench set(BENCHMARK_ENABLE_TESTING OFF CACHE BOOL "" FORCE) +# update CXX_FLAGS to avoid error when building benchmarks +# in case of icpx compiler: +# Explicit comparison with NaN in fast floating point mode +# [-Werror,-Wtautological-constant-compare] +# https://github.com/dealii/dealii/issues/14693 +string(FIND ${CMAKE_CXX_COMPILER} "icpx" found_icpx) +if(${found_icpx} GREATER -1) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error=tautological-constant-compare") +endif() + add_subdirectory(${CMAKE_CURRENT_BINARY_DIR}/googlebench-src ${CMAKE_CURRENT_BINARY_DIR}/googlebench-build EXCLUDE_FROM_ALL) diff --git a/benchmark/portblas/CMakeLists.txt b/benchmark/portblas/CMakeLists.txt index 0da461aba..8bf2c3164 100644 --- a/benchmark/portblas/CMakeLists.txt +++ b/benchmark/portblas/CMakeLists.txt @@ -26,15 +26,6 @@ if(BLAS_VERIFY_BENCHMARK) find_package(SystemBLAS REQUIRED) endif() -# update CXX_FLAGS to avoid error when building benchmarks -# in case of icpx compiler: -# explicit comparison with NaN in fast floating point mode [-Werror,-Wtautological-constant-compare] -# https://github.com/dealii/dealii/issues/14693 -string(FIND ${CMAKE_CXX_COMPILER} "icpx" found_icpx) -if(${found_icpx} GREATER -1) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error=tautological-constant-compare") -endif() - set(sources # Level 1 blas blas1/axpy.cpp