Skip to content

Fixing ICPC usage with modern cmake and wrappers #8629

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Installation/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -429,12 +429,12 @@ if("${CMAKE_CXX_COMPILER}" MATCHES "icl" OR "${CMAKE_CXX_COMPILER}" MATCHES
)
else()
message(
STATUS "Using Intel Compiler version 11 or later. Adding -fp-model strict"
STATUS "Using Intel Compiler version 11 or later. Adding -fp-model=strict"
)
if(WIN32)
uniquely_add_flags(CGAL_CXX_FLAGS "/fp:strict")
else()
uniquely_add_flags(CGAL_CXX_FLAGS "-fp-model strict")
uniquely_add_flags(CGAL_CXX_FLAGS "-fp-model=strict")
endif()
endif()
endif()
Expand Down
16 changes: 12 additions & 4 deletions Installation/cmake/modules/CGAL_SetupCGALDependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,19 @@ function(CGAL_setup_CGAL_flags target)
$<$<COMPILE_LANGUAGE:CXX>:/bigobj> # Use /bigobj by default
)
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Intel")
message( STATUS "Using Intel Compiler. Adding -fp-model strict" )
if(WIN32)
target_compile_options(${target} INTERFACE "/fp:strict")
# cuda knows how to deal with 'fp-model=strict' but not 'fp-model strict'
if(CMAKE_VERSION VERSION_LESS 3.3)
if(WIN32)
target_compile_options(${target} INTERFACE "/fp:strict")
else()
target_compile_options(${target} INTERFACE "-fp-model=strict")
endif()
else()
target_compile_options(${target} INTERFACE "-fp-model" "strict")
if(WIN32)
target_compile_options(${target} INTERFACE "$<$<COMPILE_LANGUAGE:CXX>:/fp:strict>")
else()
target_compile_options(${target} INTERFACE "$<$<COMPILE_LANGUAGE:CXX>:-fp-model=strict>")
endif()
endif()
elseif(CMAKE_CXX_COMPILER_ID MATCHES "SunPro")
message( STATUS "Using SunPro compiler, using STLPort 4." )
Expand Down
4 changes: 2 additions & 2 deletions Number_types/include/CGAL/Interval_nt.h
Original file line number Diff line number Diff line change
Expand Up @@ -285,9 +285,9 @@ class Interval_nt
// the 2 negations and we get wrong rounding.
typename Interval_nt<>::Internal_protector P;
CGAL_assertion_msg(-CGAL_IA_MUL(-1.1, 10.1) != CGAL_IA_MUL(1.1, 10.1),
"Wrong rounding: did you forget the -frounding-math option if you use GCC (or -fp-model strict for Intel)?");
"Wrong rounding: did you forget the -frounding-math option if you use GCC (or -fp-model=strict for Intel)?");
CGAL_assertion_msg(-CGAL_IA_DIV(-1., 10) != CGAL_IA_DIV(1., 10),
"Wrong rounding: did you forget the -frounding-math option if you use GCC (or -fp-model strict for Intel)?");
"Wrong rounding: did you forget the -frounding-math option if you use GCC (or -fp-model=strict for Intel)?");
}
};

Expand Down
Loading