Inconsistent system environment on lxplus

Hello.

I have a somewhat specific problem when using ROOT on CERN’s lxplus system. In particular with finding the correct set of environment variables.
I need to compile a program that relies on certain ROOT libraries and hence needs to find them.
My first trial was the following setup:

source /cvmfs/sft.cern.ch/lcg/app/releases/ROOT/6.14.06/x86_64-fedora28-gcc82-opt/bin/thisroot.sh
export ROOT_CFLAGS=`$ROOTSYS/bin/root-config --cflags`
export GLIBS=`$ROOTSYS/bin/root-config --glibs`
export ROOT_LIBS=`$ROOTSYS/bin/root-config --evelibs --libs`

With that, compilation went smooth. However, at runtime one of the executables fails as can be seen from ldd:

libssl.so.1.1 => not found
libcrypto.so.1.1 => not found

I didn’t manage to find the required version of libssl on default lxplus. So I went back to do the setup differently:

export ROOT_CFLAGS=`/usr/bin/root-config --cflags`
export GLIBS=`/usr/bin/root-config --glibs`
export ROOT_LIBS=`/usr/bin/root-config --evelibs --libs`

However, compilation fails this time since ld cannot locate lGdml (required by one of the executables). On top of that there is an undefined reference to TString in StartEveWithGeomDisplay.

My guess is, that the whole setup is inconsistent. However, I do not have enough experience on how to get it more consistent and especially on how to properly setup the environment on lxplus. There are a lot of options available.

I hoped, someone here could probably point me in the right direction? I’m happy to provide more information, if needed.

Thanks a lot in advance!


ROOT Version: 6.14/08 or 6.14/06
Platform: linux/lxplus
Compiler: gcc/8.2.0-3fa06/x86_64-centos7


Hi,
to get a consistent environment, you should use LCG views instead of lcg/app/releases: on lxplus7, this works:

source /cvmfs/sft.cern.ch/lcg/views/LCG_94/x86_64-centos7-gcc8-opt/setup.sh

Does that solve it?
Cheers,
Enrico

Dear Enrico,
Thanks a lot for your reply. I changed it and got indeed a slightly different setup. CMake outputs the following:

-- Found ROOT: /cvmfs/sft.cern.ch/lcg/views/LCG_94/x86_64-centos7-gcc8-opt/bin/root-config  
-- ROOT_FOUND          = TRUE
-- ROOT_INCLUDE_DIR    = /cvmfs/sft.cern.ch/lcg/releases/ROOT/6.14.04-820c6/x86_64-centos7-gcc8-opt/include
-- ROOT_LIBRARIES      = -L/cvmfs/sft.cern.ch/lcg/releases/ROOT/6.14.04-820c6/x86_64-centos7-gcc8-opt/lib 
-- ROOT_LIBRARY_DIR    = /cvmfs/sft.cern.ch/lcg/releases/ROOT/6.14.04-820c6/x86_64-centos7-gcc8-opt/lib
-- ROOT_VERSION        = 6.14/04

However, I end up with a lot of warnings during compile time as the code requires C++17, in particular std::string_view. Probably I need to use a version even more recent?

Thanks again!

Hi,
If your project uses c++17 features, you need a ROOT build compiled for c++17. I don’t think there is one on cvmfs, but @amadio might be able to comment with more authority.
You can check with root-config --cflags.

CMS or ATLAS might have their own builds, and they might be c++17.

If you only need string_view, however, there is a workaround: you can compile with a previous standard and include ROOT/RStringView.hxx instead of string_view: it’s ROOT’s c++11-compatible backport of string_view and it allows to use std::string_view in pre-c++17 code.

P.S. otherwise, you might have to compile ROOT for c++17 from source

I see. Actually, before I try to go in that direction: can you point out, what causes the wrong linking in the first place (see beginning of my original post). Is it the mismatch between ROOT and GCC?
And may I ask about the difference between lcg/views and lcg/app/releases?

This can help to enhance my understanding.

Sourcing the setup script in lcg/app/releases/ROOT only gets ROOT in your environment, not its dependencies. For example, you were missing libssl.so.1.1 in your LD_LIBRARY_PATH.

The setup scripts in lcg/views give you a full, consistent environment, so you get ROOT and its dependencies.

I believe at least some LCG builds of ROOT are using C++17. If not, the nightly master I keep in /cvmfs/sft.cern.ch/lcg/contrib/gentoo does use C++17. Let me know and I’ll show how to use it.

Thanks for the two of you for the support. It’s good to know about lcg/views. I wasn’t aware of the difference.

As for C++17: it would be interesting to see how it works, or if there are versions in LCG.

Thanks again for all answers.

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