Problem compiling C code on lxplus

Hello,

I recently ran into a problem compiling my C++ macro on lxplus.
My code contains classes from RooFit. I use:

g++ -o exe_file my_source_code -lRooFitCore -lRooFit -lRooStats `root-config --cflags --libs`

to compile the code, but I get error like:

SourceCode/egamma_fit.C:15:10: fatal error: RooFit.h: No such file or directory
   15 | #include "RooFit.h"
      |          ^~~~~~~~~~
Plugin/RooCMSShape.h:4:10: fatal error: RooAbsPdf.h: No such file or directory
    4 | #include "RooAbsPdf.h"
      |          ^~~~~~~~~~~~~

This just happened recently, as I was able to compile the code normally a week ago.

I also tried to setup root with the command line found on the ROOT website, but I also get error:

$ source /cvmfs/sft.cern.ch/lcg/views/LCG_100/-almalinux9-.3-x86_64-gcc11-opt/setup.sh
-bash: /cvmfs/sft.cern.ch/lcg/views/LCG_100/-almalinux9-.3-x86_64-gcc11-opt/setup.sh: No such file or directory

Is there anything I can do to fix this? Thank you very much.

Hoa.


ROOT Version: 6.30.00
Platform: lxplus
Compiler: g++


Hi @LongHoa!

Lxplus was changing it’s default from CentOS 7 to Alma 9 on December 7, that’s why you have these problems. If you want a quick solution, just connect to lxplus7, which still points to CentOS 7 machines. However, they will be gradually phased out, so it would be good if you figure out how to make your code work with the new alma9 environment.

I also tried to setup root with the command line found on the ROOT website, but I also get error:

Where did you get this command on the ROOT website? If I look at the release page for 6.30.02, the path to the alma 9 build is different:

/cvmfs/sft.cern.ch/lcg/app/releases/ROOT/6.30.02/x86_64-almalinux9.3-gcc114-opt

So if you do this, it should work!

source /cvmfs/sft.cern.ch/lcg/app/releases/ROOT/6.30.02/x86_64-almalinux9.3-gcc114-opt/bin/thisroot.sh

As for the problem with the RooFit header files not being found in the default ROOT distribution on lxplus9, I can reproduce this problem. The headers are indeed missing in /usr/linclude/root. I will open a ticket with CERN IT to figure out what is going on.

In the meantime, using lxplus7 or ROOT 6.30.02 sourced in the way I showed above will solve your problem!

Cheers,
Jonas

1 Like

Thank you very much, I try sourcing version 6.30.02 as you suggest and it works.
I was using the command shown here, but I guess there is typo.

Hi Jonas,

I just want to update that the 6.30.02 build sourcing from /cvmfs doesn’t work either. The code was compiled, but it gave me error when using RooFFTConvPdf.

[#0] FATAL:Eval -- RooFFTConvPdf::fillCacheSlice(sig-modelCannot get a handle to fftw. Maybe ROOT was built without it?

switching back to CentOS7 works well.

I was using the command shown here, but I guess there is typo.

Thanks! I fixed the typo there, the link should be correct soon.

About the RooFFTConvPdf problem with the standalone: it will be resolved in 6.30.02 (see this PR on GitHub).

Alternatively, if you use the LCG stack without the typo in the path:

source /cvmfs/sft.cern.ch/lcg/views/LCG_104/aarch64-el9-gcc11-opt/setup.sh

You get a ROOT version that was built with -Dfftw3=ON, meaning the RooFFTConvPdf already works with all ROOT versions, also the new ones from the 6.30 family.

1 Like

Hi Jonas,
Thank you very much for taking care of the issue!
Best,
Hoa.

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