compiling ROOT (cernroot) with python3 bindings (pyroot)

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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.