Dear Experrs,
I am using ROOT 6.23/01 form cmvfs dev3/nightlies slot:
source /cvmfs/sft.cern.ch/lcg/views/dev3/latest/x86_64-centos7-gcc9-opt/setup.sh
and then I am using a kind of test CMAKE project with CMakeLists.txt
file
project (MyProject)
cmake_minimum_required(VERSION 3.3 FATAL_ERROR)
find_package(ROOT 6 CONFIG REQUIRED )
message ( "----> ROOT version : " ${ROOT_VERSION} )
# =============================================================================
## Locate proper Python/PythonLibs
find_program(ROOT_CONFIG_EXECUTABLE NAMES root-config)
message ( "ROOT_CONFIG_EXECUTABLE " ${ROOT_CONFIG_EXECUTABLE} )
execute_process( COMMAND "${ROOT_CONFIG_EXECUTABLE}" --python2-version
OUTPUT_VARIABLE PY2VERSION_ROOT
OUTPUT_STRIP_TRAILING_WHITESPACE )
execute_process( COMMAND "${ROOT_CONFIG_EXECUTABLE}" --python3-version
OUTPUT_VARIABLE PY3VERSION_ROOT
OUTPUT_STRIP_TRAILING_WHITESPACE )
message ('PY2VERSION_ROOT:' ${PY2VERSION_ROOT} )
message ('PY3VERSION_ROOT:' ${PY3VERSION_ROOT} )
if (PY2VERSION_ROOT)
find_package(Python2 ${PY2VERSION_ROOT} COMPONENTS Interpreter Development NumPy)
set(Python_VERSION ${Python2_VERSION} )
if (Python2_FOUND)
message ( "Python version: " ${Python2_VERSION} )
else()
message ( "Python2 is NOT FOUND!" )
endif()
elseif (PY3VERSION_ROOT)
find_package(Python3 ${PY3VERSION_ROOT} COMPONENTS Interpreter Development NumPy)
set(Python_VERSION ${Python3_VERSION} )
if (Python3_FOUND)
message ( "Python version: " ${Python3_VERSION} )
else()
message ( "Python3 is NOT FOUND!" )
endif()
endif ()
and surprizingly I see the following message:
----> ROOT version : 6.23.01
ROOT_CONFIG_EXECUTABLE /cvmfs/sft-nightlies.cern.ch/lcg/views/dev3/Wed/x86_64-centos7-gcc9-opt/bin/root-config
'PY2VERSION_ROOT:'2.7.16
'PY3VERSION_ROOT:'
-- Could NOT find Python2: Found unsuitable version "2.7.13", but required is at least "2.7.16" (found /cvmfs/lhcb.cern.ch/lib/var/lib/LbEnv/941/stable/x86_64-centos7/bin/python2.7)
Python2 is NOT FOUND!
-- Configuring done
You see CMAKE picks up python “LHCb” - and not from LCG!
How can I force it to find and use LCG version?
or interactive stuff it picks up the correct version from LCG:
>where python
/cvmfs/sft-nightlies.cern.ch/lcg/views/dev3/Tue/x86_64-centos7-gcc9-opt/bin/python
/cvmfs/lhcb.cern.ch/lib/var/lib/LbEnv/941/stable/x86_64-centos7/bin/python
/usr/bin/python
What is correct way in for CMAKE project to access correct ROOT+python ?
Please read tips for efficient and successful posting and posting code
_ROOT Version: 6.23/01
_Platform: Centos7, LCG-nightlies from cvmfs
_Compiler: gcc9