'TUnfold.h' file not found


I am trying to follow some TUnfold examples (eg. ROOT: tutorials/math/testUnfold2.C File Reference) .
As in this example, I am using #include “TUnfold.h” as my include statement.

However, when I run the code I get this error:
root [0] .L unfold.C++
Info in TUnixSystem::ACLiC: creating shared library /home/colelemahieu/Research2023/./unfold_C.so
In file included from input_line_9:6:
././unfold.C:27:10: fatal error: ‘TUnfold.h’ file not found
#include “TUnfold.h”

Any help on this greatly appreciated!
Cole Le Mahieu

Please read tips for efficient and successful posting and posting code

ROOT Version: 6.30/02
Platform: Ubuntu 22.04.3 LTS
Compiler: Not Provided

This example is now in the tutorials/unfold folder. @moneta will know why the include file is missing.

Hi @clemahieu,

the ROOT 6.30 binaries unfortunately without TUnfold because of some license incompatibilities. We hope to remedy this in future ROOT versions. For now, you have 3 options:

  1. Use a ROOT older than 6.30.00
  2. Build ROOT 6.30 from source with the -Dunfold=ON option to get a build with TUnfold
  3. Use the ROOT 6.30 binaries from the website and then install TUnfold on top of it

I hope one of these solutions works for you, and sorry for the inconvenience!


Thanks! I think there is a way to use older ROOT versions on lxplus, correct?


Yes, it’s easy to use any ROOT version on LXPlus, just by sourcing the right thisroot.sh. You can find the paths on the release pages, like here:

When I try to source the ubuntu paths, I get errors about “cannot load library”:

[clemahie@lxplus940 ~] source /cvmfs/sft.cern.ch/lcg/app/releases/ROOT/6.28.10/x86_64-ubuntu22-gcc114-opt/bin/thisroot.sh
[clemahie@lxplus940 ~] root
Fatal in TROOT::InitInterpreter: cannot load library /lib64/libstdc++.so.6: version `GLIBCXX_3.4.30’ not found (required by /cvmfs/sft.cern.ch/lcg/app/releases/ROOT/6.28.10/x86_64-ubuntu22-gcc114-opt/lib/libRIO.so)
[clemahie@lxplus940 ~]

[clemahie@lxplus972 Unfold] source /cvmfs/sft.cern.ch/lcg/app/releases/ROOT/6.28.10/x86_64-ubuntu20-gcc94-opt/bin/thisroot.sh
[clemahie@lxplus972 Unfold] root
ERROR in cling::CIFactory::createCI(): cannot extract standard library include paths!
LC_ALL=C x86_64-linux-gnu-g+±9 -xc++ -E -v /dev/null 2>&1 | sed -n -e ‘/^.include/,${’ -e ‘/^ /.*++/p’ -e ‘}’
Results was:
With exit code 0

Maybe I need to source other libraries first?

Wait, if you are using lxplus that’s not Ubuntu. You are on lxplus9, which uses AlmaLinux9. The ROOT releases on cvmfs older than 6.30 don’t support this platform yet. But what you can do is to source an LCG software stack that was built for alma 9 and includes ROOT, for example:

source /cvmfs/sft.cern.ch/lcg/views/LCG_105/x86_64-el9-gcc11-opt/setup.sh

The good thing about the LCG releases is that they ship the newest ROOT with all features enabled, so in this case a build of ROOT 6.30.02 that also includes TUnfold!

To check what ROOT version is contained in an LCG release, you can visit lcginfo.cern.ch.

Does connecting to lxplus and then sourcing the LCG release work for you?


Yes, this appears to work, thank you!