Skip to content

Commit 2342063

Browse files
committed
[CMake] Deprecate the rpath option and always append relative rpath
Since ROOT 6.36, the relative `RPATH` to the main ROOT libraries is only appended to the existing path, and not replacing the path that is e.g. passed by the user via `CMAKE_INSTALL_RPATH`. Therefore, there is no problematic side effect of `rpath=ON` anymore. We can drop this option and always append to the runpath. This makes the ROOT configuration less confusing, also because from the option name "rpath", it is not clear what it did.
1 parent b8e6652 commit 2342063

File tree

4 files changed

+15
-5
lines changed

4 files changed

+15
-5
lines changed

README/ReleaseNotes/v638/index.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
* The `ROOT::Math::TDataPointN` class that can be used with the `ROOT::Math::KDETree` was removed. Use the templated `TDataPoint<N>` instead.
88
* The Parallel ROOT Facility, `PROOF`, has been removed from the repository.
99
* After being deprecated for a long period, the `-r` option of `rootcling` has been removed.
10+
* The `rpath` build option is deprecated. It is ignored and will result in configuration errors in the upcoming ROOT 6.38.
11+
Relative RPATHs to the main ROOT libraries are unconditionally appended to all ROOT executables and libraries if the operating system supports it.
12+
If you want a ROOT build without RPATHs, use the canonical CMake variable `CMAKE_SKIP_INSTALL_RPATH=TRUE`
1013

1114
## Core Libraries
1215
* 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>`.

cmake/modules/RootBuildOptions.cmake

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,6 @@ ROOT_BUILD_OPTION(r OFF "Enable support for R bindings (requires R, Rcpp, and RI
154154
ROOT_BUILD_OPTION(roofit ON "Build the advanced fitting package RooFit, and RooStats for statistical tests. If xml is available, also build HistFactory.")
155155
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).")
156156
ROOT_BUILD_OPTION(root7 ON "Build ROOT 7 components of ROOT")
157-
ROOT_BUILD_OPTION(rpath ON "Link libraries with built-in RPATH (run-time search path)")
158157
ROOT_BUILD_OPTION(runtime_cxxmodules ON "Enable runtime support for C++ modules")
159158
ROOT_BUILD_OPTION(shadowpw OFF "Enable support for shadow passwords")
160159
ROOT_BUILD_OPTION(shared ON "Use shared 3rd party libraries if possible")
@@ -307,7 +306,6 @@ if(WIN32)
307306
set(davix_defvalue OFF)
308307
set(roofit_multiprocess_defvalue OFF)
309308
set(roottest_defvalue OFF)
310-
set(rpath_defvalue OFF)
311309
set(runtime_cxxmodules_defvalue OFF)
312310
set(testing_defvalue OFF)
313311
set(vdt_defvalue OFF)
@@ -406,6 +404,15 @@ foreach(opt )
406404
endif()
407405
endforeach()
408406

407+
if(DEFINED rpath)
408+
message(DEPRECATION ">>> Option 'rpath' is deprecated and is ignored."
409+
" Relative RPATHs to the main ROOT libraries are unconditionally appended to all ROOT"
410+
" executables and libraries. The 'rpath' flag presence will result in a configuration"
411+
" error in the next release of ROOT."
412+
" Please contact root-dev@cern.ch should you still need this option."
413+
"") # empty line at the end to make the deprecation message more visible
414+
endif()
415+
409416
foreach(opt minuit2_mpi)
410417
if(${opt})
411418
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.")

cmake/modules/RootMacros.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -975,7 +975,7 @@ function(ROOT_LINKER_LIBRARY library)
975975

976976
#----Installation details-------------------------------------------------------
977977
if(NOT ARG_TEST AND NOT ARG_NOINSTALL AND CMAKE_LIBRARY_OUTPUT_DIRECTORY)
978-
if(rpath)
978+
if(NOT MSVC)
979979
ROOT_APPEND_LIBDIR_TO_INSTALL_RPATH(${library} ${CMAKE_INSTALL_LIBDIR})
980980
endif()
981981
if(ARG_CMAKENOEXPORT)
@@ -1440,7 +1440,7 @@ function(ROOT_EXECUTABLE executable)
14401440
endif()
14411441
#----Installation details------------------------------------------------------
14421442
if(NOT ARG_NOINSTALL AND CMAKE_RUNTIME_OUTPUT_DIRECTORY)
1443-
if(rpath)
1443+
if(NOT MSVC)
14441444
ROOT_APPEND_LIBDIR_TO_INSTALL_RPATH(${executable} ${CMAKE_INSTALL_BINDIR})
14451445
endif()
14461446
if(ARG_CMAKENOEXPORT)

rootx/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@ target_include_directories(root PRIVATE
2828
${CMAKE_BINARY_DIR}/ginclude # for RConfigure.h and rootCommandLineOptionsHelp.h
2929
)
3030

31-
if(rpath)
31+
if(NOT MSVC)
3232
target_compile_definitions(root PRIVATE IS_RPATH_BUILD)
3333
endif()

0 commit comments

Comments
 (0)