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:
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
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?
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?
Sourcing the setup script in lcg/app/releases/ROOTonly 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.