-
-
Save MohamedElashri/1b0367992988f053a02dbfd5797fb59e to your computer and use it in GitHub Desktop.
# Step 1: Download the pre-built ROOT tarball from GitHub Releases | |
!wget -q --show-progress https://github.com/MohamedElashri/ROOT/releases/download/v6.30.04_python11/root_v6.30.04_Ubuntu_Python3.11.zip | |
# Step 2: Extract the ROOT files | |
!unzip -q root_v6.30.04_Ubuntu_Python3.11.zip | |
# Step 3: Install missing system dependencies for ROOT | |
!sudo ldconfig & apt-get install -y git dpkg-dev cmake g++ gcc binutils libx11-dev libxpm-dev libxft-dev libxext-dev tar gfortran subversion libpython3.11-dev | |
# Step 4: Remove the tarball to free up space | |
!rm -f root_v6.30.04_Ubuntu_Python3.11.zip | |
# Step 5: Install Compatible libssl | |
!wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2_amd64.deb | |
!sudo dpkg -i libssl1.1_1.1.1f-1ubuntu2_amd64.deb | |
!rm -f libssl1.1_1.1.1f-1ubuntu2_amd64.deb | |
import sys | |
sys.path.append("/content/root_build/") | |
sys.path.append("/content/root_build/bin/") | |
sys.path.append("/content/root_build/include/") | |
sys.path.append("/content/root_build/lib/") | |
import ctypes | |
ctypes.cdll.LoadLibrary('/content/root_build/lib//libCore.so') | |
ctypes.cdll.LoadLibrary('/content/root_build/lib//libThread.so') | |
ctypes.cdll.LoadLibrary('/content/root_build/lib//libTreePlayer.so') | |
import ROOT | |
h = ROOT.TH1F("gauss","Example histogram",100,-4,4) | |
h.FillRandom("gaus") | |
c = ROOT.TCanvas("myCanvasName","The Canvas Title",800,600) | |
h.Draw() | |
c.Draw() |
When I run the code it returns the following error on the line ctypes.cdll.LoadLibrary("root_build/lib/libCore.so")
OSError: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.38' not found (required by root_build/lib/libCore.so)
When I run the code it returns the following error on the line ctypes.cdll.LoadLibrary("root_build/lib/libCore.so")
OSError: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.38' not found (required by root_build/lib/libCore.so)
Sorry I did this mistake. I will fix it but will take two hours until build get updated. in the mean time change the downloaded link in first cell by this zip file. Change the first line to this.
!wget -q --show-progress https://github.com/MohamedElashri/ROOT/releases/download/ubuntu/root_v6.30.04_Ubuntu_Python3.11.zip
Or just try to work from this notebook
It's working for now
It's working for now
Great, enjoy using it and please tell if at any point it stopped working.
When i try to import root_numpy it gives me
Thank you!
There are several problems
1- You didn't install root_numpy
2- root_numpy
is not part of ROOT and is a separate software
3- It is unmaintained for years now and not will work with new python version (certainly not on Colab)
So you shouldn't use it but work with PyROOT
which is the python wrapper of ROOT that this installs.
Thank you Mohamed. It is good to hear that someone wants to help us with this question!!