Compile problem with ModelConfig for v6-28-06 on ubuntu

Hi,
I’m working on (k)ubuntu 22.04, and trying to compile root from the v6-28-06 tag of the git repository. I belive I have all the required includes (and have compiled earlier tags of root with no problem)

My cmake command is
cmake -DCMAKE_CXX_STANDARD=17 -DCMAKE_INSTALL_PREFIX=${PREFIX}/install …/root/

and the compilation eventually falls over here:

In file included from /folders/root/install/include/RooStats/RooStatsUtils.h:24,
from /folders/root/root/roofit/histfactory/src/HistoToWorkspaceFactoryFast.cxx:46:
/folders/root/install/include/RooStats/ModelConfig.h:30:7: error: redefinition of ‘class RooStats::ModelConfig’
30 | class ModelConfig final : public TNamed, public RooWorkspaceHandle {
|       ^~~~~~~~~~~
In file included from /folders/root/root/roofit/histfactory/src/HistoToWorkspaceFactoryFast.cxx:44:
/folders/root/root/roofit/roofitcore/inc/RooFit/ModelConfig.h:35:7: note: previous definition of ‘class RooStats::ModelConfig’
35 | class ModelConfig final : public TNamed, public RooWorkspaceHandle {
|       ^~~~~~~~~~~
make[2]: *** [roofit/histfactory/CMakeFiles/HistFactory.dir/build.make:174: roofit/histfactory/CMakeFiles/HistFactory.dir/src/HistoToWorkspaceFactoryFast.cxx.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:43824: roofit/histfactory/CMakeFiles/HistFactory.dir/all] Error 2
make: *** [Makefile:156: all] Error 2

Not sure how to debug further. Any suggestions?
thanks,
Gavin

My first question is: why building from source? Why not using any other available method to install it, for example using conda? Installing ROOT - ROOT

As you can see here, the build picks up a header from an existing ROOT installation.
The ModelConfig.h moved places in 6.28.06, so if you also keep an existing ROOT installation in the path it will be duplicated and you get this error.

The solution is to not have an existing ROOT installation in the path when building ROOT (i.e. sourced with thisroot.sh or installed with your package manager). This is something we don’t support.

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