Skip to content

Commit 6521e3d

Browse files
committed
Use separate flag for container bounds checking so the SSC issue can be deferred
1 parent 4d3a8d6 commit 6521e3d

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

.decent_ci-Linux.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ compilers:
1010
- name: "gcc"
1111
version: "13.3"
1212
build_type: RelWithDebInfo
13-
cmake_extra_flags: -DLINK_WITH_PYTHON:BOOL=ON -DPYTHON_CLI:BOOL=OFF -DPython_REQUIRED_VERSION:STRING=3.12.2 -DPython_ROOT_DIR:PATH=~/.pyenv/versions/3.12.2/ -DBUILD_FORTRAN:BOOL=ON -DBUILD_TESTING:BOOL=ON -DENABLE_REGRESSION_TESTING:BOOL=OFF -DCOMMIT_SHA:STRING=$COMMIT_SHA -DENABLE_COVERAGE:BOOL=ON -DENABLE_GTEST_DEBUG_MODE:BOOL=OFF -DENABLE_PCH:BOOL=OFF -DFORCE_DEBUG_ARITHM_GCC_OR_CLANG:BOOL=ON
13+
cmake_extra_flags: -DLINK_WITH_PYTHON:BOOL=ON -DPYTHON_CLI:BOOL=OFF -DPython_REQUIRED_VERSION:STRING=3.12.2 -DPython_ROOT_DIR:PATH=~/.pyenv/versions/3.12.2/ -DBUILD_FORTRAN:BOOL=ON -DBUILD_TESTING:BOOL=ON -DENABLE_REGRESSION_TESTING:BOOL=OFF -DCOMMIT_SHA:STRING=$COMMIT_SHA -DENABLE_COVERAGE:BOOL=ON -DENABLE_GTEST_DEBUG_MODE:BOOL=OFF -DENABLE_PCH:BOOL=OFF -DFORCE_CONTAINER_CHECKS_GCC_OR_CLANG:BOOL=ON
1414
coverage_enabled: true
1515
coverage_base_dir: src/EnergyPlus
1616
coverage_pass_limit: 41.0
@@ -25,7 +25,7 @@ compilers:
2525
- name: "gcc"
2626
version: "13.3"
2727
build_type: RelWithDebInfo
28-
cmake_extra_flags: -DLINK_WITH_PYTHON:BOOL=ON -DPYTHON_CLI:BOOL=OFF -DPython_REQUIRED_VERSION:STRING=3.12.2 -DPython_ROOT_DIR:PATH=~/.pyenv/versions/3.12.2/ -DBUILD_FORTRAN:BOOL=ON -DBUILD_TESTING:BOOL=ON -DENABLE_REGRESSION_TESTING:BOOL=OFF -DCOMMIT_SHA:STRING=$COMMIT_SHA -DENABLE_COVERAGE:BOOL=ON -DENABLE_GTEST_DEBUG_MODE:BOOL=OFF -DENABLE_PCH:BOOL=OFF -DFORCE_DEBUG_ARITHM_GCC_OR_CLANG:BOOL=ON
28+
cmake_extra_flags: -DLINK_WITH_PYTHON:BOOL=ON -DPYTHON_CLI:BOOL=OFF -DPython_REQUIRED_VERSION:STRING=3.12.2 -DPython_ROOT_DIR:PATH=~/.pyenv/versions/3.12.2/ -DBUILD_FORTRAN:BOOL=ON -DBUILD_TESTING:BOOL=ON -DENABLE_REGRESSION_TESTING:BOOL=OFF -DCOMMIT_SHA:STRING=$COMMIT_SHA -DENABLE_COVERAGE:BOOL=ON -DENABLE_GTEST_DEBUG_MODE:BOOL=OFF -DENABLE_PCH:BOOL=OFF -DFORCE_CONTAINER_CHECKS_GCC_OR_CLANG:BOOL=ON
2929
coverage_enabled: true
3030
coverage_base_dir: src/EnergyPlus
3131
coverage_pass_limit: 66.0

cmake/CompilerFlags.cmake

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,10 @@ if(MSVC AND NOT ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")) # Visual C++ (VS
8888

8989
elseif(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang") # g++/Clang
9090

91+
option(FORCE_CONTAINER_CHECKS_GCC_OR_CLANG "Enable trapping for container issues in non-debug builds" OFF)
9192
option(FORCE_DEBUG_ARITHM_GCC_OR_CLANG "Enable trapping floating point exceptions in non Debug mode" OFF)
93+
94+
mark_as_advanced(FORCE_CONTAINER_CHECKS_GCC_OR_CLANG)
9295
mark_as_advanced(FORCE_DEBUG_ARITHM_GCC_OR_CLANG)
9396

9497
# COMPILER FLAGS
@@ -132,6 +135,7 @@ elseif(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" O
132135
endif()
133136

134137
set(need_arithm_debug_genex "$<OR:$<BOOL:${FORCE_DEBUG_ARITHM_GCC_OR_CLANG}>,$<CONFIG:Debug>>")
138+
set(need_container_debug_genex "$<OR:$<BOOL:${FORCE_CONTAINER_CHECKS_GCC_OR_CLANG}>,$<CONFIG:Debug>>")
135139

136140
# in main.cc for E+ (actual: api/EnergyPlusPgm.cc) and gtest: feenableexcept(FE_DIVBYZERO | FE_INVALID | FE_OVERFLOW)
137141
target_compile_definitions(project_fp_options INTERFACE $<${need_arithm_debug_genex}:DEBUG_ARITHM_GCC_OR_CLANG>)
@@ -146,7 +150,7 @@ elseif(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" O
146150
if(CMAKE_COMPILER_IS_GNUCXX) # g++
147151
target_compile_options(project_options INTERFACE $<${need_arithm_debug_genex}:-ffloat-store>) # Improve debug run solution stability
148152
target_compile_options(project_options INTERFACE $<${need_arithm_debug_genex}:-fsignaling-nans>) # Disable optimizations that may have concealed NaN behavior
149-
target_compile_definitions(project_options INTERFACE $<${need_arithm_debug_genex}:_GLIBCXX_DEBUG>) # Standard container debug mode (bounds checking, ...>)
153+
target_compile_definitions(project_options INTERFACE $<${need_container_debug_genex}:_GLIBCXX_DEBUG>) # Standard container debug mode (bounds checking, ...>)
150154
# ADD_CXX_RELEASE_DEFINITIONS("-finline-limit=2000") # More aggressive inlining This is causing unit test failures on Ubuntu 14.04
151155
else()
152156
#check_cxx_compiler_flag(<flag> <var>)

0 commit comments

Comments
 (0)