Hi,
In my team we use PyROOT with Anaconda. We do a manual ROOT installation. When compiling ROOT with Anaconda’s Python version, we find that ROOT’s CMake causes Python library clashes. For the following reason:
The path of the Python installation found by the SearchInstalledSoftware CMake module is automatically appended to the “CMAKE_PREFIX_PATH” variable. As a result, subsequent searches for external libraries include this path, and libraries from the Python installation are picked up. When using Python from Anaconda, this involves libraries such as “readline”, “crypto”, and “ssl”.
Linking to Anaconda libraries forces users to append the Anaconda directory to the search path for shared libraries, which makes system programs such as “wget”, “curl”, “ssh”, and “gpg” load Anaconda libraries as well. This gives problems if the system libraries have the same versions as the Anaconda libraries, but are slightly different.
We wrote a patch to CMake to avoid linking to libs from the Python install. See below. In the patch, the Python installation directory is not automatically appended to the CMAKE_PREFIX_PATH any more. If libraries or headers from this installation are required for ROOT, the paths of these components can be specified explicitly when configuring the ROOT installation.
This may not be proper code to put in ROOT as is, but we are curious to hear what the core developer(s) have to say about this issue, and how you plan to fix it.
Many thanks,
-Max
PS git diff wrt today’s master branch:
cmake/modules/SearchInstalledSoftware.cmake | 1 -
1 file changed, 1 deletion(-)
diff --git a/cmake/modules/SearchInstalledSoftware.cmake b/cmake/modules/SearchInstalledSoftware.cmake
index 67d618f…2448d8c 100644
— a/cmake/modules/SearchInstalledSoftware.cmake
+++ b/cmake/modules/SearchInstalledSoftware.cmake
@@ -434,7 +434,6 @@ if(python OR python3)
message(STATUS “Found Python interpreter version ${PYTHON_VERSION}”)
execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "import sys;sys.stdout.write(sys.prefix)"
OUTPUT_VARIABLE PYTHON_PREFIX)
- set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} ${PYTHON_PREFIX})
endif()
set(Python_ADDITIONAL_VERSIONS ${PYTHON_VERSION})
find_package(PythonLibs)
–
2.9.3