No python CMAKE flag in root-config from 6.20

Hello

Just a quick question. I noticed that with version greater than 6.20, few information have disappeared from :
root-config --config

with 6.18 and lower I had this :

PYTHON_INCLUDE_DIR=/usr/include/python2.7
PYTHON_LIBRARY=/usr/lib64/libpython2.7.so
PYTHON_LIBRARY_RELEASE=/usr/lib64/libpython2.7.so

This was pretty useful for us as we come as an extra layer, on top of you, we used this for consistency to be sure that python version used with ROOT is the same as the one requested by our user wen installing our platform.
Would it be possible to bring this information back ?

cheers
jb


_ROOT Version: > 6.20.00
_Platform: Fedora 26 x64
_Compiler: gcc7.1 / cmake 3.16


With ROOT 6.20/xy you should still have some variables, e.g.:

[...]$ root-config --config | grep PYTHON
... PYTHON_INCLUDE_DIRS=/usr/include/python3.8 PYTHON_LIBRARIES=/usr/lib/x86_64-linux-gnu/libpython3.8.so PYTHON_VERSION_MAJOR=3 PYTHON_VERSION_MINOR=8 PYTHON_VERSION_STRING=3.8.2 ...

Note that starting with ROOT 6.22, python2 and python3 will be supported simultaneously by a single binary distribution.

This is exaclty what I meant :

source root_v6.18.04/bin/thisroot.sh && root-config --config | sed ‘s/ /\n/g’ | grep PYTHON
PYTHON_INCLUDE_DIR=/usr/include/python2.7
PYTHON_LIBRARY=/usr/lib64/libpython2.7.so
PYTHON_LIBRARY_RELEASE=/usr/lib64/libpython2.7.so

while

source root_v6.20.02/bin/thisroot.sh && root-config --config | grep PYTHON

This is the full report on my side (no information available) and we have the same issue with another colleague…So far we kept on wirtting -Dpython=‘ON’ instead of -Dpyroot=‘ON’ but from the early test i’m doing, this does not change a thing

Hi,

You can easily use bin/root-config --python-version that was created for this puprose.
(otherwise if you think that it is not enough please open a Jira ticket, we will happy to check how it could be improved)

The same “version” may come from different directories. That’s why these “PYTHON_*” variables were used. It seems to me that now there should be two sets of variables: “PYTHON2_*” and “PYTHON3_*”.

I can reproduce this with master as well.

@maxgalli can you check why the PYTHON variables are no longer showed with root-config?

@oshadura might have an idea of where to look.

Ok seems that Oksana already answered in the meantime :slight_smile:

Thanks all for the quick reaction.

Using -Dpyroot=‘ON’ gives the same results : there are no flags with PYTHON.

I already use root-config --python-version to compare the versions used by ROOT and requested for our platform by a user. The only thing I meant is that up to now, thanks to the information provided, I was able to overwrite python config at cmake level for our platform to be sure (if requested python version was not the one ROOT was compiled with) that everything was safe and sound.

I’ll leave the code as it is now for rel < 6.20 and for rel >= 6.20 our code will just exposed that python version are differents and that by default python will be switched off.

cheers
jb

@etejedor @maxgalli II added a fix https://github.com/root-project/root/pull/5738 (still building it to check if it will fully work) and trying to get it in 6.20.06.

Fix tested and will be available in 6.20.06:

 oksana@oksana-dellxps$ root-config --config | grep PYTHON_
......
 PYTHON_INCLUDE_DIRS=/usr/include/python3.8 PYTHON_LIBRARIES=/usr/lib/libpython3.8.so PYTHON_VERSION_MAJOR=3 PYTHON_VERSION_MINOR=8 PYTHON_VERSION_STRING=3.8.2
1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.