From 1acce0db7adb507a05063d6d348f64266ef01620 Mon Sep 17 00:00:00 2001 From: Markus Blatt Date: Wed, 17 Sep 2025 20:17:19 +0200 Subject: [PATCH 1/2] Fix quadmath problems on ppc64el with IEEE long double Completes fix of Debian bug #1114005 --- CMakeLists.txt | 4 +--- opm/models/common/energymodule.hh | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 866f552c25..1536179f35 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -371,12 +371,10 @@ macro (sources_hook) if(QuadMath_FOUND) get_target_property(qm_defs QuadMath::QuadMath INTERFACE_COMPILE_DEFINITIONS) list(APPEND qm_defs HAVE_QUAD=1) - get_target_property(qm_options QuadMath::QuadMath INTERFACE_COMPILE_OPTIONS) set_source_files_properties(opm/models/nonlinear/newtonmethodparams.cpp opm/models/utils/parametersystem.cpp opm/models/utils/simulatorutils.cpp - PROPERTIES COMPILE_DEFINITIONS "${qm_defs}" - COMPILE_OPTIONS "${qm_options}") + PROPERTIES COMPILE_DEFINITIONS "${qm_defs}") endif() endmacro (sources_hook) diff --git a/opm/models/common/energymodule.hh b/opm/models/common/energymodule.hh index 6cd5d70869..590c3f4914 100644 --- a/opm/models/common/energymodule.hh +++ b/opm/models/common/energymodule.hh @@ -289,7 +289,7 @@ public: } // make the weight of the temperature primary variable inversly proportional to its value - return std::max(1.0 / 1000, + return std::max(static_cast(1.0) / 1000, 1.0 / model.solution(/*timeIdx=*/0)[globalDofIdx][temperatureIdx]); } @@ -306,7 +306,7 @@ public: // approximate change of internal energy of 1kg of liquid water for a temperature // change of 30K - return 1.0 / (4.184e3 * 30.0); + return static_cast(1.0) / (4.184e3 * 30.0); } /*! From e05f91d68785019df0b15e2fa36953178ebee0be Mon Sep 17 00:00:00 2001 From: Markus Blatt Date: Thu, 25 Sep 2025 14:08:08 +0200 Subject: [PATCH 2/2] Fix compiler warning and DUNE 2.9/g++12 problem Similar to opm-common. We need the set to still set the flag --fext-numerical-literals --- CMakeLists.txt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1536179f35..ef08ba5190 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -370,11 +370,17 @@ macro (sources_hook) endif() if(QuadMath_FOUND) get_target_property(qm_defs QuadMath::QuadMath INTERFACE_COMPILE_DEFINITIONS) - list(APPEND qm_defs HAVE_QUAD=1) + get_target_property(qm_options QuadMath::QuadMath INTERFACE_COMPILE_OPTIONS) + if(qm_defs) + list(APPEND qm_defs HAVE_QUAD=1) + else() + set(qm_defs HAVE_QUAD=1) + endif() set_source_files_properties(opm/models/nonlinear/newtonmethodparams.cpp opm/models/utils/parametersystem.cpp opm/models/utils/simulatorutils.cpp - PROPERTIES COMPILE_DEFINITIONS "${qm_defs}") + PROPERTIES COMPILE_DEFINITIONS "${qm_defs}" + COMPILE_OPTIONS "${qm_options}") endif() endmacro (sources_hook)