Uploaded image for project: 'ROOT'
  1. ROOT
  2. ROOT-9143

Build system finds wrong versions of Python

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: 6.12/00, 6.10/08, 6.11/02
    • Fix Version/s: 6.14/00
    • Component/s: Build System
    • Labels:
      None
    • Environment:

      Linux

    • Development:

      Description

      Our current CMake code for finding Python behaves like this on my machine (I have python 2.7.14, 3.5.4, and 3.6.3 installed, and 3.6 is the active version):

      epsft-53 cmake $ python --version
      Python 3.6.3
      epsft-53 cmake $ rm -f CMakeCache.txt && cmake ${PWD} -Dpython3=ON
      -- The C compiler identification is GNU 7.2.0
      -- The CXX compiler identification is GNU 7.2.0
      -- Check for working C compiler: /usr/lib/ccache/bin/cc
      -- Check for working C compiler: /usr/lib/ccache/bin/cc -- works
      -- Detecting C compiler ABI info
      -- Detecting C compiler ABI info - done
      -- Detecting C compile features
      -- Detecting C compile features - done
      -- Check for working CXX compiler: /usr/lib/ccache/bin/c++
      -- Check for working CXX compiler: /usr/lib/ccache/bin/c++ -- works
      -- Detecting CXX compiler ABI info
      -- Detecting CXX compiler ABI info - done
      -- Detecting CXX compile features
      -- Detecting CXX compile features - done
      -- Looking for Python
      -- Found PythonInterp: /usr/bin/python3.5 (found suitable version "3.5.4", minimum required is "3.5") 
      -- Found Python interpreter version 3.5
      -- Found PythonLibs: /usr/lib/libpython3.5m.so (found version "3.5.4") 
      -- Found PythonInterp: /usr/bin/python3.5 (found version "3.5.4") 
      -- Found NUMPY: /usr/lib64/python3.5/site-packages/numpy/core/include (found version "1.13.3") 
      -- PYTHONINTERP_FOUND = TRUE
      -- PYTHON_EXECUTABLE = /usr/bin/python3.5
      -- PYTHON_VERSION_STRING = 3.5.4
      -- PYTHON_VERSION_MAJOR = 3
      -- PYTHON_VERSION_MINOR = 5
      -- PYTHON_VERSION_PATCH = 4
      -- Python_ADDITIONAL_VERSIONS = 3.5
      -- PYTHONLIBS_FOUND TRUE
      -- PYTHON_LIBRARIES /usr/lib/libpython3.5m.so
      -- PYTHON_INCLUDE_PATH /usr/include/python3.5m
      -- PYTHON_INCLUDE_DIRS /usr/include/python3.5m
      -- PYTHON_DEBUG_LIBRARIES 
      -- PYTHONLIBS_VERSION_STRING 3.5.4
      -- PYTHON_LIBRARY /usr/lib/libpython3.5m.so
      -- PYTHON_INCLUDE_DIR /usr/include/python3.5m
      -- Configuring done
      -- Generating done
      -- Build files have been written to: /tmp/cmake
      epsft-53 cmake $ rm -f CMakeCache.txt && cmake ${PWD} -Dpython3=OFF
      -- The C compiler identification is GNU 7.2.0
      -- The CXX compiler identification is GNU 7.2.0
      -- Check for working C compiler: /usr/lib/ccache/bin/cc
      -- Check for working C compiler: /usr/lib/ccache/bin/cc -- works
      -- Detecting C compiler ABI info
      -- Detecting C compiler ABI info - done
      -- Detecting C compile features
      -- Detecting C compile features - done
      -- Check for working CXX compiler: /usr/lib/ccache/bin/c++
      -- Check for working CXX compiler: /usr/lib/ccache/bin/c++ -- works
      -- Detecting CXX compiler ABI info
      -- Detecting CXX compiler ABI info - done
      -- Detecting CXX compile features
      -- Detecting CXX compile features - done
      -- Looking for Python
      -- Found PythonInterp: /usr/bin/python (found version "3.6.3") 
      -- Found Python interpreter version 3.6
      -- Found PythonLibs: /usr/lib/libpython3.6m.so (found version "3.6.3") 
      -- Found NUMPY: /usr/lib64/python3.6/site-packages/numpy/core/include (found version "1.13.3") 
      -- PYTHONINTERP_FOUND = TRUE
      -- PYTHON_EXECUTABLE = /usr/bin/python
      -- PYTHON_VERSION_STRING = 3.6.3
      -- PYTHON_VERSION_MAJOR = 3
      -- PYTHON_VERSION_MINOR = 6
      -- PYTHON_VERSION_PATCH = 3
      -- Python_ADDITIONAL_VERSIONS = 3.6
      -- PYTHONLIBS_FOUND TRUE
      -- PYTHON_LIBRARIES /usr/lib/libpython3.6m.so
      -- PYTHON_INCLUDE_PATH /usr/include/python3.6m
      -- PYTHON_INCLUDE_DIRS /usr/include/python3.6m
      -- PYTHON_DEBUG_LIBRARIES 
      -- PYTHONLIBS_VERSION_STRING 3.6.3
      -- PYTHON_LIBRARY /usr/lib/libpython3.6m.so
      -- PYTHON_INCLUDE_DIR /usr/include/python3.6m
      -- Configuring done
      -- Generating done
      -- Build files have been written to: /tmp/cmake

      As it can be seen above, enabling the option python3 actually makes ROOT detect the wrong version of Python, instead of the correct one. This is bad, because when running the tests, ROOT will not use python3.5, as detected, but python or python3, which makes all python tests fail on my machine, since it's using the wrong interpreter (compiled against Python 3.5.4, but is trying to run tests with Python 3.6.3 interpreter).

        Attachments

          Activity

            People

            Assignee:
            amadio Guilherme Amadio
            Reporter:
            amadio Guilherme Amadio
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: