Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README/ReleaseNotes/v638/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
* The `ROOT::Math::TDataPointN` class that can be used with the `ROOT::Math::KDETree` was removed. Use the templated `TDataPoint<N>` instead.
* The Parallel ROOT Facility, `PROOF`, has been removed from the repository.
* After being deprecated for a long period, the `-r` option of `rootcling` has been removed.
* The `rpath` build option is deprecated. It is now without effect.
Relative RPATHs to the main ROOT libraries are unconditionally appended to all ROOT executables and libraries if the operating system supports it.
If you want a ROOT build without RPATHs, use the canonical CMake variable `CMAKE_SKIP_INSTALL_RPATH=TRUE`.

## Core Libraries
* Behavior change: when selecting a template instantiation for a dictionary, all the template arguments have to be fully defined - the forward declarations are not enough any more. The error prompted by the dictionary generator will be `Warning: Unused class rule: MyTemplate<MyFwdDeclaredClass>`.
Expand Down
23 changes: 4 additions & 19 deletions bindings/pyroot/cppyy/CPyCppyy/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -112,29 +112,14 @@ target_include_directories(CPyCppyy
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
)

set_property(GLOBAL APPEND PROPERTY ROOT_EXPORTED_TARGETS CPyCppyy)
set_property(GLOBAL APPEND PROPERTY ROOT_EXPORTED_TARGETS cppyy)

if(NOT MSVC)
# Make sure that relative RUNPATH to main ROOT libraries is always correct.

file(RELATIVE_PATH pymoduledir_to_libdir_build ${localruntimedir} "${localruntimedir}")
file(RELATIVE_PATH pymoduledir_to_libdir_install ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_PYTHONDIR} "${CMAKE_INSTALL_FULL_LIBDIR}")

if(APPLE)
set_target_properties(cppyy PROPERTIES
BUILD_RPATH "@loader_path/${pymoduledir_to_libdir_build}"
INSTALL_RPATH "@loader_path/${pymoduledir_to_libdir_install}"
)
else()
set_target_properties(cppyy PROPERTIES
BUILD_RPATH "$ORIGIN/${pymoduledir_to_libdir_build}"
INSTALL_RPATH "$ORIGIN/${pymoduledir_to_libdir_install}"
)
endif()

ROOT_APPEND_LIBDIR_TO_INSTALL_RPATH(cppyy ${CMAKE_INSTALL_PYTHONDIR})
endif()

set_property(GLOBAL APPEND PROPERTY ROOT_EXPORTED_TARGETS CPyCppyy)
set_property(GLOBAL APPEND PROPERTY ROOT_EXPORTED_TARGETS cppyy)

# Install library
install(TARGETS CPyCppyy EXPORT ${CMAKE_PROJECT_NAME}Exports
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT libraries
Expand Down
17 changes: 1 addition & 16 deletions bindings/pyroot/pythonizations/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -227,22 +227,7 @@ endif()

if(NOT MSVC)
# Make sure that relative RUNPATH to main ROOT libraries is always correct.

file(RELATIVE_PATH pymoduledir_to_libdir_build ${pymoduledir_build} "${localruntimedir}")
file(RELATIVE_PATH pymoduledir_to_libdir_install ${CMAKE_INSTALL_PREFIX}/${pymoduledir_install} "${CMAKE_INSTALL_FULL_LIBDIR}")

if(APPLE)
set_target_properties(${libname} PROPERTIES
BUILD_RPATH "@loader_path/${pymoduledir_to_libdir_build}"
INSTALL_RPATH "@loader_path/${pymoduledir_to_libdir_install}"
)
else()
set_target_properties(${libname} PROPERTIES
BUILD_RPATH "$ORIGIN/${pymoduledir_to_libdir_build}"
INSTALL_RPATH "$ORIGIN/${pymoduledir_to_libdir_install}"
)
endif()

ROOT_APPEND_LIBDIR_TO_INSTALL_RPATH(${libname} ${pymoduledir_install})
endif()

# Install library
Expand Down
27 changes: 8 additions & 19 deletions cmake/modules/RootBuildOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@ ROOT_BUILD_OPTION(r OFF "Enable support for R bindings (requires R, Rcpp, and RI
ROOT_BUILD_OPTION(roofit ON "Build the advanced fitting package RooFit, and RooStats for statistical tests. If xml is available, also build HistFactory.")
ROOT_BUILD_OPTION(roofit_multiprocess OFF "Build RooFit::MultiProcess and multi-process RooFit::TestStatistics classes (requires ZeroMQ >= 3.4.5 built with -DENABLE_DRAFTS and cppzmq).")
ROOT_BUILD_OPTION(root7 ON "Build ROOT 7 components of ROOT")
ROOT_BUILD_OPTION(rpath ON "Link libraries with built-in RPATH (run-time search path)")
ROOT_BUILD_OPTION(runtime_cxxmodules ON "Enable runtime support for C++ modules")
ROOT_BUILD_OPTION(shadowpw OFF "Enable support for shadow passwords")
ROOT_BUILD_OPTION(shared ON "Use shared 3rd party libraries if possible")
Expand Down Expand Up @@ -307,7 +306,6 @@ if(WIN32)
set(davix_defvalue OFF)
set(roofit_multiprocess_defvalue OFF)
set(roottest_defvalue OFF)
set(rpath_defvalue OFF)
set(runtime_cxxmodules_defvalue OFF)
set(testing_defvalue OFF)
set(vdt_defvalue OFF)
Expand Down Expand Up @@ -406,6 +404,14 @@ foreach(opt )
endif()
endforeach()

if(DEFINED rpath)
message(DEPRECATION ">>> Option 'rpath' is deprecated and without effect."
" See https://root.cern/doc/v638/release-notes.html"
" Relative RPATHs to the main ROOT libraries are unconditionally appended to all ROOT"
" executables and libraries."
"") # empty line at the end to make the deprecation message more visible
endif()

foreach(opt minuit2_mpi)
if(${opt})
message(WARNING "The option '${opt}' can only be used to minimise thread-safe functions in Minuit2. It cannot be used for Histogram/Graph fitting and for RooFit. If you want to use Minuit2 with MPI support, it is better to build Minuit2 as a standalone library.")
Expand All @@ -423,23 +429,6 @@ include(RootInstallDirs)
# add to RPATH any directories outside the project that are in the linker search path
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)

if(rpath)
file(RELATIVE_PATH BINDIR_TO_LIBDIR "${CMAKE_INSTALL_FULL_BINDIR}" "${CMAKE_INSTALL_FULL_LIBDIR}")

if(APPLE)
set(CMAKE_MACOSX_RPATH TRUE)
set(CMAKE_INSTALL_NAME_DIR "@rpath")

set(_rpath_values "@loader_path" "@loader_path/${BINDIR_TO_LIBDIR}")
else()
set(_rpath_values "$ORIGIN" "$ORIGIN/${BINDIR_TO_LIBDIR}")
endif()

set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_RPATH-CACHED};${_rpath_values}" CACHE STRING "Install RPATH" FORCE)

unset(BINDIR_TO_LIBDIR)
endif()

#---deal with the DCMAKE_IGNORE_PATH------------------------------------------------------------
if(macos_native)
if(APPLE)
Expand Down
32 changes: 32 additions & 0 deletions cmake/modules/RootMacros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -975,6 +975,9 @@ function(ROOT_LINKER_LIBRARY library)

#----Installation details-------------------------------------------------------
if(NOT ARG_TEST AND NOT ARG_NOINSTALL AND CMAKE_LIBRARY_OUTPUT_DIRECTORY)
if(NOT MSVC)
ROOT_APPEND_LIBDIR_TO_INSTALL_RPATH(${library} ${CMAKE_INSTALL_LIBDIR})
endif()
if(ARG_CMAKENOEXPORT)
install(TARGETS ${library} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT libraries
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT libraries
Expand Down Expand Up @@ -1437,6 +1440,9 @@ function(ROOT_EXECUTABLE executable)
endif()
#----Installation details------------------------------------------------------
if(NOT ARG_NOINSTALL AND CMAKE_RUNTIME_OUTPUT_DIRECTORY)
if(NOT MSVC)
ROOT_APPEND_LIBDIR_TO_INSTALL_RPATH(${executable} ${CMAKE_INSTALL_BINDIR})
endif()
if(ARG_CMAKENOEXPORT)
install(TARGETS ${executable} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT applications)
else()
Expand Down Expand Up @@ -2073,6 +2079,32 @@ function(generateManual name input output)
install(FILES ${output} DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
endfunction()

#----------------------------------------------------------------------------
# --- ROOT_APPEND_LIBDIR_TO_INSTALL_RPATH(target install_dir)
#
# Sets the INSTALL_RPATH for a given target so that it can find the ROOT shared
# libraries at runtime. The RPATH is set relative to the target's own location
# using $ORIGIN (or @loader_path on macOS).
#
# Arguments:
# target - The CMake target (e.g., a shared library or executable)
# install_dir - The install subdirectory relative to CMAKE_INSTALL_PREFIX
#----------------------------------------------------------------------------
function(ROOT_APPEND_LIBDIR_TO_INSTALL_RPATH target install_dir)
file(RELATIVE_PATH to_libdir "${CMAKE_INSTALL_PREFIX}/${install_dir}" "${CMAKE_INSTALL_FULL_LIBDIR}")

# New path
if(APPLE)
set(new_rpath "@loader_path/${to_libdir}")
else()
set(new_rpath "$ORIGIN/${to_libdir}")
endif()

# Append to existing RPATH
set_property(TARGET ${target} APPEND PROPERTY INSTALL_RPATH "${new_rpath}")
endfunction()


#-------------------------------------------------------------------------------
#
# Former RoottestMacros.cmake starts here
Expand Down
2 changes: 1 addition & 1 deletion rootx/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ target_include_directories(root PRIVATE
${CMAKE_BINARY_DIR}/ginclude # for RConfigure.h and rootCommandLineOptionsHelp.h
)

if(rpath)
if(NOT MSVC AND NOT CMAKE_SKIP_INSTALL_RPATH)
target_compile_definitions(root PRIVATE IS_RPATH_BUILD)
endif()
Loading