Building python support

after a

./configure --enable-python

(where python header are detected successfully:

Checking for Python.h … /usr/include/python2.3
Checking for libpython2.3, libpython2.2, python23, or Python … /usr/lib/python2.3/config

) the command

./configure --pkglist

gives

[…]
packages: root-daemon root-gl root-mysql root-pgsql root-cint root-doc libroot-dev root-bin libroot

no python check is included in the second run. if i try to create debian packages everything is builded (mysql, postgresql etc) fine but no python packages are created.

what do i do wrong?

Hi,

“./configure --pkglist” does not give the list of enabled features. For that, look at the
end of “./configure --enable-python”.

You say that no “python packages” are created. I’m not sure what you expect. Could
you verify the absence of libPyROOT.so?

Cheers,
Wim

sorry, i forget to mention the build for debian…

  • there is no debian package made with a name that implies python
  • there is nothing (like ROOT.py) in the other deb packages
  • no, a lib is not builded with make debian
  • yes, a lib is builded with make all
  • no, a lib is not installed with make install

and:
if i copy the files by hand i can’t get it running. i copied ROOT.p* and libPyROOT.so from lib/ to /usr/local/lib/… (and set PYTHONPATH there) and get lots of errors with the examples:

dlopen error: /usr/lib/root/libGX11.so: undefined symbol: _ZNK7TObject7DoErrorEiPKcS1_Pc
Load Error: Failed to load Dynamic link library /usr/lib/root/libGX11.so
Warning in TClass::TClass: no dictionary for class TCanvas is available
Traceback (most recent call last):
File “hsimple.py”, line 13, in ?
from ROOT import TCanvas, TFile, TProfile, TNtuple, TH1F, TH2F
ImportError: cannot import name TProfile

all plain samples work just fine.

best regards & thnx for any help!

 michael

Hi Michael,

the building of debian packages is new to me …

First this: the error that you get would appear if you have an older ROOT.py (e.g. from
the last ROOT release) with a current libPyROOT.py. Could you verify the ordening of
paths in your PYTHONPATH?

More later … libPyROOT.so and ROOT.py install properly for me, and relocating them
works ok as well.

Cheers,
Wim

mmmh, that does not work for me. i have no other ROOT.py on the whole system. i start with this version and have no old stuff around. so i do the following:

rm -rf root*
tar xvzf /.../root_v4.01.02.source.tar.gz
mv root root-4.01.02
cd root-4.01.02
./configure --enable-pgsql  --enable-mysql  --enable-opengl  --enable-python  --enable-shared  --enable-soversion --enable-thread
make debian
find . -name libPyROOT.so 

(no answer :frowning: )

mmh, will try a clean build without debian… one moment :wink:

Hi all,

The reason you see no [b]root-plugin-python'[/b] orpython-root’ package, is that I haven’t made the changes in the packaging scripts to make this package.

I’m assuming of course that libPyRoot is build in the first place.

The situation with the Debian GNU/Linux and Red Hat packaging scripts for ROOT is pretty horrible. Unfortunately I haven’t had the time to do anything about it for quite a while. Hope the siuation will improve within the coming months.

What I’d like to do, is to revamp the scripts altogether. However, that requires some changes to the main trunk of ROOT - some of which are a bit controversial. For example, I believe building libfreetype6 when it already exists on a Debian system is unacceptable, and similar for libafterimage, and so on.

For now, I would copy the Python interface by hand. Or, if you feel up to it, look through the scripts and data files in build/package and see if you can make the necessary changes - I’ll gladely use your patches in the upcoming revision of the packaging scripts.

Someone said they were running SuSE. I think SuSE use RPMs, so you should really make RPMs instead. That’s possible via make redhat.

Yours,

Christian

okay, building from clean dir everything builds cleanly. make install works fine.

it seams the make debian switches off all modules that are not known. i will take a look if i understand those debian build scripts. i don’t like /usr/local installation.

and no: if have no suse (better is ;-).

and yes: i like your aproach making nice debian packages!

thnx,
michael

Micheal,

This version of ROOT requires “–enable-explicitlink” for python to work. (If you
don’t use it, you’d get the error that you’ve seen.) The current version (HEAD CVS)
no longer requires this.

Cheers,
Wim

i left --enable-explicitlink out because i saw it’s set in configure if python is used. the build with the error was done with that option anyway. what was missing is the run of bin/rlibmap -r etc/system.rootmap -l lib/libPyROOT.so -d -c pyroot/inc/LinkDef.h when not doing make install. that probably leads to the error above. i copied the files by hand.

the main problem with my setup is the debian build which seems to disable python again. i will try to include python in debian.

thnx for all the help,
michael

okay, finally i managed to build debian packages including python! everything is fine. only the python path does not match. i will investigate that later.

if someone is interested in this please let me know!

thnx for all your help