Inconsistent system environment on lxplus


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/
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: => not found => 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

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

source /cvmfs/

Does that solve it?

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/  
-- ROOT_FOUND          = TRUE
-- ROOT_INCLUDE_DIR    = /cvmfs/
-- ROOT_LIBRARIES      = -L/cvmfs/ 
-- ROOT_LIBRARY_DIR    = /cvmfs/
-- 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!

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 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/ 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.