ROOT 5.34 with Python 3.6

Continuing the discussion from Compiling ROOT 5.34 with PyROOT:

Hello,
I have to move from Python 2.7 to Python 3.6. At the step of recompiling ROOT 5.34.36 with PyRoot support, I issued the same problem. Here’s my configure command :

./configure --prefix=$INSTALL_BLD --enable-builtin-freetype --etcdir=$INSTALL_BLD/etc_root --enable-fitsio --with-cfitsio-incdir=$INSTALL_BLD/include --with-cfitsio-libdir=$INSTALL_BLD/lib --enable-fftw3 --with-fftw3-incdir=$INSTALL_BLD/include --with-fftw3-libdir=$INSTALL_BLD/lib --enable-gsl-shared --with-gsl-incdir=$INSTALL_BLD/include --with-gsl-libdir=$INSTALL_BLD/lib --enable-python

but make failed with :

bindings/pyroot/src/TCustomPyTypes.o:(.data.rel+0x2a0) : référence indéfinie vers « PyInt_Type »
collect2: error: ld returned 1 exit status
/.../root_v5.34.36/bindings/pyroot/Module.mk:76 : la recette pour la cible « lib/libPyROOT.so » a échouée
make: *** [lib/libPyROOT.so] Erreur 1

I dont understand if this problem was solved in the above topic. Maybe I should try with CMake and extra arguments given by @wlav.

I add that configure was running well with:

Checking for Python.h ... /.../anaconda/envs/py36/include/python3.6
Checking for python3.6, libpython3.6, libpython, python, or Python ... /.../anaconda/envs/py36/lib

and that I added /.../anaconda/envs/py36/lib to the LD_LIBRARY_PATH.

Thanks for help.
Cheers

Hi,

we build and test in our CI ROOT6 with Python3. I would recommend moving to ROOT6.

Cheers,
D

If it was of my responsibility I would do such. But it is not planned to move to ROOT6 in the project I’m working on. But thanks ! have you a solution for 5.34.36 ?

Hi,

Can we help with the transition? Is there a blocker which prevents you from moving? As you may know, ROOT5 is not actively developed any more since years.

Cheers,
D

Which version of ROOT6 should we use ?

Hi,

the pro version, 6.12/06 : https://root.cern.ch/releases

Cheers,
D

Ok, I will try and ask you for integration issues. Thanks

@dpiparo, I’m compiling with configure, make, make install using same command line and options as above. It seems to be longer that for version 5.34.36. Is that normal ?

I also saw that CMake is now prefered. What is the difference, is it faster ?

Hi,
you are right: configure/make has been dropped in favour of the more modern and flexible cmake.

Cheers,
Danilo

Ok so I’m trying with CMake but I issued a problem with #include <unicode/ucnv.h> not found so I installed libxml2-dev. It’s running currently.

Just a warning prints every line:

/usr/bin/cmake: /.../anaconda/envs/py36/lib/libcurl.so.4: no version information available (required by /usr/bin/cmake)

How to deal with this ?
Thanks

the error is odd.
what happens with a python3 which does not come from anaconda?

cheers,
D

Despite the warning, the compilation has gone well. I can successfully run Root and import it in Python 3. Now I have to check with our C++ code using Root 5.34 to move to 6.

So, I try compile our code and it leads to:

In file included from /.../root-6.12.06/include/RtypesCore.h:23:0,
                 from /.../root-6.12.06/include/Rtypes.h:23,
                 from /.../root-6.12.06/include/TAttPad.h:16,
                 from /.../root-6.12.06/include/TVirtualPad.h:25,
                 from /.../root-6.12.06/include/TPad.h:16,
                 from /.../root-6.12.06/include/TCanvas.h:17,
                 from /.../src/libUtsTools/UtsGraphicsTools.h:19,
                 from /.../src/libUtsTools/UtsGraphicsTools.cpp:16:
/.../root-6.12.06/include/RConfig.h:47:4: error: #error "ROOT requires support for C++11 or higher."
 #  error "ROOT requires support for C++11 or higher."

and plenty of other errors

I try to recompile Root with -DCMAKE_CXX_FLAGS="-std=c++11": Root works well and I didn’t get the warning about libcurl.so.4. Then I recompile my code with:

./configure <some options> CXXFLAGS=-std=c++11 LDFLAGS=-std=c++11

But I still have the same errors.
Thanks, Cheers

All is going well know. I have to add -std=c++11 to AM_CPPFLAGS.
Thanks a lot!

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