Question about 5.22 Release and PyRoot

Hello,

In the release notes it says:

Does this mean that PyRoot has always had a problem when using the buffer interface for C arrays, except now it will work for Python 2.6?

Or does this mean this used to work for PyRoot and Python < 2.6, but now doesn’t?

Thanks,
Charles

Charles,

my English in the ChangeLog is indeed a little contracted. :slight_smile:

The “older versions” refers to older versions of ROOT, which will compile fine when presented with python 2.6 (if you don’t mind a couple of warnings). New in p2.6 is slicing of buffers, but it is all char based. So, if you have a C-array buffer of doubles, the addresses are going to be off in older versions, but you don’t notice this until runtime. What was added in the current release to work with p2.6, is slicing etc. for the buffers to work with the other data types.

Cheers,
Wim

Hi,

Is there any way to make root 5.22 with Python 2.6 on windows?

I use the installer version of root (for VC++9.0) and happen to use Python 2.6. When I type

import ROOT

I get messages

Traceback (most recent call last):
File “<pyshell#1>”, line 1, in
import ROOT
File “C:\root\bin\ROOT.py”, line 86, in
import libPyROOT as _root
ImportError: DLL load failed: could not find module (or something like that)

The PATH and PYTHONPATH are set correctly (by the installer)

Thanks

Nobu

Thanks

Nobu,

did you build from source or picked up a download? AFAIK, the normal builds are with p2.5 for the experiments, so p2.6 won’t work unless the code is rebuild from source.

Cheers,
Wim

Thanks, Wim,

No. I did not build from the source. I picked up the .msi version.

I also tried installing Python 2.4 as pyRoot manual/installation page seems to indicate I should use Python 2.4 and it did not work either.

Anyway, I will try to install 2.5 for other reasons as well

Do you know if I can easily generate windows version using visual studio 2008 (without using cygwin)? from the source?

Nobu

Nobu,

which version of ROOT did you download?

Not sure about building, though, as Windows isn’t a platform that I’m familiar with anymore.

I once was forwarded this tool by Gordon:

d0.phys.washington.edu/~gwatts/t … er1.24.zip

which may be of help (it generates a build project for VS).

Cheers,
Wim

Dear Wim,

On windows, I am trying 5.22 (and I am obviously new to developments on windows…)

I was almost giving up. I thought I can just recompile pyroot part of root on top of vc9 version of binary but not successful (at first attempt). I couldn’t find setup.py either which does often work on various platforms.

I will try Gordon’s kit this evening.

I wonder if we can have a binary for vc9.0+Python2.6. I don’t understand how vc9.0 version of ROOT binary works with Python 2.5 as Python 2.5 seems to be compiled with vc7.1.

Best,

Nobu

Nobu,

5.22 is going to be python2.5 for certain. How python itself is compiled (i.e. with which version of VS) shouldn’t matter: the results from compilers on the same platform from the same vendor tend to be completely binary compatible.

Cheers,
Wim

Nobu,

on a side-thread with the Windows experts, I’m reading that the compiler actually does matter: a python build with VC9.0 is needed for PyROOT to work with a ROOT release built with that compiler.

See also:
/afs/cern.ch/user/b/bellenot/public/Python-2.5.4.tar.gz

Sorry for the misinformation …

Cheers,
Wim

Dear Wim

I got the latest version of Gordon’s ROOT Builder from sourceforge and
was able to compile with --enable-python after a few trial. The root builder worked like a magic on WinXP 32 bit but miserably failed on Vista/64 but that is not a problem, I guess. This is a great small package and should be mentioned in the ROOT installation page, maybe.

I saw libpyROOT and pycintex stuff in bin and lib area. I have PYTHONPATH for root bin and lib.

I was able to import ROOT, dir(ROOT), but nothing more…
when I do, say, f = ROOT.TF1(…), it hangs there.

I wish someone can build one with py2.6 as 2.6 is now a production release.

Nobu

Dear Wim,

I don’t have access to /afs. Is ther a version on the web? I take it that it is a Python 2.5.4 with vc9. But I am afraid this is not too useful as all other public modules are compiled with the old compiler unless it comes with modified distutils with vc90 and setup.py works.

Thanks again,

Nobu

Nobu,

just noticed that the file got renamed to /afs/cern.ch/user/b/bellenot/public/Python-vc90.tar.gz and to access it from other than afs, I put it at http://cern.ch/wlav/Python-vc90.tar.gz.

It seems complete, including the standard modules and all, AFAICS.

As for a build with p2.6, yes it is in production but the LHC experiments are still using p2.5, so that is what is being build centrally, and it is too close to startup to have them switch now …

Cheers,
Wim

Hi,

just for the record, I learned that there is a more recent set of RootBuilder: sourceforge.net/projects/root-builder

Cheers,
Wim

Dear Wim,

Thanks, I found it and used it.

Here is where I am so far.

I found a way to update distutils to be able to use vc90 (basically copy from python 2.6 distutils.)

I got the recommended root with vc7.1 with Python 2 5.4 and installed most of the packages I needed for 2.5.4 binaries and used updated distutils only for the ones I needed to compile c/c++ code.

It seems to be fine for now.

Thank you for your help!

Nobu