scikit-hep / root_numpy

The interface between ROOT and NumPy

Home Page:http://scikit-hep.org/root_numpy

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

support multiple ROOT version at the same time

wiso opened this issue · comments

Hello, it is very common to have more than one version of ROOT on a single machine. Is it possibile to install root_numpy just one time, and have it working with different ROOT versions?

Now I have installed root_numpy with ROOT 5, and when using root_numpy after the setup of ROOT 6 I get a warning and then a crash.

I do this by having two virtual environments - one for ROOT5 and one for
ROOT6 with virtualenvwrapper and I can switch at ease by changing my bash.
On Wed, Jun 29, 2016 at 04:43 Ruggero Turra notifications@github.com
wrote:

Hello, it is very common to have more than one version of ROOT on a single
machine. Is it possibile to install root_numpy just one time, and have it
working with different ROOT versions?

Now I have installed root_numpy with ROOT 5, and when using root_numpy
after the setup of ROOT 6 I get a warning and then a crash.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#260, or mute the thread
https://github.com/notifications/unsubscribe/AAuei4YOq-YNkiToyawSBXwxTmSflG1rks5qQjA-gaJpZM4JA5oo
.

Hi Ruggero!

Unfortunately it is not possible in general like any other program compiled against some library. In some cases it might work (between minor versions) but what you compile against ROOT 5 for example will definitely not work with ROOT 6. If root_numpy was just pure python then it would not be a problem of course. When the ABI of ROOT changes, then your previously built root_numpy will stop working.

Although there could be a way to possibly bootstrap recompilation of a new librootnumpy.so when it detects that the ROOT version has changed.

static compilation at installation time doesn't work?

For root2array this could work since it doesn't touch PyROOT. Aside from creating a rather large binary the static linking would likely cause problems when users have another version of ROOT active and are using PyROOT with that. For example if I installed root_numpy with ROOT 5 and it was statically linked with that, then at runtime I took a TTree or TH1D etc from ROOT 6 and passed that to a root_numpy function... root_numpy would probably crash here.

But thanks for raising this point. There should be a way to bootstrap the build at import time that will handle whatever version of ROOT is currently active. This would be a nice feature...

I think it is fair to close this PR at this point, especially now that uproot exists. I don't think anyone will be working on this enhancement. To anyone: feel free to reopen if you get to work on this.