Roottest crashes when being built as part of ROOT


ROOT Version: master branch at commit f403d6794ae542c2e06bfbb1d1fcdbc2c2e26659
Platform: Linux 5.4 (Manjaro)
Compiler: GCC 9.3.0


When trying to build ROOT with flags testing and roottest enabled (no other flags manually enabled), I get the following build error -

[100%] Building CXX object roottest/root/roofitstats/vectorisedPDFs/CMakeFiles/testGauss.dir/testGauss.cxx.o
/home/reik/root/roottest/root/roofitstats/vectorisedPDFs/testGauss.cxx: In constructor ‘TestGaussWithFormulaParameters::TestGaussWithFormulaParameters()’:
/home/reik/root/roottest/root/roofitstats/vectorisedPDFs/testGauss.cxx:132:82: error: invalid use of incomplete type ‘class RooFormulaVar’
  132 |       auto mean = new RooFormulaVar("mean", "mean", "a1+a2", RooArgList(*a1, *a2));
      |                                                                                  ^
In file included from /home/reik/root/root-build/include/RooAbsReal.h:24,
                 from /home/reik/root/root-build/include/RooAbsRealLValue.h:23,
                 from /home/reik/root/root-build/include/RooRealVar.h:25,
                 from /home/reik/root/roottest/root/roofitstats/vectorisedPDFs/VectorisedPDFTests.h:18,
                 from /home/reik/root/roottest/root/roofitstats/vectorisedPDFs/testGauss.cxx:17:
/home/reik/root/root-build/include/RooGlobalFunc.h:34:7: note: forward declaration of ‘class RooFormulaVar’
   34 | class RooFormulaVar ;
      |       ^~~~~~~~~~~~~
/home/reik/root/roottest/root/roofitstats/vectorisedPDFs/testGauss.cxx:133:85: error: invalid use of incomplete type ‘class RooFormulaVar’
  133 |       auto sigma = new RooFormulaVar("sigma", "sigma", "1.7*mean", RooArgList(*mean));
      |                                                                                     ^
In file included from /home/reik/root/root-build/include/RooAbsReal.h:24,
                 from /home/reik/root/root-build/include/RooAbsRealLValue.h:23,
                 from /home/reik/root/root-build/include/RooRealVar.h:25,
                 from /home/reik/root/roottest/root/roofitstats/vectorisedPDFs/VectorisedPDFTests.h:18,
                 from /home/reik/root/roottest/root/roofitstats/vectorisedPDFs/testGauss.cxx:17:
/home/reik/root/root-build/include/RooGlobalFunc.h:34:7: note: forward declaration of ‘class RooFormulaVar’
   34 | class RooFormulaVar ;
      |       ^~~~~~~~~~~~~
make[2]: *** [roottest/root/roofitstats/vectorisedPDFs/CMakeFiles/testGauss.dir/build.make:80: roottest/root/roofitstats/vectorisedPDFs/CMakeFiles/testGauss.dir/testGauss.cxx.o] Error 1
make[2]: Leaving directory '/home/reik/root/root-build'
make[1]: *** [CMakeFiles/Makefile2:56114: roottest/root/roofitstats/vectorisedPDFs/CMakeFiles/testGauss.dir/all] Error 2
make[1]: Leaving directory '/home/reik/root/root-build'
make: *** [Makefile:180: all] Error 2

Weird… Maybe @StephanH could help

Hi @Reik,

that looks like if RooFormulaVar wasn’t included in the test file. I can see it in my code, so what version of roottest are you using? Does it maybe need updating?

I am on ROOT master HEAD(and building roottest as part of root) - do I need to clone/update roottest separately?

Let’s say that we clone it separately, yes. It is a separate project after all.
I could imagine that it got cloned automatically the first time that you set up ROOT, but then it never updated. It could be sufficient that you cd into your roottest, and git fetch && git rebase.

That worked. Thanks!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.