Jupyroot in Jupyterhub CLING init can not extract standard include library paths

Dear all,

I am trying to set up a JupyterHub/JupyterLab server with ROOT for teaching using the root conda package. I managed to install it and to be able to start the kernel. However, once I issue import ROOT, the following error message appears:

ERROR in cling::CIFactory::createCI(): cannot extract standard library include paths!
Invoking:
  LC_ALL=C x86_64-conda-linux-gnu-c++   -DNDEBUG -xc++ -E -v /dev/null 2>&1 | sed -n -e '/^.include/,${' -e '/^ \/.*++/p' -e '}'
Results was:
With exit code 0

Welcome to JupyROOT 6.24/06

If I start a terminal and then activate my root6 conda environment, I can call import ROOT without this message appearing. Thus it appears to be specific to the Jupyter kernel configration. I wonder whether I am missing some environment variable.

The contents of the corresponding kernel.json file:

{
 "argv": [
  "/opt/anaconda3/envs/root6/bin/python",
  "-m",
  "ipykernel_launcher",
  "-f",
  "{connection_file}"
 ],
 "display_name": "CERN ROOT",
 "language": "python",
 "metadata": {
  "debugger": true
 }
}

This is how I installed it:

conda config --set channel_priority strict # used to be flexible
conda config --add channels conda-forge
conda config --add envs_dirs /opt/anaconda3/envs
conda create --prefix /opt/anaconda3/envs/root6 root ipykernel
/opt/anaconda3/envs/root6/bin/python -m ipykernel install --prefix=/opt/jupyterhub/ --name 'root6' --display-name "CERN ROOT"

Actually, running on the command line:

conda activate root6
tivate root6
(root6) walkowia@jhub1:~$ LC_ALL=C x86_64-conda-linux-gnu-c++   -DNDEBUG -xc++ -E -v /dev/null 2>&1 | sed -n -e '/^.include/,${' -e '/^ \/.*++/p' -e '}'

results in

 /opt/anaconda3/envs/root6/bin/../lib/gcc/../../x86_64-conda-linux-gnu/include/c++/9.4.0
 /opt/anaconda3/envs/root6/bin/../lib/gcc/../../x86_64-conda-linux-gnu/include/c++/9.4.0/x86_64-conda-linux-gnu
 /opt/anaconda3/envs/root6/bin/../lib/gcc/../../x86_64-conda-linux-gnu/include/c++/9.4.0/backward

which is different from the output at the Jupyter kernel’s start.

The versions:

  • conda 4.10.3
  • ROOT 6.24/06 (inside the root6 conda environment)
  • Python 3.9.7 (inside the root6 conda environment)

While I was still able to use this kernel to run the JupyROOT I am a little concerned about the CLING related warning message. I wonder which functionality will be missing. Also, it won’t be instilling confidence if this is the first thing our students experience starting JupyROOT.

The conda installation option for ROOT is great. Maybe I am just missing an environment variable in kernel.json or something alike.

Any hints will be greatly appreciated!

Thank you,

w.w.

Maybe @etejedor can give you some hints

Hello,
I’m not sure why you see those errors in a notebook but you don’t in a terminal.

Do you and your students have a CERN account? If yes, please note you can use SWAN (https://swan.cern.ch) to do your courses without setting up any server.

If you can’t use SWAN, you can perhaps use an installable version of SWAN, called ScienceBox:

https://sciencebox.web.cern.ch/sciencebox/

The installation in a single node (which I understand is enough for your case) is simple. And you get all the SWAN components (including ROOT both in Python and C++ via the LCG releases of CVMFS).

Hi @bellenot, @etejedor,

thank you for your replies. No, our students typically don’t have a CERN account.

However, I think I figured it out. Actually, the path to x86_64-conda-linux-gnu-c++ was missing in the PATH environment variable. I prefixed PATH with the proper pass to the conda environment’s bin directory in my kernel.json file which now reads:

{
 "argv": [
  "/opt/anaconda3/envs/root6/bin/python",
  "-m",
  "ipykernel_launcher",
  "-f",
  "{connection_file}"
 ],
 "display_name": "CERN ROOT",
 "language": "python",
 "metadata": {
  "debugger": true
 },
 "env": {
     "PATH": "/opt/anaconda3/envs/root6/bin:${PATH}"    
 }
}

Afterwards the warning message was gone.

Cheers,

w.w.

P.S.: In case someone is interested in how this kind of problem may be figured out:

  • Start your (python-based) notebook via your JupyterHub instance.
  • Check the PATH environment variable:
[] import sys
[] printenv
[] ! echo $PATH
  • This way I was able to compare the environment variables between using the conda environment directly from the command line and via the Jupyter kernel.
1 Like

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