-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[RF] Fix debug build with C++14 #10263
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
Conversation
|
Starting build on |
|
To be honest, I don't understand what the compiler is doing here and what the standard mandates here, maybe @Axel-Naumann or @jalopezg-r00t can enlighten me here. Another "fix" that also appears to works: diff --git a/roofit/roofitcore/src/RooNLLVarNew.cxx b/roofit/roofitcore/src/RooNLLVarNew.cxx
index 0a810d1a4b..6922d6151f 100644
--- a/roofit/roofitcore/src/RooNLLVarNew.cxx
+++ b/roofit/roofitcore/src/RooNLLVarNew.cxx
@@ -40,6 +40,8 @@ functions from `RooBatchCompute` library to provide faster computation times.
using namespace ROOT::Experimental;
+constexpr const char *RooNLLVarNew::weightVarName;
+
namespace {
std::unique_ptr<RooAbsReal> createRangeNormTerm(RooAbsPdf const &pdf, RooArgSet const &observables,Which looks odd for |
|
Hi, thanks for this fix! Good that you found a quick arcane solution 👍 Please also add a line with a comment explaining why |
That doesn't help at all, you can introduce this issue in any place you use these |
Even if |
Ok then let's use the As for the [1] https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rr-make_unique |
This guideline entry talks about construction, ie |
|
I don't see why the same reasons of being more concise and ensuring exception safety should not apply in this case. And move assignment and move construction of unique pointers should be equally cheap, right? |
|
There is no issue of exception safety here, it's only a
With compiler optimizations yes, but why create unnecessary work? |
|
RooFit is never used without optimization flags, and I want to avoid calling |
Commit ff86c30 ("[RF] Implement SumW2 correction in new BatchMode with RooFitDriver") introduced some static constexpr. When building with C++14, at least weightVarName requires a declaration because it is odr-used. Provide them for all three variables to avoid undefined references seen in debug builds without compiler optimizations.
|
Starting build on |
Done. |
|
Build failed on ROOT-ubuntu2004/soversion. Failing tests: |
|
Build failed on ROOT-ubuntu16/nortcxxmod. Failing tests: |
|
Build failed on ROOT-performance-centos8-multicore/default. Failing tests: |
guitargeek
left a comment
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.
LGTM, thank you it's perfect now 👍
Can you merge this soon? Maybe don't worry about the backport this time, because the original commit that this PR is a fixup to is not backported yet. I'll backport everything in one go to not have an intermediate state where the debug build is broken.
Commit ff86c30 ("[RF] Implement SumW2 correction in new BatchMode with RooFitDriver") introduced some
static constexpr. When building with C++14, at leastweightVarNamerequires a declaration because it is odr-used. Provide them for all three variables to avoid undefined references seen in debug builds without compiler optimizations.