root-project / root

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

Python is installed on machine but not found during configuration #8097

Closed SpectreVert closed 3 years ago

SpectreVert commented 3 years ago

environement

 (master)> cmake --version
cmake version 3.20.1
 (master)> uname -rs
Linux 5.12.0-2-default
 (master)> grep -e "^VERSION_ID=" -e "^NAME=" /etc/*release
NAME="openSUSE Tumbleweed"
VERSION_ID="20210502"
 (master)> python --version
Python 2.7.18
 (master)> python3 --version
Python 3.8.9
 (master)> whereis python
python: /usr/bin/python3.8 /usr/bin/python /usr/bin/python2.7 /usr/bin/python2.7-config /usr/lib/python3.8 /usr/lib/python2.7 /usr/lib64/python3.8 /usr/lib64/python /usr/lib64/python2.7 /usr/local/lib/python3.8 /usr/include/python2.7 /usr/include/python /usr/share/man/man1/python.1.gz
  (master)> sudo zypper se -i python | grep -e "Interpreter" -e "dev"
i  | libpython2_7-1_0       | Python Interpreter shared library                                       | package
i  | libpython3_8-1_0       | Python Interpreter shared library                                       | package
i+ | python                 | Python Interpreter                                                      | package
i  | python-base            | Python Interpreter base package                                         | package
i+ | python-devel           | Include Files and Libraries Mandatory for Building Python Modules       | package
i  | python38               | Python 3 Interpreter                                                    | package
i  | python38-base          | Python 3 Interpreter and Stdlib Core                                    | package
i  | python38-pyudev        | Udev bindings for Python                                                | package

output

-- Detected ROOT_VERSION 6.25.01
-- Looking for Python
-- Could NOT find Python3 (missing: Python3_INCLUDE_DIRS Python3_LIBRARIES Python3_NumPy_INCLUDE_DIRS Development NumPy Development.Module Development.Embed) (found version "3.8.9")
-- Could NOT find Python2 (missing: Python2_NumPy_INCLUDE_DIRS NumPy) (found version "2.7.18")
-- ROOT Platform: linux
-- ROOT Compiler: Clang 12.0.0
-- ROOT Processor: x86_64
-- ROOT Architecture: linuxx8664gcc
-- Build Type: 'Release' (flags = '-O3 -DNDEBUG')
-- Compiler Flags:  -std=c++14 -Wc++11-narrowing -Wsign-compare -Wsometimes-uninitialized -Wconditional-uninitialized -Wheader-guard -Warray-bounds -Wcomment -Wtautological-compare -Wstrncat-size -Wloop-analysis -Wbool-conversion -pipe  -Wall -W -Woverloaded-virtual -fsigned-char -pthread -O3 -DNDEBUG
-- ROOT default compression algorithm: zlib
-- PyROOT will be built for version 2.7.18
-- Looking for ZLib
-- Looking for Freetype
-- Looking for LZMA
-- Looking for X11
-- Could NOT find GIF (missing: GIF_LIBRARY GIF_INCLUDE_DIR)
-- Could NOT find TIFF (missing: TIFF_LIBRARY TIFF_INCLUDE_DIR)
-- Could NOT find PNG (missing: PNG_LIBRARY PNG_PNG_INCLUDE_DIR)
-- Could NOT find JPEG (missing: JPEG_LIBRARY JPEG_INCLUDE_DIR)
-- Building AfterImage library included in ROOT itself
-- Looking for LibXml2
-- Downloading and building XROOTD version
-- Cannot select cudnn without selecting cuda or tmva-gpu. Option is ignored
-- Building LLVM in 'Release' mode.
-- Could NOT find Z3: Found unsuitable version "0.0.0", but required is at least "4.7.1" (found Z3_LIBRARIES-NOTFOUND)
-- Native target architecture is X86
-- Threads disabled.
-- Doxygen disabled.
-- Go bindings disabled.
-- Could NOT find OCaml (missing: OCAMLFIND OCAML_VERSION OCAML_STDLIB_PATH)
-- OCaml bindings disabled.
-- LLVM host triple: x86_64-unknown-linux-gnu
-- LLVM default target triple: x86_64-unknown-linux-gnu
-- Building with -fPIC
-- Constructing LLVMBuild project information
-- Linker detection: GNU ld
-- Targeting X86
-- Targeting NVPTX
-- Clang version: 9.0.1
-- Cling version (from VERSION file): ROOT_0.9
-- Cling will look for C++ headers in '/usr/bin/../lib64/gcc/x86_64-suse-linux/10/../../../../include/c++/10:/usr/bin/../lib64/gcc/x86_64-suse-linux/10/../../../../include/c++/10/x86_64-suse-linux:/usr/bin/../lib64/gcc/x86_64-suse-linux/10/../../../../include/c++/10/backward' at runtime.
-- And then fallback to: 'clang-12.0.0'
-- Performing Test found_stdstringview
-- Performing Test found_stdstringview - Failed
-- Performing Test found_stdexpstringview
-- Performing Test found_stdexpstringview - Success
-- Performing Test found_stod_stringview
-- Performing Test found_stod_stringview - Failed
-- Performing Test found_stdapply
-- Performing Test found_stdapply - Failed
-- Performing Test found_stdinvoke
-- Performing Test found_stdinvoke - Failed
-- Performing Test found_stdindexsequence
-- Performing Test found_stdindexsequence - Success
-- ROOT Configuration

System          Linux-5.11.16-1-default
Processor       6 core AMD Ryzen 5 3600XT 6-Core Processor (x86_64)
Build type      Release
Install path    /usr/local
Compiler        Clang 12.0.0
Compiler flags:
C                -pipe -Wall -W -pthread -O3 -DNDEBUG
C++              -std=c++14 -Wc++11-narrowing -Wsign-compare -Wsometimes-uninitialized -Wconditional-uninitialized -Wheader-guard -Warray-bounds -Wcomment -Wtautological-compare -Wstrncat-size -Wloop-analysis -Wbool-conversion -pipe  -Wall -W -Woverloaded-virtual -fsigned-char -pthread -O3 -DNDEBUG
Linker flags:
Executable       -rdynamic
Module
Shared           -Wl,--no-undefined

-- Enabled support for:  asimage builtin_afterimage builtin_clang builtin_cling builtin_llvm builtin_lz4 builtin_nlohmannjson builtin_openui5 builtin_pcre builtin_tbb builtin_vdt builtin_xrootd builtin_xxhash builtin_zstd clad dataframe exceptions gdml http imt mlp roofit webgui root7 runtime_cxxmodules shared ssl tmva spectrum vdt x11 xml xrootd
-- Configuring done
-- Generating done

Strangely enough the cmake outputs -- PyROOT will be built for version 2.7.18

SpectreVert commented 3 years ago

I've also tried

cmake  -DPython3_EXECUTABLE=/usr/bin/python3.8 -DPython2_EXECUTABLE=/usr/bin/python2.7 ..

and after seeing issue #8095 I've tried manually setting the flags Python3_* and using -DPyRoot=on but no changes to the following output:

-- Detected ROOT_VERSION 6.24.99
-- Looking for Python
-- Could NOT find Python3 (missing: Python3_INCLUDE_DIRS Python3_LIBRARIES Python3_NumPy_INCLUDE_DIRS Development NumPy Development.Module Development.Embed) (found version "3.8.9")
-- Could NOT find Python2 (missing: Python2_NumPy_INCLUDE_DIRS NumPy) (found version "2.7.18")
-- ROOT Platform: linux
-- ROOT Compiler: Clang 12.0.0
-- ROOT Processor: x86_64
-- ROOT Architecture: linuxx8664gcc
-- Build Type: 'Release' (flags = '-O2')
-- Compiler Flags:  -std=c++14 -Wc++11-narrowing -Wsign-compare -Wsometimes-uninitialized -Wconditional-uninitialized -Wheader-guard -Warray-bounds -Wcomment -Wtautological-compare -Wstrncat-size -Wloop-analysis -Wbool-conversion -pipe  -Wall -W -Woverloaded-virtual -fsigned-char -pthread -O2
-- ROOT default compression algorithm: zlib
-- PyROOT will be built for version 2.7.18
-- Looking for ZLib
-- Looking for Freetype
-- Looking for LZMA
-- Looking for X11
-- Could NOT find GIF (missing: GIF_LIBRARY GIF_INCLUDE_DIR)
-- Could NOT find TIFF (missing: TIFF_LIBRARY TIFF_INCLUDE_DIR)
-- Could NOT find PNG (missing: PNG_LIBRARY PNG_PNG_INCLUDE_DIR)
-- Could NOT find JPEG (missing: JPEG_LIBRARY JPEG_INCLUDE_DIR)
-- Building AfterImage library included in ROOT itself
-- Looking for LibXml2
-- Downloading and building XROOTD version
-- Cannot select cudnn without selecting cuda or tmva-gpu. Option is ignored
-- Building LLVM in 'Release' mode.
-- Could NOT find Z3: Found unsuitable version "0.0.0", but required is at least "4.7.1" (found Z3_LIBRARIES-NOTFOUND)
-- Native target architecture is X86
-- Threads disabled.
-- Doxygen disabled.
-- Go bindings enabled.
-- Could NOT find OCaml (missing: OCAMLFIND OCAML_VERSION OCAML_STDLIB_PATH)
-- Could NOT find OCaml (missing: OCAMLFIND OCAML_VERSION OCAML_STDLIB_PATH)
-- OCaml bindings disabled.
-- LLVM host triple: x86_64-unknown-linux-gnu
-- LLVM default target triple: x86_64-unknown-linux-gnu
-- Building with -fPIC
-- Constructing LLVMBuild project information
-- Linker detection: GNU ld
-- Targeting X86
-- Targeting NVPTX
-- Clang version: 9.0.1
-- Cling version (from VERSION file): ROOT_0.9~dev
-- Cling will look for C++ headers in '/usr/bin/../lib64/gcc/x86_64-suse-linux/10/../../../../include/c++/10:/usr/bin/../lib64/gcc/x86_64-suse-linux/10/../../../../include/c++/10/x86_64-suse-linux:/usr/bin/../lib64/gcc/x86_64-suse-linux/10/../../../../include/c++/10/backward' at runtime.
-- And then fallback to: 'clang-12.0.0'
-- Performing Test found_stdstringview
-- Performing Test found_stdstringview - Failed
-- Performing Test found_stdexpstringview
-- Performing Test found_stdexpstringview - Success
-- Performing Test found_stod_stringview
-- Performing Test found_stod_stringview - Failed
-- Performing Test found_stdapply
-- Performing Test found_stdapply - Failed
-- Performing Test found_stdinvoke
-- Performing Test found_stdinvoke - Failed
-- Performing Test found_stdindexsequence
-- Performing Test found_stdindexsequence - Success
-- 551/856 C++ tutorials have been activated.
-- Check for bitness: Found 64 bit architecture.
-- Scanning subdirectories for tests...
-- ROOT Configuration

System          Linux-5.12.0-2-default
Processor       6 core AMD Ryzen 5 3600XT 6-Core Processor (x86_64)
Build type      Release
Install path    /usr/local
Compiler        Clang 12.0.0
Compiler flags:
C                -pipe -Wall -W -pthread -O2 -DNDEBUG
C++              -std=c++14 -Wc++11-narrowing -Wsign-compare -Wsometimes-uninitialized -Wconditional-uninitialized -Wheader-guard -Warray-bounds -Wcomment -Wtautological-compare -Wstrncat-size -Wloop-analysis -Wbool-conversion -pipe  -Wall -W -Woverloaded-virtual -fsigned-char -pthread -O2 -DNDEBUG
Linker flags:
Executable       -rdynamic
Module
Shared           -Wl,--no-undefined

-- Enabled support for:  asimage builtin_afterimage builtin_clang builtin_cling builtin_llvm builtin_lz4 builtin_nlohmannjson builtin_openui5 builtin_pcre builtin_tbb builtin_vdt builtin_xrootd builtin_xxhash builtin_zstd clad dataframe exceptions gdml http imt mlp roofit webgui root7 runtime_cxxmodules shared ssl tmva spectrum vdt x11 xml xrootd
-- Configuring done
-- Generating done
oshadura commented 3 years ago

It looks like that Costa found a bug introduced with new cmake version 3.20...

CC: @maxgalli (as a person who knows probably the most about CMake Python discovery process)

oshadura commented 3 years ago

No, actually I was not exactly correct @SpectreVert, you need to start to check https://cmake.org/cmake/help/latest/module/FindPython3.html and https://cmake.org/cmake/help/latest/module/FindPython2.html since we use them and check which variables are not populated?

oshadura commented 3 years ago

I just checked on my Manjaro with cmake 3.20, and it seems to be working, even though messages are misleading:

-- Could NOT find Python3 (missing: Python3_NumPy_INCLUDE_DIRS NumPy) (found version "3.9.4")
-- Could NOT find Python2 (missing: Python2_NumPy_INCLUDE_DIRS NumPy) (found version "2.7.18")
-- Found GCC. Major version 10, minor version 2
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Performing Test GLIBCXX_USE_CXX11_ABI
-- Performing Test GLIBCXX_USE_CXX11_ABI - Success
-- ROOT Platform: linux
-- ROOT Compiler: GNU 10.2.0
-- ROOT Processor: x86_64
-- ROOT Architecture: linuxx8664gcc
-- Build Type: 'Release' (flags = '-O3 -DNDEBUG')
-- Compiler Flags:  -std=c++14 -Wno-implicit-fallthrough -Wno-noexcept-type -pipe  -Wshadow -Wall -W -Woverloaded-virtual -fsigned-char -pthread -O3 -DNDEBUG
-- ROOT default compression algorithm: zlib
-- PyROOT will be built for versions 3.9.4 (Main) and 2.7.18
oshadura commented 3 years ago

Could you please investigate what could happen on your machine?

SpectreVert commented 3 years ago

I've tried to replicate the issue on a second machine running openSUSE Leap 15.2 and I got no problems

-- Detected ROOT_VERSION 6.25.01
-- Looking for Python
-- Could NOT find Python2 (missing: Python2_NumPy_INCLUDE_DIRS NumPy) (found version "2.7.18")
...
-- ROOT Platform: linux
-- ROOT Compiler: GNU 9.3.1
-- ROOT Processor: x86_64
-- ROOT Architecture: linuxx8664gcc
...
-- Compiler Flags:  -std=c++14 -Wc++11-narrowing -Wsign-compare -Wsometimes-uninitialized -Wconditional-uninitialized -Wheader-guard -Warray-bounds -Wcomment -Wtautological-compare -Wstrncat-size -Wloop-analysis -Wbool-conversion -pipe  -Wall -W -Woverloaded-virtual -fsigned-char -pthread -O3 -DNDEBUG
-- PyROOT will be built for versions 3.8.9 (Main) and 2.7.18
-- Linker detection: GNU ld

I'm almost certain now that this issue is linked to Tumbleweed and/or the vendor (package providor) that I'm using as available packages for python3 development files differ between the two machines:

Leap 15.2

i  | libpython2_7-1_0            | Python Interpreter shared library                                              | package
i  | libpython3_8-1_0            | Python Interpreter shared library                                              | package
i+ | python                      | Python Interpreter                                                             | package
i  | python-base                 | Python Interpreter base package                                                | package
i+ | python-devel                | Include Files and Libraries Mandatory for Building Python Modules              | package
i  | python38                    | Python 3 Interpreter                                                           | package
i  | python38-base               | Python 3 Interpreter and Stdlib Core                                           | package
i  | python38-devel              | Include Files and Libraries Mandatory for Building Python Modules              | package
i  | python38-pyudev             | Udev bindings for Python                                                       | package

Tumbleweed 20210502

i  | devel_python3                       | Python 3 Developement                                                          | pattern
i  | libpython2_7-1_0                    | Python Interpreter shared library                                              | package
i  | libpython3_8-1_0                    | Python Interpreter shared library                                              | package
i+ | patterns-devel-python-devel_python3 | Python 3 Developement                                                          | package
i+ | python                              | Python Interpreter                                                             | package
i  | python-base                         | Python Interpreter base package                                                | package
i+ | python-devel                        | Include Files and Libraries Mandatory for Building Python Modules              | package
i  | python38                            | Python 3 Interpreter                                                           | package
i  | python38-base                       | Python 3 Interpreter and Stdlib Core                                           | package
i  | python38-pyudev                     | Udev bindings for Python                                                       | package

Cannot find the ptython38-devel package in Tumbleweed and instead we have this rather strange looking devel_python3 and the usual patterns-devel package.

Even though it seems strange that FindPython3 does not trigger in Tumbleweed, I will close the issue for now as it most probably is not a ROOT issue. I will be upgrading to 20210503 and await further package updates to see if the issue resolves itself.

ynikitenko commented 1 year ago

I've just got the same behaviour. Fortunately, you pointed to the line

-- PyROOT will be built for versions 3.10.10 (Main) and 2.7.18

which is important for me, I absolutely must have Python 2 support, because that is our ROOT version on the cluster. But this message is very distracting.

Why was this issue closed? Is it ROOT problem or of another program, how do we know that? Was there a bug filed to another program?

I don't know what Tumbleweed is, I use Arch Linux and installed Python 2 from AUR and trying to install ROOT from the latest source.

I think if ROOT uses this build method, it would be great if it could be somehow fixed.

ynikitenko commented 1 year ago

Does anyone see this comment? Should I open a new issue?