diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2021-12-24 16:34:43 +0100 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2021-12-24 16:36:23 +0100 |
| commit | 146374460ad244e009f23d6fd63aebc7edec3ecb (patch) | |
| tree | 76ef7179b6a09532c5fd75cab71f4ba1f74e54b2 /CMakeLists.txt | |
| parent | b385f2142a1ab4007d5771c5570d8406873846de (diff) | |
| download | PROJ-146374460ad244e009f23d6fd63aebc7edec3ecb.tar.gz PROJ-146374460ad244e009f23d6fd63aebc7edec3ecb.zip | |
Fix build with Intel C++ compiler
icx --version: Intel(R) oneAPI DPC++/C++ Compiler 2022.0.0 (2022.0.0.20211123)
Disable fast maths to:
- Fix warnings about std::isnan(), etc. being evaluated to false, due to
-ffast-math being enabled
- Fix failures in regression test suite
How to reproduce:
docker pull intel/oneapi-basekit
docker run --rm -it -v $HOME:$HOME intel/oneapi-basekit
apt update
apt install sqlite3 libsqlite3-dev libcurl4-gnutls-dev libtiff-dev
CC=icx CXX=icx cmake .. -DCMAKE_EXE_LINKER_FLAGS=/usr/lib/x86_64-linux-gnu/libstdc++.so.6
Diffstat (limited to 'CMakeLists.txt')
| -rw-r--r-- | CMakeLists.txt | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 744ee4c2..c1416fa9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -91,6 +91,13 @@ elseif("${CMAKE_C_COMPILER_ID}" STREQUAL "Intel") endif() endif() +if (CMAKE_CXX_COMPILER_ID STREQUAL "IntelLLVM") + # Intel CXX compiler based on clang defaults to -ffast-math, which + # breaks std::isinf(), std::isnan(), etc. + set(CMAKE_C_FLAGS ${CMAKE_C_FLAGS} -fno-fast-math) + set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} -fno-fast-math) +endif () + set(PROJ_C_WARN_FLAGS "${PROJ_C_WARN_FLAGS}" CACHE STRING "C flags used to compile PROJ targets") set(PROJ_CXX_WARN_FLAGS "${PROJ_CXX_WARN_FLAGS}" |
