RooStats Package Installation

Dear experts,
I recently installed root-6.36.00 on Fedora 42. I installed using CMake. The installation went well. I needed to install Roofit and some other packages like RooStats. I used the following commands to build and install these packages:
cmake .. -DCMAKE_INSTALL_PREFIX=../MyInstallDir -Droofit=ON -Droostats=ON -Dsplot=ON -Dmathmore=ON -Dgnuinstall=ON -Dminimal=OFF
cmake --build . – install -j$(nproc)
Again the installation went well but I know the RooStats and sPlot are not installed. When I try to run my fitting code, I receive the following error:
fatal error: ‘RooChi2Var.h’ file not found
I also do not see the roostats directory in my Build directory.
Any help is appreciated.

Hi @Natilus,

Welcome back to the ROOT forum.
ROOT provides pre-compiled binaries for its releases for a wide range of systems. For example, here is the list for v6.36, with Fedora 42 being among the provided packages.

Could you please check if your use case works with the pre-compiled ROOT version?

Lukas

Hi @lbreitwi,
I also installed the pre-compiled version (https://root.cern/download/root_v6.36.00.Linux-fedora42-x86_64-gcc15.1.tar.gz).
It comes with RooFit but some other packages like sPlot and RooStats are not included.
Is there a way to install other packages on the pre-compiled version?
Thank you for your help.

In the file you just linked, I see it contains lib/libRooStats.so

Hi @ferhue ,
I installed root using CMake, as well as dnf. Also tried the pre-compiled one. In all three, when I try to run my analysis code, which worked perfectly fine in the past, I get the following error:
fatal error: ‘RooChi2Var.h’ file not found
When I check “root-config --features”, RooStats, sPlot and many other packages are not among them.
I am not worried about the packages appearing in the list of features but I would like to know how i can add the missing header like “RooChi2Var.h” .
Thank you

I would suggest using:

you will just need to do sth like:

target_link_libraries(RootSimpleExample PUBLIC ROOT::RooFit ROOT::RooStats ROOT::Core ...)

Then it will automatically the required headers.

(root-config only tells you some of the features, but not all libraries I guess.)

Hi @ferhue ,
Thank you again for the help. To give some more context,
I run my code interactively (.L code.cc++), so I assume I don’t need “target_link_libraries”. I am no expert in this but according to chatgpt, I don’t need “target_link_libraries” if I use root interactively. However, if you still think using “target_link_libraries” will help, I will run it. Just please let me know where I should run it, in bash or in root.
Thank you

Yes, if you run your code interactively, that’s fine.

Type ‘.I’

in the ROOT prompt.
It should list the default include paths.

Then search for RooChi2Var.h in your system, e.g. using locate RooChi2Var.h in a system terminal.

If it’s not in any of the folders listed by .I, then you can call

gSystem->AddIncludePath(…) as workaround.

Hi @ferhue ,
Thank you very much.
That fixed the issue.
I appreciate it.

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