Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FindXROOTD adds libraries to link against irrespective of xrootd version used #11750

Closed
andresailer opened this issue Nov 21, 2022 · 7 comments · Fixed by #13752 or #14180
Closed

FindXROOTD adds libraries to link against irrespective of xrootd version used #11750

andresailer opened this issue Nov 21, 2022 · 7 comments · Fixed by #13752 or #14180
Assignees

Comments

@andresailer
Copy link
Contributor

Dear ROOT devs,

These lines in the FindXROOTD

# libXrdClient (old client; will be dropped at some point)
find_library(XROOTD_XrdClient_LIBRARY
NAMES XrdClient
HINTS ${searchpath}
PATH_SUFFIXES lib)
if (XROOTD_XrdClient_LIBRARY)
list(APPEND XROOTD_LIBRARIES ${XROOTD_XrdClient_LIBRARY})
else ()
set(XROOTD_NOOLDCLNT TRUE)
if(NOT XROOTD_FIND_QUIETLY)
message(STATUS " libXrdClient not found: use built-in")
endif ()
endif ()

make some root libraries, e.g., libNetxNG.so, link against old versions of xrootd if they are found on the system, even though one wants to build against the new version of xrootd.
We for SPI run into this problem when building on a machine which just happens to have this installed, and we cannot control the packages.

e.g. this is printed during configure:

-- Found Xrootd version num: 5.3.1 (setting -DROOTXRDVERS=500030001)
--
--              libXrdMain not found: xproofd will be a wrapper around xrootd
--              include_dirs: /data/sftnight/build/workspace/lcg_release_pipeline/install/xrootd/5.3.1/aarch64-centos7-gcc8-opt/include/xrootd;/data/sftnight/build/workspace/lcg_release_pipeline/install/xrootd/5.3.1/aarch64-centos7-gcc8-opt/include/xrootd/private
--              libraries: /data/sftnight/build/workspace/lcg_release_pipeline/install/xrootd/5.3.1/aarch64-centos7-gcc8-opt/lib64/libXrdUtils.so;/usr/lib64/libXrdClient.so;/data/sftnight/build/workspace/lcg_release_pipeline/install/xrootd/5.3.1/aarch64-centos7-gcc8-opt/lib64/libXrdCl.so

This then causes problem when our ROOT is used on some other machine.
So at the moment we just patch these lines out. If you could consider dropping them, or some check based on xrootd version?

Thanks,
Andre

@bellenot bellenot self-assigned this Nov 21, 2022
@bellenot
Copy link
Member

bellenot commented Dec 6, 2022

Can't you simply use the -Dbuiltin_xrootd=ON option?

@andresailer
Copy link
Contributor Author

No, we don't want to use the builtin xrootd.

@bellenot
Copy link
Member

bellenot commented Dec 6, 2022

And I suppose adding the XROOTD you want in CMAKE_PREFIX_PATH doesn't help either? So should we introduce a way of specifying which version and/or which location XROOTD is taken from? Does XROOTD provide a standard way of finding it with CMake?

@andresailer
Copy link
Contributor Author

The problem is that find_library just looks in the system library location finds the library and makes ROOT link against it. So something like if version < 5 around this find_library call would probably already solve the issue.

I.e., from the opening post this finds xrootd version 5.3.1 from where we put it, but then just adds /usr/lib64/libXrdClient.so into the mix

--              libraries: /data/sftnight/build/workspace/lcg_release_pipeline/install/xrootd/5.3.1/aarch64-centos7-gcc8-opt/lib64/libXrdUtils.so;/usr/lib64/libXrdClient.so;/data/sftnight/build/workspace/lcg_release_pipeline/install/xrootd/5.3.1/aarch64-centos7-gcc8-opt/lib64/libXrdCl.so

@bellenot
Copy link
Member

bellenot commented Dec 6, 2022

OK, then I'll need to set-up a VM and investigate...

@bellenot
Copy link
Member

bellenot commented Dec 6, 2022

I think we should rely on XRootDConfig.cmake, but I'll have to see the implications

@guitargeek
Copy link
Contributor

Re-opened because the XRootDConfig.cmake from xrootd upstream didn't work after all, see:
#14170

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
3 participants