-
Notifications
You must be signed in to change notification settings - Fork 398
Commit
…DEBUG_ARITHM_MSVC` to enable in release builds too
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -76,15 +76,19 @@ if(MSVC AND NOT ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")) # Visual C++ (VS | |
target_compile_options(project_options INTERFACE $<$<CONFIG:Debug>:/Ob0>) # Disable inlining | ||
target_compile_options(project_options INTERFACE $<$<CONFIG:Debug>:/RTCsu>) # Runtime checks | ||
target_compile_options(project_fp_options INTERFACE $<$<CONFIG:Debug>:/fp:strict>) # Floating point model | ||
target_compile_options(project_options INTERFACE $<$<CONFIG:Debug>:/DMSVC_DEBUG>) # Triggers code in main.cc to catch floating point NaNs | ||
|
||
target_compile_options(turn_off_warnings INTERFACE /W0) | ||
|
||
option(FORCE_DEBUG_ARITHM_MSVC "Enable trapping floating point exceptions in non Debug mode" OFF) | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
rraustad
Contributor
|
||
mark_as_advanced(FORCE_DEBUG_ARITHM_MSVC) | ||
|
||
set(need_arithm_debug_genex "$<OR:$<BOOL:${FORCE_DEBUG_ARITHM_MSVC}>,$<CONFIG:Debug>>") | ||
|
||
# in main.cc for E+ (actual: api/EnergyPlusPgm.cc) and gtest: will catch _EM_ZERODIVIDE | _EM_INVALID | _EM_OVERFLOW | ||
target_compile_definitions(project_fp_options INTERFACE $<${need_arithm_debug_genex}:DEBUG_ARITHM_MSVC>) | ||
|
||
elseif(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang") # g++/Clang | ||
|
||
# TODO: after we fix all test, enable this by default on Debug builds | ||
# option(FORCE_DEBUG_ARITHM_GCC_OR_CLANG "Enable trapping floating point exceptions in non Debug mode" OFF) | ||
option(FORCE_DEBUG_ARITHM_GCC_OR_CLANG "Enable trapping floating point exceptions" OFF) | ||
option(FORCE_DEBUG_ARITHM_GCC_OR_CLANG "Enable trapping floating point exceptions in non Debug mode" OFF) | ||
mark_as_advanced(FORCE_DEBUG_ARITHM_GCC_OR_CLANG) | ||
|
||
# COMPILER FLAGS | ||
|
@@ -126,7 +130,7 @@ elseif(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" O | |
|
||
set(need_arithm_debug_genex "$<OR:$<BOOL:${FORCE_DEBUG_ARITHM_GCC_OR_CLANG}>,$<CONFIG:Debug>>") | ||
|
||
# in main.cc for E+ and gtest: feenableexcept(FE_DIVBYZERO | FE_INVALID | FE_OVERFLOW) | ||
# in main.cc for E+ (actual: api/EnergyPlusPgm.cc) and gtest: feenableexcept(FE_DIVBYZERO | FE_INVALID | FE_OVERFLOW) | ||
target_compile_definitions(project_fp_options INTERFACE $<${need_arithm_debug_genex}:DEBUG_ARITHM_GCC_OR_CLANG>) | ||
include(CheckCXXSymbolExists) | ||
check_cxx_symbol_exists(feenableexcept "fenv.h" HAVE_FEENABLEEXCEPT) | ||
|
4 comments
on commit 64018cf
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
catch_fe_exceptions_release_msvc_and_gtest (jmarrec) - x86_64-Linux-Ubuntu-22.04-gcc-11.4: OK (3575 of 3695 tests passed, 473 test warnings)
Messages:\n
- 593 tests had: AUD diffs.
- 563 tests had: EIO diffs.
- 283 tests had: RDD diffs.
- 123 tests had: Table small diffs.
- 120 tests had: Table big diffs.
- 2 tests had: ESO small diffs.
- 1 test had: MTR small diffs.
- 1 test had: MTD diffs.
- 1 test had: ERR diffs.
Failures:\n
regression Test Summary
- Passed: 691
- Failed: 120
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
catch_fe_exceptions_release_msvc_and_gtest (jmarrec) - x86_64-MacOS-10.18-clang-15.0.0: OK (3534 of 3654 tests passed, 472 test warnings)
Messages:\n
- 592 tests had: AUD diffs.
- 562 tests had: EIO diffs.
- 283 tests had: RDD diffs.
- 123 tests had: Table small diffs.
- 120 tests had: Table big diffs.
- 2 tests had: ESO small diffs.
- 1 test had: MTR small diffs.
- 1 test had: MTD diffs.
- 1 test had: ERR diffs.
Failures:\n
regression Test Summary
- Passed: 671
- Failed: 120
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I turn on this switch in CMake and get this error. I added the path to the Python libs folder and still get the error. I am not linking with Python.