Skip to content

Commit 65d4008

Browse files
authored
Fixing ICPC usage with modern cmake and wrappers (#8629)
## Summary of Changes 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+ _Please use the following template to help us managing pull requests._ ## Release Management * Affected package(s): at least conan
2 parents 2fc2102 + 56f5721 commit 65d4008

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
@@ -429,12 +429,12 @@ if("${CMAKE_CXX_COMPILER}" MATCHES "icl" OR "${CMAKE_CXX_COMPILER}" MATCHES
429429
)
430430
else()
431431
message(
432-
STATUS "Using Intel Compiler version 11 or later. Adding -fp-model strict"
432+
STATUS "Using Intel Compiler version 11 or later. Adding -fp-model=strict"
433433
)
434434
if(WIN32)
435435
uniquely_add_flags(CGAL_CXX_FLAGS "/fp:strict")
436436
else()
437-
uniquely_add_flags(CGAL_CXX_FLAGS "-fp-model strict")
437+
uniquely_add_flags(CGAL_CXX_FLAGS "-fp-model=strict")
438438
endif()
439439
endif()
440440
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)