Strange linker error (only) in Xcode

Hi,

I’m running into a weird linker error with my latest code. When I’m trying to build my code in Xcode, I get the following:

I.e. it complains about not finding ROOT::VecOps::RVec<int>::RVec(). Which of course I don’t reference explicitly in the code. And that may very well be the problem. The code in question (for those with a CERN account) is this one:

https://gitlab.cern.ch/akraszna/xAODDataSource/blob/master/xAODDataFrameTests/util/rdfToolTest.cxx

This started appearing when I introduced a “dummy” int variable into my job, just to trigger the execution of a function. (As that function modifies an already existing variable.) So I receive that variable with a downstream function, I just don’t use it.

   T operator()( const T& container, int /*dummy*/ ) const {

And I guess this is what gets Xcode confused…

Now, if I build the code from the command line (with GNU Make), it builds successfully. It also builds just fine on SLC6 (as seen in the CI of the repository), and even on Ubuntu 18.04.

So… I guess my question is: Has anybody seen something like this before? What would you try to do to fix it? Could there maybe be something inside the RDataFrame code that could be done to help with this?

Cheers,
Attila

P.S. We request the -Wl,--as-needed linker option in our builds. Which I guess also plays a role here…


ROOT Version: 6.14/04
Platform: x86_64-mac1014-clang100-opt
Compiler: Apple Clang 10.0


Hahh… :thinking:

After writing this all down, I was finally able to reproduce this with GNU Make as well. The key is to build the code in debug mode (-DCMAKE_BUILD_TYPE=Debug). As that’s what Xcode does by default.

[ 51%] Linking CXX executable ../x86_64-mac1014-clang100-dbg/bin/rdfToolTest
Undefined symbols for architecture x86_64:
  "ROOT::VecOps::RVec<int>::RVec()", referenced from:
      ROOT::Internal::RDF::TColumnValue<int, false>::TColumnValue() in rdfToolTest.cxx.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [x86_64-mac1014-clang100-dbg/bin/rdfToolTest] Error 1
make[1]: *** [xAODDataFrameTests/CMakeFiles/rdfToolTest.dir/all] Error 2
make: *** [all] Error 2

But in Release and RelWithDebInfo modes it works just fine. :confused: I’m really getting the sense that it’s not my code responsible for this failure…

Cheers,
Attila

P.S. My ROOT installation was built in Release mode. But that shouldn’t stop me building my own code against it in whatever other mode, right?

Okay, I guess I’ll open a ticket about it tomorrow with a simple reproducer. As the link error is the same on SLC6 with GCC 6.2 as well. (Now that I know what to look for…)

[ 57%] Linking CXX executable ../x86_64-slc6-gcc62-dbg/bin/rdfToolTest
/opt/lcg/binutils/2.28/x86_64-slc6/bin/ld: CMakeFiles/rdfToolTest.dir/util/rdfToolTest.cxx.o: undefined reference to symbol '_ZN4ROOT6VecOps4RVecIiEC1Ev'
/usr/AnalysisBaseExternals/21.2.50/InstallArea/x86_64-slc6-gcc62-opt/lib/libROOTVecOps.so: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[2]: *** [x86_64-slc6-gcc62-dbg/bin/rdfToolTest] Error 1
make[1]: *** [xAODDataFrameTests/CMakeFiles/rdfToolTest.dir/all] Error 2
make: *** [all] Error 2

So… The issue was not in ROOT after all. At least not “directly”.

While trying (and failing) to reproduce the issue with a simple example, I had to realise that root-config --libs started adding -lROOTVecOps to the command line.

Which I found a bit surprising. Since when I looked at the RVec reference page (https://root.cern.ch/doc/v614/classROOT_1_1VecOps_1_1RVec.html), I only saw it mentioning libCore as a required library to use this type. (At the bottom of the page.)

After I added ROOTVecOps as a linked library to my CMake setup, the build started working.

So at this point I just have 2 questions:

  • Should that webpage not mention ROOTVecOps?
  • How come the ROOTDataFrame library doesn’t “pull in” ROOTVecOps? If it depends on it (it seems to), then it would be nice if I could just list ROOTDataFrame as a dependency of my own code, and that library automatically setting up the link against ROOTVecOps as well.

Cheers,
Attila

Hi Attila,

thanks!

Doc: that’s now https://sft.its.cern.ch/jira/browse/ROOT-9760
RDF vs VecOps: @Danilo do you know?

Axel.

Hi Axel,

Thanks! In the meanwhile I looked at ROOTDataFrame a bit more, and I still don’t understand why the link doesn’t happen automagically. :confused:

The compiled library correctly lists ROOTVecOps as a dependency.

[bash][pcadp02]:~ > ldd -r /cvmfs/atlas.cern.ch/repo/sw/software/21.2/AnalysisBaseExternals/21.2.50/InstallArea/x86_64-slc6-gcc62-opt/lib/libROOTDataFrame.so 
	linux-vdso.so.1 =>  (0x00007fff12f10000)
	libtbb.so.2 => /cvmfs/atlas.cern.ch/repo/sw/software/21.2/AnalysisBaseExternals/21.2.50/InstallArea/x86_64-slc6-gcc62-opt/lib/libtbb.so.2 (0x00007fdd5cd3d000)
	libTreePlayer.so => /cvmfs/atlas.cern.ch/repo/sw/software/21.2/AnalysisBaseExternals/21.2.50/InstallArea/x86_64-slc6-gcc62-opt/lib/libTreePlayer.so (0x00007fdd5c9ce000)
	libROOTVecOps.so => /cvmfs/atlas.cern.ch/repo/sw/software/21.2/AnalysisBaseExternals/21.2.50/InstallArea/x86_64-slc6-gcc62-opt/lib/libROOTVecOps.so (0x00007fdd5c6fc000)
	libTree.so => /cvmfs/atlas.cern.ch/repo/sw/software/21.2/AnalysisBaseExternals/21.2.50/InstallArea/x86_64-slc6-gcc62-opt/lib/libTree.so (0x00007fdd5c38d000)
...

As long as libROOTVecOps.so is available in my LD_LIBRARY_PATH, I would’ve expected g++ to “pull in” ROOTVecOps into my executable just by declaring that my executable directly depends on ROOTDataFrame.

We actually depend on this behaviour of GCC a lot in our build system. This is how we’re able to declare “private” dependencies on our libraries in CMake, and still successfully link things against them.

So I’m still a bit confused by all this…

Cheers,
Attila

Hi Attila,

Can you post the failing VERBOSE=1 linker invocation by make?

Cheers, Axel.

Hi Axel,

This is what I get on macOS:

[ 48%] Linking CXX executable ../x86_64-mac1014-clang100-dbg/bin/rdfToolTest
cd /Users/krasznaa/ATLAS/sw/projects/volatile/xaodds/make-build/xAODDataFrameTests && /Users/krasznaa/Software/CMake/3.12.3/bin/cmake -E cmake_link_script CMakeFiles/rdfToolTest.dir/link.txt --verbose=1
/Users/krasznaa/ATLAS/sw/projects/volatile/xaodds/make-build/atlas_build_run.sh /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++  -g -pedantic -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names  CMakeFiles/rdfToolTest.dir/util/rdfToolTest.cxx.o  -o ../x86_64-mac1014-clang100-dbg/bin/rdfToolTest /Users/krasznaa/ATLAS/Software/AnalysisBaseExternals/21.2.50/InstallArea/x86_64-mac1014-clang100-opt/lib/libCore.so /Users/krasznaa/ATLAS/Software/AnalysisBaseExternals/21.2.50/InstallArea/x86_64-mac1014-clang100-opt/lib/libGpad.so /Users/krasznaa/ATLAS/Software/AnalysisBaseExternals/21.2.50/InstallArea/x86_64-mac1014-clang100-opt/lib/libRIO.so /Users/krasznaa/ATLAS/Software/AnalysisBaseExternals/21.2.50/InstallArea/x86_64-mac1014-clang100-opt/lib/libTree.so /Users/krasznaa/ATLAS/Software/AnalysisBaseExternals/21.2.50/InstallArea/x86_64-mac1014-clang100-opt/lib/libImt.so ../x86_64-mac1014-clang100-dbg/lib/libxAODDataFrameTestsLib.dylib ../x86_64-mac1014-clang100-dbg/lib/libxAODDataSourceLib.dylib -ldl /Users/krasznaa/ATLAS/Software/AnalysisBaseExternals/21.2.50/InstallArea/x86_64-mac1014-clang100-opt/lib/libGpad.so /Users/krasznaa/ATLAS/Software/AnalysisBaseExternals/21.2.50/InstallArea/x86_64-mac1014-clang100-opt/lib/libImt.so /Users/krasznaa/ATLAS/Software/AnalysisBaseExternals/21.2.50/InstallArea/x86_64-mac1014-clang100-opt/lib/libboost_program_options.dylib /Users/krasznaa/ATLAS/Software/AnalysisBaseExternals/21.2.50/InstallArea/x86_64-mac1014-clang100-opt/lib/libCore.so /Users/krasznaa/ATLAS/Software/AnalysisBaseExternals/21.2.50/InstallArea/x86_64-mac1014-clang100-opt/lib/libTree.so /Users/krasznaa/ATLAS/Software/AnalysisBaseExternals/21.2.50/InstallArea/x86_64-mac1014-clang100-opt/lib/libTreePlayer.so /Users/krasznaa/ATLAS/Software/AnalysisBaseExternals/21.2.50/InstallArea/x86_64-mac1014-clang100-opt/lib/libRIO.so /Users/krasznaa/ATLAS/Software/AnalysisBaseExternals/21.2.50/InstallArea/x86_64-mac1014-clang100-opt/lib/libROOTDataFrame.so /Users/krasznaa/ATLAS/Software/AnalysisBase/21.2.50/InstallArea/x86_64-mac1014-clang100-opt/lib/libxAODEventInfo.dylib /Users/krasznaa/ATLAS/Software/AnalysisBase/21.2.50/InstallArea/x86_64-mac1014-clang100-opt/lib/libxAODEgamma.dylib /Users/krasznaa/ATLAS/Software/AnalysisBase/21.2.50/InstallArea/x86_64-mac1014-clang100-opt/lib/libxAODCaloEvent.dylib /Users/krasznaa/ATLAS/Software/AnalysisBase/21.2.50/InstallArea/x86_64-mac1014-clang100-opt/lib/libCaloGeoHelpers.dylib /Users/krasznaa/ATLAS/Software/AnalysisBase/21.2.50/InstallArea/x86_64-mac1014-clang100-opt/lib/libxAODPrimitives.dylib /Users/krasznaa/ATLAS/Software/AnalysisBase/21.2.50/InstallArea/x86_64-mac1014-clang100-opt/lib/libxAODTracking.dylib /Users/krasznaa/ATLAS/Software/AnalysisBase/21.2.50/InstallArea/x86_64-mac1014-clang100-opt/lib/libxAODTruth.dylib /Users/krasznaa/ATLAS/Software/AnalysisBase/21.2.50/InstallArea/x86_64-mac1014-clang100-opt/lib/libxAODBase.dylib /Users/krasznaa/ATLAS/Software/AnalysisBase/21.2.50/InstallArea/x86_64-mac1014-clang100-opt/../../../../AnalysisBaseExternals/21.2.50/InstallArea/x86_64-mac1014-clang100-opt/lib/libPhysics.so /Users/krasznaa/ATLAS/Software/AnalysisBase/21.2.50/InstallArea/x86_64-mac1014-clang100-opt/lib/libPATInterfaces.dylib /Users/krasznaa/ATLAS/Software/AnalysisBase/21.2.50/InstallArea/x86_64-mac1014-clang100-opt/lib/libPATCoreLib.dylib /Users/krasznaa/ATLAS/Software/AnalysisBase/21.2.50/InstallArea/x86_64-mac1014-clang100-opt/lib/libAsgTools.dylib /Users/krasznaa/ATLAS/Software/AnalysisBase/21.2.50/InstallArea/x86_64-mac1014-clang100-opt/lib/libxAODRootAccess.dylib /Users/krasznaa/ATLAS/Software/AnalysisBase/21.2.50/InstallArea/x86_64-mac1014-clang100-opt/../../../../AnalysisBaseExternals/21.2.50/InstallArea/x86_64-mac1014-clang100-opt/lib/libNet.so /Users/krasznaa/ATLAS/Software/AnalysisBase/21.2.50/InstallArea/x86_64-mac1014-clang100-opt/../../../../AnalysisBaseExternals/21.2.50/InstallArea/x86_64-mac1014-clang100-opt/lib/libMathCore.so /Users/krasznaa/ATLAS/Software/AnalysisBase/21.2.50/InstallArea/x86_64-mac1014-clang100-opt/lib/libxAODEventFormat.dylib /Users/krasznaa/ATLAS/Software/AnalysisBase/21.2.50/InstallArea/x86_64-mac1014-clang100-opt/lib/libxAODCore.dylib /Users/krasznaa/ATLAS/Software/AnalysisBase/21.2.50/InstallArea/x86_64-mac1014-clang100-opt/../../../../AnalysisBaseExternals/21.2.50/InstallArea/x86_64-mac1014-clang100-opt/lib/libHist.so /Users/krasznaa/ATLAS/Software/AnalysisBase/21.2.50/InstallArea/x86_64-mac1014-clang100-opt/../../../../AnalysisBaseExternals/21.2.50/InstallArea/x86_64-mac1014-clang100-opt/lib/libTree.so /Users/krasznaa/ATLAS/Software/AnalysisBase/21.2.50/InstallArea/x86_64-mac1014-clang100-opt/../../../../AnalysisBaseExternals/21.2.50/InstallArea/x86_64-mac1014-clang100-opt/lib/libRIO.so /Users/krasznaa/ATLAS/Software/AnalysisBase/21.2.50/InstallArea/x86_64-mac1014-clang100-opt/lib/libAthContainers.dylib /Users/krasznaa/ATLAS/Software/AnalysisBase/21.2.50/InstallArea/x86_64-mac1014-clang100-opt/lib/libAthLinks.dylib /Users/krasznaa/ATLAS/Software/AnalysisBase/21.2.50/InstallArea/x86_64-mac1014-clang100-opt/lib/libxAODRootAccessInterfaces.dylib /Users/krasznaa/ATLAS/Software/AnalysisBase/21.2.50/InstallArea/x86_64-mac1014-clang100-opt/../../../../AnalysisBaseExternals/21.2.50/InstallArea/x86_64-mac1014-clang100-opt/lib/libCore.so /Users/krasznaa/ATLAS/Software/AnalysisBase/21.2.50/InstallArea/x86_64-mac1014-clang100-opt/lib/libCxxUtils.dylib /Users/krasznaa/ATLAS/Software/AnalysisBase/21.2.50/InstallArea/x86_64-mac1014-clang100-opt/../../../../AnalysisBaseExternals/21.2.50/InstallArea/x86_64-mac1014-clang100-opt/lib/libboost_program_options.dylib /Users/krasznaa/ATLAS/Software/AnalysisBase/21.2.50/InstallArea/x86_64-mac1014-clang100-opt/../../../../AnalysisBaseExternals/21.2.50/InstallArea/x86_64-mac1014-clang100-opt/lib/libboost_regex.dylib /Users/krasznaa/ATLAS/Software/AnalysisBase/21.2.50/InstallArea/x86_64-mac1014-clang100-opt/../../../../AnalysisBaseExternals/21.2.50/InstallArea/x86_64-mac1014-clang100-opt/lib/libboost_filesystem.dylib /Users/krasznaa/ATLAS/Software/AnalysisBase/21.2.50/InstallArea/x86_64-mac1014-clang100-opt/../../../../AnalysisBaseExternals/21.2.50/InstallArea/x86_64-mac1014-clang100-opt/lib/libboost_timer.dylib /Users/krasznaa/ATLAS/Software/AnalysisBase/21.2.50/InstallArea/x86_64-mac1014-clang100-opt/../../../../AnalysisBaseExternals/21.2.50/InstallArea/x86_64-mac1014-clang100-opt/lib/libboost_thread.dylib /Users/krasznaa/ATLAS/Software/AnalysisBase/21.2.50/InstallArea/x86_64-mac1014-clang100-opt/../../../../AnalysisBaseExternals/21.2.50/InstallArea/x86_64-mac1014-clang100-opt/lib/libboost_chrono.dylib /Users/krasznaa/ATLAS/Software/AnalysisBase/21.2.50/InstallArea/x86_64-mac1014-clang100-opt/../../../../AnalysisBaseExternals/21.2.50/InstallArea/x86_64-mac1014-clang100-opt/lib/libboost_system.dylib /Users/krasznaa/ATLAS/Software/AnalysisBase/21.2.50/InstallArea/x86_64-mac1014-clang100-opt/../../../../AnalysisBaseExternals/21.2.50/InstallArea/x86_64-mac1014-clang100-opt/lib/libboost_date_time.dylib /Users/krasznaa/ATLAS/Software/AnalysisBase/21.2.50/InstallArea/x86_64-mac1014-clang100-opt/../../../../AnalysisBaseExternals/21.2.50/InstallArea/x86_64-mac1014-clang100-opt/lib/libboost_atomic.dylib 
Undefined symbols for architecture x86_64:
  "ROOT::VecOps::RVec<int>::RVec()", referenced from:
      ROOT::Internal::RDF::TColumnValue<int, false>::TColumnValue() in rdfToolTest.cxx.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [x86_64-mac1014-clang100-dbg/bin/rdfToolTest] Error 1
make[1]: *** [xAODDataFrameTests/CMakeFiles/rdfToolTest.dir/all] Error 2
make: *** [all] Error 2

Where:

[bash][tauriel]:make-build > echo $DYLD_LIBRARY_PATH 
/Users/krasznaa/ATLAS/Software/AnalysisBase/21.2.50/InstallArea/x86_64-mac1014-clang100-opt/lib:/Users/krasznaa/ATLAS/Software/AnalysisBaseExternals/21.2.50/InstallArea/x86_64-mac1014-clang100-opt/lib
[bash][tauriel]:make-build >

On SLC6 I see:

[ 57%] Linking CXX executable ../x86_64-slc6-gcc62-dbg/bin/rdfToolTest
cd /home/krasznaa/projects/xaodds/build/xAODDataFrameTests && /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/Cmake/3.11.0/Linux-x86_64/bin/cmake -E cmake_link_script CMakeFiles/rdfToolTest.dir/link.txt --verbose=1
/home/krasznaa/projects/xaodds/build/atlas_build_run.sh /cvmfs/sft.cern.ch/lcg/releases/gcc/6.2.0-2bc78/x86_64-slc6-gcc62-opt/bin/g++  -g -Wall -Wno-long-long -Wno-deprecated -Wno-unused-local-typedefs -Wwrite-strings -Wpointer-arith -Woverloaded-virtual -Wextra -Werror=return-type -fsanitize=undefined -pedantic   -Wl,--as-needed -Wl,--hash-style=both CMakeFiles/rdfToolTest.dir/util/rdfToolTest.cxx.o  -o ../x86_64-slc6-gcc62-dbg/bin/rdfToolTest /cvmfs/atlas.cern.ch/repo/sw/software/21.2/AnalysisBaseExternals/21.2.50/InstallArea/x86_64-slc6-gcc62-opt/lib/libCore.so /cvmfs/atlas.cern.ch/repo/sw/software/21.2/AnalysisBaseExternals/21.2.50/InstallArea/x86_64-slc6-gcc62-opt/lib/libGpad.so /cvmfs/atlas.cern.ch/repo/sw/software/21.2/AnalysisBaseExternals/21.2.50/InstallArea/x86_64-slc6-gcc62-opt/lib/libRIO.so /cvmfs/atlas.cern.ch/repo/sw/software/21.2/AnalysisBaseExternals/21.2.50/InstallArea/x86_64-slc6-gcc62-opt/lib/libTree.so /cvmfs/atlas.cern.ch/repo/sw/software/21.2/AnalysisBaseExternals/21.2.50/InstallArea/x86_64-slc6-gcc62-opt/lib/libImt.so ../x86_64-slc6-gcc62-dbg/lib/libxAODDataFrameTestsLib.so ../x86_64-slc6-gcc62-dbg/lib/libxAODDataSourceLib.so -Wl,--no-as-needed -ldl -Wl,--as-needed /cvmfs/atlas.cern.ch/repo/sw/software/21.2/AnalysisBaseExternals/21.2.50/InstallArea/x86_64-slc6-gcc62-opt/lib/libGpad.so /cvmfs/atlas.cern.ch/repo/sw/software/21.2/AnalysisBaseExternals/21.2.50/InstallArea/x86_64-slc6-gcc62-opt/lib/libImt.so /cvmfs/atlas.cern.ch/repo/sw/software/21.2/AnalysisBaseExternals/21.2.50/InstallArea/x86_64-slc6-gcc62-opt/lib/libboost_program_options.so /cvmfs/atlas.cern.ch/repo/sw/software/21.2/AnalysisBaseExternals/21.2.50/InstallArea/x86_64-slc6-gcc62-opt/lib/libCore.so /cvmfs/atlas.cern.ch/repo/sw/software/21.2/AnalysisBaseExternals/21.2.50/InstallArea/x86_64-slc6-gcc62-opt/lib/libTree.so /cvmfs/atlas.cern.ch/repo/sw/software/21.2/AnalysisBaseExternals/21.2.50/InstallArea/x86_64-slc6-gcc62-opt/lib/libTreePlayer.so /cvmfs/atlas.cern.ch/repo/sw/software/21.2/AnalysisBaseExternals/21.2.50/InstallArea/x86_64-slc6-gcc62-opt/lib/libRIO.so /cvmfs/atlas.cern.ch/repo/sw/software/21.2/AnalysisBaseExternals/21.2.50/InstallArea/x86_64-slc6-gcc62-opt/lib/libROOTDataFrame.so /cvmfs/atlas.cern.ch/repo/sw/software/21.2/AnalysisBase/21.2.50/InstallArea/x86_64-slc6-gcc62-opt/lib/libxAODEventInfo.so /cvmfs/atlas.cern.ch/repo/sw/software/21.2/AnalysisBase/21.2.50/InstallArea/x86_64-slc6-gcc62-opt/lib/libxAODEgamma.so /cvmfs/atlas.cern.ch/repo/sw/software/21.2/AnalysisBase/21.2.50/InstallArea/x86_64-slc6-gcc62-opt/lib/libxAODCaloEvent.so /cvmfs/atlas.cern.ch/repo/sw/software/21.2/AnalysisBase/21.2.50/InstallArea/x86_64-slc6-gcc62-opt/lib/libCaloGeoHelpers.so /cvmfs/atlas.cern.ch/repo/sw/software/21.2/AnalysisBase/21.2.50/InstallArea/x86_64-slc6-gcc62-opt/lib/libxAODPrimitives.so /cvmfs/atlas.cern.ch/repo/sw/software/21.2/AnalysisBase/21.2.50/InstallArea/x86_64-slc6-gcc62-opt/lib/libxAODTracking.so /cvmfs/atlas.cern.ch/repo/sw/software/21.2/AnalysisBase/21.2.50/InstallArea/x86_64-slc6-gcc62-opt/lib/libxAODTruth.so /cvmfs/atlas.cern.ch/repo/sw/software/21.2/AnalysisBase/21.2.50/InstallArea/x86_64-slc6-gcc62-opt/lib/libxAODBase.so /cvmfs/atlas.cern.ch/repo/sw/software/21.2/AnalysisBase/21.2.50/InstallArea/x86_64-slc6-gcc62-opt/../../../../AnalysisBaseExternals/21.2.50/InstallArea/x86_64-slc6-gcc62-opt/lib/libPhysics.so /cvmfs/atlas.cern.ch/repo/sw/software/21.2/AnalysisBase/21.2.50/InstallArea/x86_64-slc6-gcc62-opt/lib/libPATInterfaces.so /cvmfs/atlas.cern.ch/repo/sw/software/21.2/AnalysisBase/21.2.50/InstallArea/x86_64-slc6-gcc62-opt/lib/libPATCoreLib.so /cvmfs/atlas.cern.ch/repo/sw/software/21.2/AnalysisBase/21.2.50/InstallArea/x86_64-slc6-gcc62-opt/lib/libAsgTools.so /cvmfs/atlas.cern.ch/repo/sw/software/21.2/AnalysisBase/21.2.50/InstallArea/x86_64-slc6-gcc62-opt/lib/libxAODRootAccess.so /cvmfs/atlas.cern.ch/repo/sw/software/21.2/AnalysisBase/21.2.50/InstallArea/x86_64-slc6-gcc62-opt/../../../../AnalysisBaseExternals/21.2.50/InstallArea/x86_64-slc6-gcc62-opt/lib/libNet.so /cvmfs/atlas.cern.ch/repo/sw/software/21.2/AnalysisBase/21.2.50/InstallArea/x86_64-slc6-gcc62-opt/../../../../AnalysisBaseExternals/21.2.50/InstallArea/x86_64-slc6-gcc62-opt/lib/libMathCore.so /cvmfs/atlas.cern.ch/repo/sw/software/21.2/AnalysisBase/21.2.50/InstallArea/x86_64-slc6-gcc62-opt/lib/libxAODEventFormat.so /cvmfs/atlas.cern.ch/repo/sw/software/21.2/AnalysisBase/21.2.50/InstallArea/x86_64-slc6-gcc62-opt/lib/libxAODCore.so /cvmfs/atlas.cern.ch/repo/sw/software/21.2/AnalysisBase/21.2.50/InstallArea/x86_64-slc6-gcc62-opt/../../../../AnalysisBaseExternals/21.2.50/InstallArea/x86_64-slc6-gcc62-opt/lib/libHist.so /cvmfs/atlas.cern.ch/repo/sw/software/21.2/AnalysisBase/21.2.50/InstallArea/x86_64-slc6-gcc62-opt/../../../../AnalysisBaseExternals/21.2.50/InstallArea/x86_64-slc6-gcc62-opt/lib/libTree.so /cvmfs/atlas.cern.ch/repo/sw/software/21.2/AnalysisBase/21.2.50/InstallArea/x86_64-slc6-gcc62-opt/../../../../AnalysisBaseExternals/21.2.50/InstallArea/x86_64-slc6-gcc62-opt/lib/libRIO.so /cvmfs/atlas.cern.ch/repo/sw/software/21.2/AnalysisBase/21.2.50/InstallArea/x86_64-slc6-gcc62-opt/lib/libAthContainers.so /cvmfs/atlas.cern.ch/repo/sw/software/21.2/AnalysisBase/21.2.50/InstallArea/x86_64-slc6-gcc62-opt/lib/libAthLinks.so /cvmfs/atlas.cern.ch/repo/sw/software/21.2/AnalysisBase/21.2.50/InstallArea/x86_64-slc6-gcc62-opt/lib/libxAODRootAccessInterfaces.so /cvmfs/atlas.cern.ch/repo/sw/software/21.2/AnalysisBase/21.2.50/InstallArea/x86_64-slc6-gcc62-opt/../../../../AnalysisBaseExternals/21.2.50/InstallArea/x86_64-slc6-gcc62-opt/lib/libCore.so /cvmfs/atlas.cern.ch/repo/sw/software/21.2/AnalysisBase/21.2.50/InstallArea/x86_64-slc6-gcc62-opt/lib/libCxxUtils.so -pthread /cvmfs/atlas.cern.ch/repo/sw/software/21.2/AnalysisBase/21.2.50/InstallArea/x86_64-slc6-gcc62-opt/../../../../AnalysisBaseExternals/21.2.50/InstallArea/x86_64-slc6-gcc62-opt/lib/libboost_program_options.so /cvmfs/atlas.cern.ch/repo/sw/software/21.2/AnalysisBase/21.2.50/InstallArea/x86_64-slc6-gcc62-opt/../../../../AnalysisBaseExternals/21.2.50/InstallArea/x86_64-slc6-gcc62-opt/lib/libboost_regex.so /cvmfs/atlas.cern.ch/repo/sw/software/21.2/AnalysisBase/21.2.50/InstallArea/x86_64-slc6-gcc62-opt/../../../../AnalysisBaseExternals/21.2.50/InstallArea/x86_64-slc6-gcc62-opt/lib/libboost_filesystem.so /cvmfs/atlas.cern.ch/repo/sw/software/21.2/AnalysisBase/21.2.50/InstallArea/x86_64-slc6-gcc62-opt/../../../../AnalysisBaseExternals/21.2.50/InstallArea/x86_64-slc6-gcc62-opt/lib/libboost_timer.so /cvmfs/atlas.cern.ch/repo/sw/software/21.2/AnalysisBase/21.2.50/InstallArea/x86_64-slc6-gcc62-opt/../../../../AnalysisBaseExternals/21.2.50/InstallArea/x86_64-slc6-gcc62-opt/lib/libboost_thread.so /cvmfs/atlas.cern.ch/repo/sw/software/21.2/AnalysisBase/21.2.50/InstallArea/x86_64-slc6-gcc62-opt/../../../../AnalysisBaseExternals/21.2.50/InstallArea/x86_64-slc6-gcc62-opt/lib/libboost_chrono.so /cvmfs/atlas.cern.ch/repo/sw/software/21.2/AnalysisBase/21.2.50/InstallArea/x86_64-slc6-gcc62-opt/../../../../AnalysisBaseExternals/21.2.50/InstallArea/x86_64-slc6-gcc62-opt/lib/libboost_system.so /cvmfs/atlas.cern.ch/repo/sw/software/21.2/AnalysisBase/21.2.50/InstallArea/x86_64-slc6-gcc62-opt/../../../../AnalysisBaseExternals/21.2.50/InstallArea/x86_64-slc6-gcc62-opt/lib/libboost_date_time.so /cvmfs/atlas.cern.ch/repo/sw/software/21.2/AnalysisBase/21.2.50/InstallArea/x86_64-slc6-gcc62-opt/../../../../AnalysisBaseExternals/21.2.50/InstallArea/x86_64-slc6-gcc62-opt/lib/libboost_atomic.so -Wl,-rpath-link,/cvmfs/atlas.cern.ch/repo/sw/software/21.2/AnalysisBase/21.2.50/InstallArea/x86_64-slc6-gcc62-opt/lib
/cvmfs/sft.cern.ch/lcg/releases/binutils/2.28-19981/x86_64-slc6-gcc62-opt/bin/ld: CMakeFiles/rdfToolTest.dir/util/rdfToolTest.cxx.o: undefined reference to symbol '_ZN4ROOT6VecOps4RVecIiEC1Ev'
/cvmfs/atlas.cern.ch/repo/sw/software/21.2/AnalysisBaseExternals/21.2.50/InstallArea/x86_64-slc6-gcc62-opt/lib/libROOTVecOps.so: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[2]: *** [x86_64-slc6-gcc62-dbg/bin/rdfToolTest] Error 1
make[2]: Leaving directory `/home/krasznaa/projects/xaodds/build'
make[1]: *** [xAODDataFrameTests/CMakeFiles/rdfToolTest.dir/all] Error 2
make[1]: Leaving directory `/home/krasznaa/projects/xaodds/build'
make: *** [all] Error 2

With:

[bash][pcadp02]:build > echo $LD_LIBRARY_PATH 
/cvmfs/atlas.cern.ch/repo/sw/software/21.2/AnalysisBase/21.2.50/InstallArea/x86_64-slc6-gcc62-opt/lib:/cvmfs/atlas.cern.ch/repo/sw/software/21.2/AnalysisBaseExternals/21.2.50/InstallArea/x86_64-slc6-gcc62-opt/lib:/cvmfs/atlas.cern.ch/repo/sw/software/21.2/AnalysisBaseExternals/21.2.50/InstallArea/x86_64-slc6-gcc62-opt/lib64:/cvmfs/sft.cern.ch/lcg/releases/gcc/6.2.0-2bc78/x86_64-slc6-gcc62-opt/lib:/cvmfs/sft.cern.ch/lcg/releases/gcc/6.2.0-2bc78/x86_64-slc6-gcc62-opt/lib64:/cvmfs/sft.cern.ch/lcg/releases/binutils/2.28-19981/x86_64-slc6-gcc62-opt/lib
[bash][pcadp02]:build >

Cheers,
Attila

Looks like libROOTVecOps really needs to show up on the link line. The dynamic loader will then automatically load it - but dependent DSOs are apparently not “contagiously” linked :slight_smile:

Now - that still looks like a bug in our setup determining which libs to link, right? Or do you not rely on our CMake machinery to tell your CMake config which dependent targets to pull in? But spell the libraries out explicitly?

Axel.

No, we don’t use the ROOT machinery. (Unfortunately CMake’s “export mechanism” is not relocation friendly. :frowning: We have to do our own work for setting up all our externals with our own Find<Foo>.cmake modules.)

I just know that this should in principle work “on the linker level”. Since when for instance you declare that a library depends on another one privately, that info is not exported by CMake either. (Why should it be…) So when you set up a project on top of that previous installed project, and set up linking against the “first” library, CMake has no way of putting the “second” library on the linker command line as well. We need to depend on gcc/ld finding the dependent library in LD_LIBRARY_PATH.

Cheers,
Attila

Hi Attila,

Seems to be the new behavior of binutil’s ld, for some distros since a while: https://fedoraproject.org/wiki/UnderstandingDSOLinkChange Maybe Apple’s ld adopted this, too? (We always specify all dependencies, including higher order.)

Cheers, Axel.

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