Install ROOT on CoCalc
--- by Samuel Lelièvre and Enrico Guiraud ---
This document presents how to install and use the ROOT software from CERN on CoCalc.
What is ROOT, what is CoCalc?
ROOT
From the home page at https://root.cern.ch/
ROOT is ...
A modular scientific software framework. It provides all the functionalities needed to deal with big data processing, statistical analysis, visualisation and storage. It is mainly written in C++ but integrated with other languages such as Python and R.
Start from examples (link is external) or try it in your browser!
CoCalc
From the home page at https://cocalc.com/index.html
CoCalc: Collaborative Calculation in the Cloud / Online computing environment
sophisticated online environment for
Mathematical calculation: SageMath, GAP, SymPy, Maxima, …;
Statistics and Data Science: R Project, Pandas, Statsmodels, Scikit-Learn, TensorFlow, NLTK, …;
Document authoring: LaTeX, Markdown/HTML, ...
General purpose computing: Python, Octave, Julia, Scala, …
System-wide installation of ROOT on CoCalc
It exists but the version that is installed is from 2015.
Probably because it was packaged for Ubuntu 16.04.
Later versions of Ubuntu stopped packaging ROOT. (When you want to use ROOT, you want a recent version, so there is little point in having a version packaged in Ubuntu. You compile it.)
Read on for how to build the latest stable version of ROOT in a CoCalc project.
Install ROOT in a CoCalc project
One can simply download a binary for Ubuntu, from the page of the latest stable release:
https://root.cern.ch/content/release-61206
Below we explain how to compile ROOT from source. Compiling ROOT is useful in case you need to turn on/off certain parts of ROOT, or if you want to compile with -std=c++14
or other things like that.
Upgrade the CoCalc project
For downloading and building ROOT, we need some upgrades to our CoCalc project:
disk space: the standard 3000 MB are not enough, it is suggested to double it;
internet access: otherwise we cannot
git clone
;member hosting: to ensure the project will not restart during the build;
optionally, extra cores and extra RAM will make the build faster; I added 4 cores and upgraded to 10000 MB of RAM.
Download ROOT in a CoCalc project
We follow the instructions at: https://root.cern.ch/building-root
First step: prerequisites
Required packages:
Optional packages:
Luckily all the prerequisites are installed system-wide on CoCalc.
Second step: get sources
We follow the instructions at:
Clone the git repository:
Change directory to the cloned repository:
Get a list of all tagged versions:
Select the latest one, currently v6-12-06
:
Build ROOT in our CoCalc project
Following the instructions at
Make a new directory and change to it:
Configure:
Build (using several cores if we have them):
Start ROOT
Source the environment to run:
Starting the root
application fails because it realises the display options in CoCalc will not allow its graphics capabilities.
Related CoCalc issues:
CoCalc issue 135: add html5 vnc support for SMC projects so that we can use X11, X windows applications -- noVNC looks good https://github.com/sagemathinc/cocalc/issues/135
CoCalc issue 2374: Install basic X11 support libraries, QT, etc., in our base linux image, to make building software easier https://github.com/sagemathinc/cocalc/issues/2374
We can start root with the -b
flag, which tells it to run in batch mode without graphics.
Type .q
to quit.
Try the ROOT package in Python
Type CTRL-D to exit.
Try launching the ROOT Jupyter notebook naively
This fails because it wants to run JupyterLab, which is not yet supported in CoCalc.
Exit with ctrl-C ctrl-C
.
Related CoCalc issues:
CoCalc issue 2553: Provide a JupyterLab view of projects https://github.com/sagemathinc/cocalc/issues/2553
CoCalc issue 2715: add "jupyter lab" start button in project settings https://github.com/sagemathinc/cocalc/issues/2715
Try PyROOT in the Jupyter notebook the CoCalc way
See https://root.cern.ch/pyroot
Using the CoCalc interface, create a new Jupyter notebook worksheet, say try-pyroot.ipynb
.
Use the "Python 2 (Ubuntu)" Jupyter kernel.
I'm stuck here, I need help to get further.
Try the ROOT C++ kernel for Project Jupyter in CoCalc
Create a Jupyter notebook document in CoCalc, say try-root-cpp.ipynb
.
In this notebook worksheet, use the menu item Kernel > Refresh Kernel List
. Once that is done, we can select the ROOT C++
Jupyter kernel.