Error when passing parameters into custom RDataFrame column

Hi Enrico,

Thank you for the speedy reply! I am not 100% sure how to add -lROOTVecOps to the compiler invocation. I tried adding set(CMAKE_CXX_FLAGS “-lROOTVecOps”) to my CMakeLists.txt, but I get the following error when I do that… so I guess it might not be correct. Would it be possible for you to explain in a little more detail?

/cvmfs/sft.cern.ch/lcg/releases/binutils/2.30-e5b21/x86_64-centos7/bin/ld: cannot find -lROOTVecOps
collect2: error: ld returned 1 exit status

I have attached the full CMakeLists.txt just in case it helps.

Thanks again,

Jannicke

CMakeLists.txt (2.1 KB)

Ah it’s cmake! I thought it was a plain makefile. Then you add it to target_link_libraries, e.g. target_link_libraries(hhbbyy ${ROOT_LIBRARIES} ROOTVecOps).

Cheers,
Enrico

Thanks for the quick reply! Deleting everything in my build directory and rerunning cmake and make, I still seem to be getting the same error as before. I’ve double checked that the CMakeLists.txt file was updated with target_link_libraries(hhbbyy ${ROOT_LIBRARIES} ROOTVecOps), and am not sure what to check next.

[100%] **Linking CXX executable ../run/hhbbyy**
/cvmfs/sft.cern.ch/lcg/releases/binutils/2.30-e5b21/x86_64-centos7/bin/ld: cannot find -lROOTVecOps
collect2: error: ld returned 1 exit status
make[2]: *** [../run/hhbbyy] Error 1
make[1]: *** [CMakeFiles/hhbbyy.dir/all] Error 2
make: *** [all] Error 2

Let’s check the actual compilation command given: you can use e.g. make VERBOSE=1 rather than just make. Please post the full output here.

Thanks for the help. Attached is the full output with VERBOSE = 1
make_output.txt (5.2 KB)

Uhm can you please try ROOT::VecOps instead of ROOTVecOps?

Updating to target_link_libraries(hhbbyy ${ROOT_LIBRARIES} ROOT::VecOps) results in an error at the cmake step instead of the make one.

-- The C compiler identification is GNU 8.3.0
-- The CXX compiler identification is GNU 8.3.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /cvmfs/sft.cern.ch/lcg/releases/gcc/8.3.0-cebb0/x86_64-centos7/bin/gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /cvmfs/sft.cern.ch/lcg/releases/gcc/8.3.0-cebb0/x86_64-centos7/bin/g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
CMake Error at CMakeLists.txt:21 (add_executable):
  Target "hhbbyy" links to target "ROOT::VecOps" but the target was not
  found.  Perhaps a find_package() call is missing for an IMPORTED target, or
  an ALIAS target is missing?


-- Generating done
CMake Generate step failed.  Build files cannot be regenerated correctly.

Mmmh weird, is there a public repo with code and cmake files that I can check?

Also what ROOT version do you have installed?

ROOT::ROOTVecOps

Actually, “-lROOTVecOps” should automatically appear in the output of “root-config --libs” (well, probably unless there is no “veccore” among “root-config --features”) so, it should not be needed to add it again. @Axel If it does not automatically appear also in “ROOT_LIBRARIES” then for me it is a bug in “ROOTConfig.cmake”.

@oshadura do you agree? Should we open a Github issue? Or can you just fix it?

In ROOT v6.22.06 -lROOTVecOps is part of root-config --libs.

Also note that veccore is only an optional requirement of libROOTVecOps.

I’m not 100% sure what the problem is with @jpearkes 's cmake project, I would like to take a look at the repository.

The “make_output.txt” file, present in one of the previous posts above, suggests that “libROOTVecOps” was not present in “ROOT_LIBRARIES” (which originates from “ROOTConfig.cmake”, I guess).

For whatever reason, all ROOT libraries were hardcoded with “-Wl,-rpath,/.../lib” and then adding “-lROOTVecOps” did not work (maybe adding ROOT::ROOTVecOps to target_link_libraries would do the job, though).

Hi Enrico,

Sorry for the slow reply, as mentioned in my first post I am using ROOT 6.20/06. Unfortunately the code isn’t public, which makes things complicated to replicate.

Wile_E_Coyote’s suggestion of adding ROOT::ROOTVecOps to target_link_libraries seems to have worked though! Thanks for the help!

Hi Wile_E_Coyote,

Adding ROOT::ROOTVecOps to target_link_libraries worked, thank you very much!

1 Like

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

This is still unsolved in ROOT 6.22/08.

Hi @Wile_E_Coyote ,
can you please open a GitHub issue about the problem?

Cheers,
Enrico

Should be fixed in the next patch releases of 6.20 and 6.22 (i.e. 6.22/10), in 6.24/00 (coming soon) and master.

Cheers,
Enrico

This topic was automatically closed after 13 days. New replies are no longer allowed.