I wanted to compile cernroot on ubuntu with python3 bindings for ROOT (pyROOT).
This is what worked for me (i built it in a docker container):
apt-get update && \ apt-get -y install \ vim \ nano \ libgslcblas0 \ python3-numpy \ python3-scipy \ python3-matplotlib \ perl \ bc \ git \ liblapack3 \ libboost-all-dev \ gv ghostscript xterm x11-utils \ dialog \ python3-pip \ wget \ git dpkg-dev cmake g++ gcc binutils libx11-dev libxpm-dev \ libxft-dev libxext-dev wget https://root.cern/download/root_v6.18.02.source.tar.gz && tar -zxvf root_v6.18.02.source.tar.gz && rm root_v6.18.02.source.tar.gz mkdir /root-build && cd /root-build; cmake -DPYTHON_EXECUTABLE=/usr/bin/python3 ../root-6.18.02 cd /root-build; make -j6
Let’s go ahead and test it:
micha@5be8c924103b:/$ . /root-build/bin/thisroot.sh micha@5be8c924103b:/$ python3 Python 3.6.8 (default, Jan 14 2019, 11:02:34) [GCC 8.0.1 20180414 (experimental) [trunk revision 259383]] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import ROOT >>> ROOT.TBrowser() <ROOT.TBrowser object ("Browser") at 0x35d8560> >>>
…. a TBrowser window opens … it is working
if you are interested in the Dockerfile, find it here: Link to GitHub