Skip to content

#14654 Fix Linux Release build defining NO_DEBUG instead of NDEBUG - #14744

Open
magnesj wants to merge 3 commits into
OPM:devfrom
magnesj:14654-fix-linux-release-ndebug
Open

#14654 Fix Linux Release build defining NO_DEBUG instead of NDEBUG#14744
magnesj wants to merge 3 commits into
OPM:devfrom
magnesj:14654-fix-linux-release-ndebug

Conversation

@magnesj

@magnesj magnesj commented Sep 13, 2026

Copy link
Copy Markdown
Member

Fixes #14654

CMAKE_CXX_FLAGS_RELEASE was overwritten with -O2 -DNO_DEBUG on Linux in both CMakeLists.txt and Fwk/CMakeLists.txt. NO_DEBUG is not a standard macro, so NDEBUG was never defined in Linux Release builds.

As a result, cafAssert.h fell back to CAF_ENABLE_ASSERTS 1, keeping CAF_ASSERT (and standard assert()) active in Release, aborting the app even though RESINSIGHT_ENABLE_ASSERTS_IN_RELEASE defaults to OFF. Windows and macOS Release builds were unaffected.

Dropped the override entirely, so CMake supplies its default Release flags (-O3 -DNDEBUG) on Linux, matching Windows and macOS.

Note: this may surface a separate, currently-masked issue with a failing CAF_ASSERT in AppEnumMapperBase::addItem (AppEnum alias duplication), which should be diagnosed separately, per the issue notes.

@magnesj
magnesj force-pushed the 14654-fix-linux-release-ndebug branch from 0852685 to 5d00a0b Compare September 13, 2026 05:53
CMAKE_CXX_FLAGS_RELEASE was overwritten with -DNO_DEBUG on Linux in
both CMakeLists.txt and Fwk/CMakeLists.txt. NO_DEBUG is not a standard
macro, so NDEBUG was never defined in Linux Release builds.

As a result, cafAssert.h fell back to CAF_ENABLE_ASSERTS 1, keeping
CAF_ASSERT (and standard assert()) active in Release and aborting the
app, even though RESINSIGHT_ENABLE_ASSERTS_IN_RELEASE defaults to OFF.
Windows and macOS Release builds were unaffected.

Drop the override entirely so CMake supplies its default Release
flags (-O3 -DNDEBUG) on Linux, matching Windows and macOS.

Also simplify CEE_USE_QT5/CEE_USE_QT6 handling: set them directly
instead of via option() with malformed NOT DEFINED(...) guards.
@magnesj
magnesj force-pushed the 14654-fix-linux-release-ndebug branch from 5d00a0b to e2953dd Compare September 13, 2026 05:54
…elease build failure

Default-initialize the double members of VfpValueSelection to 0.0.
computeValueSelectionCombinations() in RimCustomVfpPlot.cpp only sets
the fields corresponding to non-family production variables, leaving
the family variable's field unset. With -O3 now enabled on Linux
Release builds (after removing the NO_DEBUG/NDEBUG flag override),
GCC's -Werror=maybe-uninitialized flags this as an error.
…export

WellPathCellIntersectionInfo has no default member initializers, and filterIntersections() only assigned intersectedCellFaceOut inside the if/else-if pair. When both faces of the first intersection are NO_FACE, the member was copied into the result vector while indeterminate. GCC detects this at -O3 and the Linux Release build failed with -Werror=maybe-uninitialized.
@magnesj
magnesj force-pushed the 14654-fix-linux-release-ndebug branch from 6b382a4 to 1016b9b Compare September 13, 2026 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Linux Release defines NO_DEBUG instead of NDEBUG, keeping CAF_ASSERT active

1 participant