root-project / root

The official repository for ROOT: analyzing, storing and visualizing big data, scientifically
https://root.cern
Other
2.72k stars 1.3k forks source link

CMake dependency on Python: use targets #6753

Closed Axel-Naumann closed 8 months ago

Axel-Naumann commented 4 years ago

Describe the bug

Because of #6563 and the fix in CMake we need to move from linking ${PYTHON_LIBRARIES} to instead depend on Python3::Python. See https://gitlab.kitware.com/cmake/cmake/-/issues/21293

This fixes test failures:

cling::DynamicLibraryManager::loadLibrary(): dlopen(/Users/sftnight/build/night/LABEL/mac1015/SPEC/noimt/V/6-22/build/lib/libPyMVA.so, 9): Library not loaded: @rpath/Python3.framework/Versions/3.8/Python3
  Referenced from: /Users/sftnight/build/night/LABEL/mac1015/SPEC/noimt/V/6-22/build/lib/libPyMVA.so
  Reason: image not found

Expected behavior

RPath correctly set.

To Reproduce

Jenkins nightly master or 6.22 on macos15, https://lcgapp-services.cern.ch/root-jenkins/view/ROOT%20Nightly/job/root-nightly-v6-22-00-patches/LABEL=mac1015,SPEC=noimt,V=6-22/

Setup

Additional context

eguiraud commented 4 years ago

Hi @Axel-Naumann , do I understand correctly that Python2 builds need no change while we can/want to make this change for Python3 builds independently of the target platform?

Axel-Naumann commented 3 years ago

This issue means that on macOS, people cannot build against the Xcode-provided Python3. I'd say that's fine for 6.24/00 - we should provide this ability at some point. So far I haven't see user complaints on this.

guitargeek commented 8 months ago

Easy to do, now that we don't support Python 2 anymore!