Installing "ROOTasService" on CC7 as recently presented

Dear developers,

In the recent ROOT workshop Danilo Piparo presented “ROOT as a Service” and I would like to try it out.

I have installed on my CERN Centos 7.1 virtual machine ROOT 6.05.03 from git with the latest commits as of yesterday, with c++14 enabled.

As far as I can tell, the directions for the installation are on slide 63 of the presentation. I manage to install and run ipython notebooks (I am not a python expert, I hope that I have not done wrong with “pip”) but when I try to use the “ROOT prompt” I get the message that the kernel died and restarting fails.

I attached the Traceback.

Can you help me?

Thanks,
Matteo
issueROOTNB.output.txt (14.8 KB)

Dear Matteo,

First of all thank you for trying the local installation of ROOT notebooks.

I have some questions:

  • What is the version of your IPython installation? Is it 3.2? Please check with “ipython --version”.
  • What happens if you select the “Python 2” kernel instead of “ROOT prompt” and try to type “import ROOT” in the first cell. Does it work?

Cheers,

Enric

4.0.0
At some point while trying to launch ipython notebook in general I was getting errors and suggestions to “upgrade” the notebook package:

# pip install -v ipython[notebook]
Requirement already satisfied (use --upgrade to upgrade): ipython[notebook] in /usr/lib/python2.7/site-packages
  Installing extra requirements: 'notebook'
  ipython 3.2.1 does not provide the extra 'notebook'
Cleaning up...
# pip install -v --upgrade ipython[notebook]

Now that I read it again I am afraid that I misunderstood the message. Anyway the last command practically kind of re-compiled the package and this is why I have probably this version… how can I revert the operation without completely screw up the machine?

No. It looks like the same error message (I can attach if you really want to check it)

Thanks for your help.

Hi,

Please try installing IPython 3.2, as suggested here (slide 63):

indico.cern.ch/event/349459/ses … TaaS_2.pdf

Since you have installed a more recent version of IPython, you can try to uninstall that version and then install 3.2:

pip uninstall ipython[notebook]
pip install -Iv ipython[notebook]==3.2.0

And then follow the rest of the steps in the aforementioned slide.

Please let me know if you have any other problem.

Cheers,

Enric

Dear Enric

I reinstalled ipython notebook following your guidelines but I get the same error when opening a new “ROOT prompt file”:

[I 09:38:03.768 NotebookApp] Kernel started: d6c646d9-9a1f-4a8a-9aec-e80b5520bdbe
[IPKernelApp] WARNING | Error in executing line in user namespace: import ROOT;ROOT.toCpp();
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/IPython/core/ultratb.py", line 970, in get_records
    return _fixed_getinnerframes(etb, number_of_lines_of_context, tb_offset)
  File "/usr/lib/python2.7/site-packages/IPython/core/ultratb.py", line 233, in wrapped
    return f(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/IPython/core/ultratb.py", line 267, in _fixed_getinnerframes
    records = fix_frame_records_filenames(inspect.getinnerframes(etb, context))
  File "/usr/lib64/python2.7/inspect.py", line 1043, in getinnerframes
    framelist.append((tb.tb_frame,) + getframeinfo(tb, context))
  File "/usr/lib64/python2.7/inspect.py", line 1003, in getframeinfo
    filename = getsourcefile(frame) or getfile(frame)
  File "/usr/lib64/python2.7/inspect.py", line 444, in getsourcefile
    filename = getfile(object)
  File "/usr/lib64/python2.7/inspect.py", line 409, in getfile
    if ismethod(object):
  File "/opt/CERN/ROOT6/root-6.05.03/lib/ROOT.py", line 117, in ismethod
    if type(object) == _root.MethodProxy:
AttributeError: 'NoneType' object has no attribute 'MethodProxy'
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/IPython/core/ultratb.py", line 970, in get_records
    return _fixed_getinnerframes(etb, number_of_lines_of_context, tb_offset)
  File "/usr/lib/python2.7/site-packages/IPython/core/ultratb.py", line 233, in wrapped
    return f(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/IPython/core/ultratb.py", line 267, in _fixed_getinnerframes
    records = fix_frame_records_filenames(inspect.getinnerframes(etb, context))
  File "/usr/lib64/python2.7/inspect.py", line 1043, in getinnerframes
    framelist.append((tb.tb_frame,) + getframeinfo(tb, context))
  File "/usr/lib64/python2.7/inspect.py", line 1003, in getframeinfo
    filename = getsourcefile(frame) or getfile(frame)
  File "/usr/lib64/python2.7/inspect.py", line 444, in getsourcefile
    filename = getfile(object)
  File "/usr/lib64/python2.7/inspect.py", line 409, in getfile
    if ismethod(object):
  File "/opt/CERN/ROOT6/root-6.05.03/lib/ROOT.py", line 117, in ismethod
    if type(object) == _root.MethodProxy:
AttributeError: 'NoneType' object has no attribute 'MethodProxy'

I tried again also the other suggestion: I opened a “Python2” notebook and I get the same error as soon as I try “import ROOT”. I guess if the issue is that it cannot correctly find the root installation (even if the third-to-last line above shows the right installation path). Please take into account that I am using the CERN Centos 7.1 operating system so I first run:

scl enable devtoolset-3 /bin/tcsh
source /opt/CERN/ROOT6/root-6.05.03/bin/thisroot.csh

before doing any other thing. I never tried to start pyROOT (am I supposed to have a “pyroot” command or similar available?)

Any suggestion is very welcome

Thanks,
Matteo

Dear Matteo,

It seems a PyROOT problem indeed. I will try to reproduce it myself on CC7.

In the meantime, could you check that PyROOT does not work, so that we discard this is related to the notebook? For doing so, please run in a regular terminal:

> python
>>> import ROOT

and let me know if this fails with the same error.

Cheers,

Enric

Hi Enric,

after a “flash python course” I tested:

import ROOT as r
h1 = r.TH1F("h1","",10,0,10)
h1.Draw()

and it works both with python and ipython (of course after source-ing the ROOT path). So it seems related to the notebook “extension”.

Is there any prescription on this directory “ROOTPromptNBKernel” where I unpacked the stuff? Or these environmental variables NBINSTDIR and IPYTHONDIR ? I just sticked blindly to slide 63 but I am not sure if I have to adapt them somehow for my system.

Thanks again,
Matteo

Hi Matteo,

I was unable to reproduce your error in CC7 (CentOS Linux release 7.1.1503 (Core)).

Could you perhaps try to follow my very same steps? I started by downloading the latest ROOT binary installation for CC7:

root.cern.ch/download/root_v6.0 … 4.8.tar.gz

and I unpacked it in $HOME/root. Let’s leave aside for the moment the rootnb_local.tar.gz file. Just open a brand new terminal and type:

source $HOME/root/bin/thisroot.sh
ipython notebook

When the notebook interface shows up in your browser, create a “Python 2” notebook and type “import ROOT” in the first cell.

Please let me know how it goes.

Cheers,

Enric

Dear Enric,

With the binary version for gcc 4.8 it works, I can also use the “ROOT-prompt” kernel without problem.

In my case I used gcc4.9 (enabled on CC7 by using ‘scl enable devotoolset-3’) to compile the git master (as of some commit on 23/09/2015) in order to have the the c++14 support.

So something is not correctly configured either in the result of the compilation, or due to the environment built by devtoolset-3.

Please note that I used the “./configure ; make” method:

./configure --all --with-clang --with-gcc-toolchain=/opt/rh/devtoolset-3/root/usr/lib/gcc/x86_64-redhat-linux/4.9.2 --enable-cxx14 --enable-soversion --fail-on-missing

because I get errors when I setup the compilation with CMake (the same issue related to “string_view” reported here Cxx14 flag when compiling ROOT with clang 3.4.2, the 8th post of the thread).

Do you have any suggestion?

Thanks,
Matteo

Hi Wile,

The looks is related to SLC6 & devtoolset-2, to get C++11 on that platform, but I can imagine that Redhat did not change philosophy and the same issue described on JIRA can be present also in my case. I will specifically ask in that thread.

However, for this thread, do you mean that the issue extends also to the importing of ROOT in the python environment (I am not a python expert)?

Thanks,
Matteo

Hi Matteo,

Like Axel pointed out in Wile’s thread, the use of devtoolset is probably behind your problem. Therefore, regarding the local installation of ROOT notebooks, I suggest that you do not use it.

Please let us know if you encounter any other problems using the notebooks.

Cheers,

Enric

Hi all,

I have had the same problem when compiling ROOT with autotools. In my case (Standard CC7 compiler), I fixed the problem by copying the directory ROOTaaS from root-6.05.02/bindings/pyroot to $MY_ROOT_INSTALL/lib/root/ROOTaaS . Afterwards ipyton notebook works fine. Seems that it is not installed by default in case you use autotools.

See sft.its.cern.ch/jira/browse/ROOT-7763.

Cheers,
Manuel