rootlogon.C not picked up by Jupyter C++ Notebooks

Hello,

In a directory with a rootlogon.C, Jupyter notebook does not seem to execute the commands specified inside that file. Opening a ROOT interactive session, on the other hand, does pick the rootlogon.C. Is there a way to make this work for Jupyter Notebooks? It would be nice to hide away calls like R__LOAD_LIBRARY(libmylib).

Cheers,
Ahmad


ROOT Version: v6.18/04
Platform: Ubuntu 16.04
Compiler: Not Provided


Hi,

Are you using a C++ notebook or a Python notebook?

Cheers,

Enric

As mentioned in the title, a C++ Notebook :wink:

Indeed right now rootlogon.C is not automatically loaded from a notebook. The reason is that the ROOT C++ kernel is actually implemented in Python, which takes what you write in the cell and forwards it as a string to the ROOT interpreter for execution. The C++ kernel does not currently make sure rootlogon.C is executed as the ROOT prompt does.

As a workaround, you can do from the first cell of your C++ notebook:

gROOT->LoadMacro("/path/to/rootlogon.C");

Thanks, this works. Is there maybe a way to hide even this command? For example, I know there are some ROOT settings in $ROOTSYS/etc that are automatically loaded. I actually don’t want users to write this line for every notebook that they create. I had hoped that ROOT notebooks somehow searches through the current working directory and some other standard directories to look for a rootlogon.C and load it (as you’d expect they would be loaded in the rootcling interactive shell).

Hi,
I opened a ticket with your request, you can follow it here:
https://sft.its.cern.ch/jira/browse/ROOT-10385

Cheers,
Enric

1 Like

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