Skip to content

Commit 46db606

Browse files
committed
[RF] Fix debug build
Commit ff86c30 ("[RF] Implement SumW2 correction in new BatchMode with RooFitDriver") introduced some static constexpr. When building without compiler optimizations, the build fails with an "undefined reference to ROOT::Experimental::RooNLLVarNew::weightVarName" because the compiler attempts to use the external symbol of that variable when passing to a reference of a pointer. Resolve the issue by calling the constructor directly instead of std::make_unique.
1 parent 4d1d7c3 commit 46db606

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

roofit/roofitcore/src/BatchModeHelpers.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ RooFit::BatchModeHelpers::createNLL(RooAbsPdf &pdf, RooAbsData &data, std::uniqu
9595
if (data.isWeighted()) {
9696
// RooRealVar for the weight value (or values as a batch) that will
9797
// participate in the computation graph of the RooFit driver.
98-
weightVar = std::make_unique<RooRealVar>(RooNLLVarNew::weightVarName, "Weight(s) of events", data.weight());
98+
weightVar.reset(new RooRealVar(RooNLLVarNew::weightVarName, "Weight(s) of events", data.weight()));
9999
}
100100

101101
// Deal with the IntegrateBins argument

0 commit comments

Comments
 (0)