Skip to content

[CMake] Existing ROOT headers from the system might be picked up when compiling ROOT #13101

Closed
@ynikitenko

Description

@ynikitenko

Check duplicate issues.

  • Checked for duplicates

Description

Can't install RooFit because of RooJSON.

/opt/root/src/roofit/hs3/src/JSONFactories_RooFitCore.cxx: In member function ‘virtual bool {anonymous}::RooExpPolyStreamer::exportObject(RooJSONFactoryWSTool*, const RooAbsArg*, RooFit::Detail::JSONNode&) const’:
/opt/root/src/roofit/hs3/src/JSONFactories_RooFitCore.cxx:448:25: error: ‘const class RooExpPoly’ has no member named ‘x’; did you mean ‘RooRealProxy RooExpPoly::_x’? (not accessible from this context)
  448 |       elem["x"] << pdf->x().GetName();
      |                         ^
In file included from /opt/root/src/roofit/hs3/src/JSONFactories_RooFitCore.cxx:20:
/opt/root/install/include/RooExpPoly.h:37:17: note: declared protected here
   37 |    RooRealProxy _x;
      |                 ^~
/opt/root/src/roofit/hs3/src/JSONFactories_RooFitCore.cxx:453:32: error: ‘const class RooExpPoly’ has no member named ‘lowestOrder’; did you mean ‘int RooExpPoly::_lowestOrder’? (not accessible from this context)
  453 |       for (int i = 0; i < pdf->lowestOrder(); ++i) {
      |                                ^~~~~~~~~~~
/opt/root/install/include/RooExpPoly.h:39:8: note: declared protected here
   39 |    int _lowestOrder;
      |        ^~~~~~~~~~~~
/opt/root/src/roofit/hs3/src/JSONFactories_RooFitCore.cxx:456:36: error: ‘const class RooExpPoly’ has no member named ‘coefList’; did you mean ‘RooListProxy RooExpPoly::_coefList’? (not accessible from this context)
  456 |       for (const auto &coef : pdf->coefList()) {
      |                                    ^~~~~~~~
/opt/root/install/include/RooExpPoly.h:38:17: note: declared protected here
   38 |    RooListProxy _coefList;
      |                 ^~~~~~~~~
make[2]: *** [roofit/hs3/CMakeFiles/RooFitHS3.dir/build.make:132: roofit/hs3/CMakeFiles/RooFitHS3.dir/src/JSONFactories_RooFitCore.cxx.o] Error 1

Tried to change method names to those with underscores, got another error about a protected field:

/opt/root/src/roofit/hs3/src/JSONFactories_RooFitCore.cxx: In member function ‘virtual bool {anonymous}::RooExpPolyStreamer::exportObject(RooJSONFactoryWSTool*, const RooAbsArg*, RooFit::Detail::JSONNode&) const’:
/opt/root/src/roofit/hs3/src/JSONFactories_RooFitCore.cxx:448:25: error: ‘RooRealProxy RooExpPoly::_x’ is protected within this context
  448 |       elem["x"] << pdf->_x().GetName();
      |                         ^~
In file included from /opt/root/src/roofit/hs3/src/JSONFactories_RooFitCore.cxx:20:
/opt/root/install/include/RooExpPoly.h:37:17: note: declared protected here
   37 |    RooRealProxy _x;
      |                 ^~
/opt/root/src/roofit/hs3/src/JSONFactories_RooFitCore.cxx:448:27: error: no match for call to ‘(const RooRealProxy {aka const RooTemplateProxy<RooAbsReal>}) ()’
  448 |       elem["x"] << pdf->_x().GetName();
      |                    ~~~~~~~^~
/opt/root/src/roofit/hs3/src/JSONFactories_RooFitCore.cxx:453:32: error: ‘int RooExpPoly::_lowestOrder’ is protected within this context
  453 |       for (int i = 0; i < pdf->_lowestOrder(); ++i) {
      |                                ^~~~~~~~~~~~
/opt/root/install/include/RooExpPoly.h:39:8: note: declared protected here
   39 |    int _lowestOrder;
      |        ^~~~~~~~~~~~
/opt/root/src/roofit/hs3/src/JSONFactories_RooFitCore.cxx:453:44: error: expression cannot be used as a function
  453 |       for (int i = 0; i < pdf->_lowestOrder(); ++i) {
      |                           ~~~~~~~~~~~~~~~~~^~
/opt/root/src/roofit/hs3/src/JSONFactories_RooFitCore.cxx:456:36: error: ‘RooListProxy RooExpPoly::_coefList’ is protected within this context
  456 |       for (const auto &coef : pdf->_coefList()) {
      |                                    ^~~~~~~~~
/opt/root/install/include/RooExpPoly.h:38:17: note: declared protected here
   38 |    RooListProxy _coefList;
      |                 ^~~~~~~~~
/opt/root/src/roofit/hs3/src/JSONFactories_RooFitCore.cxx:456:45: error: no match for call to ‘(const RooListProxy {aka const RooCollectionProxy<RooArgList>}) ()’
  456 |       for (const auto &coef : pdf->_coefList()) {
      |                               ~~~~~~~~~~~~~~^~
make[2]: *** [roofit/hs3/CMakeFiles/RooFitHS3.dir/build.make:132: roofit/hs3/CMakeFiles/RooFitHS3.dir/src/JSONFactories_RooFitCore.cxx.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:44184: roofit/hs3/CMakeFiles/RooFitHS3.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....

Commented the body of the whole function. Got another error.

/opt/root/src/roofit/hs3/src/JSONFactories_RooFitCore.cxx: In member function ‘virtual bool {anonymous}::RooExpPolyStreamer::exportObject(RooJSONFactoryWSTool*, const RooAbsArg*, RooFit::Detail::JSONNode&) const’:
/opt/root/src/roofit/hs3/src/JSONFactories_RooFitCore.cxx:444:63: warning: unused parameter ‘func’ [-Wunused-parameter]
  444 |    bool exportObject(RooJSONFactoryWSTool *, const RooAbsArg *func, JSONNode &elem) const override
      |                                              ~~~~~~~~~~~~~~~~~^~~~
/opt/root/src/roofit/hs3/src/JSONFactories_RooFitCore.cxx:444:79: warning: unused parameter ‘elem’ [-Wunused-parameter]
  444 |    bool exportObject(RooJSONFactoryWSTool *, const RooAbsArg *func, JSONNode &elem) const override
      |                                                                     ~~~~~~~~~~^~~~
[ 98%] Linking CXX shared library ../../lib/libRooFitHS3.so
/usr/bin/ld: CMakeFiles/RooFitHS3.dir/src/JSONFactories_HistFactory.cxx.o: in function `std::vector<double, std::allocator<double> >& RooFit::Detail::operator<< <double>(std::vector<double, std::allocator<double> >&, RooFit::Detail::JSONNode const&) [clone .isra.0]':
JSONFactories_HistFactory.cxx:(.text+0xc212): undefined reference to `double RooFit::Detail::JSONNode::val_t<double>() const'
collect2: error: ld returned 1 exit status
make[2]: *** [roofit/hs3/CMakeFiles/RooFitHS3.dir/build.make:200: lib/libRooFitHS3.so] Error 1
make[1]: *** [CMakeFiles/Makefile2:44184: roofit/hs3/CMakeFiles/RooFitHS3.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....

Reproducer

Clone ROOT repository, go to the build directory,

cmake -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_INSTALL_PREFIX=../install ../src
cmake --build . -- install -j4

ROOT version

Most recent ROOT version from the master branch at that time.

commit 870618f (HEAD -> master, origin/master, origin/HEAD)

Should I use that? I thought there is continuous integration and people check for errors before committing.

Installation method

built from source

Operating system

Arch Linux

Additional context

Had to remove RooFit support from CMakeCache.txt.

Metadata

Metadata

Type

No type

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions