Skip to content

Commit e31c495

Browse files
author
mbarbier
committed
Fixing ICPC usage with modern cmake and wrappers
Related to conan's conan-io/conan-center-index#25843 replaced 'fp-model strict' by 'fp-model=strict' https://www.intel.com/content/www/us/en/docs/cpp-compiler/developer-guide-reference/2021-8/fp-model-fp.html for more compatibility with nvcc. as 'fp-model=strict' will be directly transmited to the compiler while 'fp-model strict' will have 'strict' being treated as a file input. Also added a CXX only filter for newer cmake 3.3+
1 parent 98c9444 commit e31c495

File tree

3 files changed

+16
-8
lines changed

3 files changed

+16
-8
lines changed

Installation/CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -433,12 +433,12 @@ if("${CMAKE_CXX_COMPILER}" MATCHES "icl" OR "${CMAKE_CXX_COMPILER}" MATCHES
433433
)
434434
else()
435435
message(
436-
STATUS "Using Intel Compiler version 11 or later. Adding -fp-model strict"
436+
STATUS "Using Intel Compiler version 11 or later. Adding -fp-model=strict"
437437
)
438438
if(WIN32)
439439
uniquely_add_flags(CGAL_CXX_FLAGS "/fp:strict")
440440
else()
441-
uniquely_add_flags(CGAL_CXX_FLAGS "-fp-model strict")
441+
uniquely_add_flags(CGAL_CXX_FLAGS "-fp-model=strict")
442442
endif()
443443
endif()
444444
endif()

Installation/cmake/modules/CGAL_SetupCGALDependencies.cmake

+12-4
Original file line numberDiff line numberDiff line change
@@ -132,11 +132,19 @@ function(CGAL_setup_CGAL_flags target)
132132
$<$<COMPILE_LANGUAGE:CXX>:/bigobj> # Use /bigobj by default
133133
)
134134
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Intel")
135-
message( STATUS "Using Intel Compiler. Adding -fp-model strict" )
136-
if(WIN32)
137-
target_compile_options(${target} INTERFACE "/fp:strict")
135+
# cuda knows how to deal with 'fp-model=strict' but not 'fp-model strict'
136+
if(CMAKE_VERSION VERSION_LESS 3.3)
137+
if(WIN32)
138+
target_compile_options(${target} INTERFACE "/fp:strict")
139+
else()
140+
target_compile_options(${target} INTERFACE "-fp-model=strict")
141+
endif()
138142
else()
139-
target_compile_options(${target} INTERFACE "-fp-model" "strict")
143+
if(WIN32)
144+
target_compile_options(${target} INTERFACE "$<$<COMPILE_LANGUAGE:CXX>:/fp:strict>")
145+
else()
146+
target_compile_options(${target} INTERFACE "$<$<COMPILE_LANGUAGE:CXX>:-fp-model=strict>")
147+
endif()
140148
endif()
141149
elseif(CMAKE_CXX_COMPILER_ID MATCHES "SunPro")
142150
message( STATUS "Using SunPro compiler, using STLPort 4." )

Number_types/include/CGAL/Interval_nt.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -285,9 +285,9 @@ class Interval_nt
285285
// the 2 negations and we get wrong rounding.
286286
typename Interval_nt<>::Internal_protector P;
287287
CGAL_assertion_msg(-CGAL_IA_MUL(-1.1, 10.1) != CGAL_IA_MUL(1.1, 10.1),
288-
"Wrong rounding: did you forget the -frounding-math option if you use GCC (or -fp-model strict for Intel)?");
288+
"Wrong rounding: did you forget the -frounding-math option if you use GCC (or -fp-model=strict for Intel)?");
289289
CGAL_assertion_msg(-CGAL_IA_DIV(-1., 10) != CGAL_IA_DIV(1., 10),
290-
"Wrong rounding: did you forget the -frounding-math option if you use GCC (or -fp-model strict for Intel)?");
290+
"Wrong rounding: did you forget the -frounding-math option if you use GCC (or -fp-model=strict for Intel)?");
291291
}
292292
};
293293

0 commit comments

Comments
 (0)