Instruction for exercise sessions: computer setup
Exercise sessions will include computer-based examples and will involve the use of CERN toolkit ROOT, including the packages RooFit, RooStats and TMVA.
The installation will take some time and requires extensive network
download, so we request you to install the required software before
coming to the school in order to be ready for the exercise sessions.
Supported platforms
The supported platforms for the exercises are:
- Linux: Ubuntu, Scientific Linux, Linux Mint
- Mac OS X 10.8 (mountain lion) or later: Xcode
must be insalled to add compiler and other developer utilities. On Mac
OS X 10.8, after installing Xcode, you must run Xcode and, within the
Xcode, select to install the component "Command Line Tools", which was installed by default in previous versions of Mac OS. You can download Xcode for free from App Store.
- MS Windows, Mac OS X earlier than 10.8 and other operating
systems: we recommend the installation of a virtual machine (VM) using VirtualBox on which a Linux Mint installation is performed. Instructions to setup the VM are given below.
Python
ROOT exercises will be done in python language. Please, get sure you have a recent version of python installed. Python installation will also be required when you will install ROOT with the pyROOT option, according to the instructions below.
Install and setup VirtualBox
You can skip the following instruction if you have Linux or Mac OS X ≥10.8 installed on your machine. In that case,
jump to the section "Install the required software".
Dowload VirtualBox 6.0 or later here for your platform (e.g. MS Windows. Please, find here the list of supported OS).
Create a new VM with VirtualBox
- Dowload the ISO image of Linux Mint distribution from your nearest mirror site. This distribution, unlike Ubuntu desktop in some cases, has no graphics problems with VirtualBox.
- Start VirtualBox appplication
- Click in VirtualBox the "New" icon, then chose the following options:
- assign a name to the new machine, e.g. "infn-stat-2019", specify type: Linux, version: Ubuntu (don't chose the 64 bit variant)
- assign 1GB of memory
- choose "Create a virtual hard drive now"
- select "VDI (VirtualBox Disk Image)"
- select that the memory should be "dynamically allocated"
- when prompted for the location, specify the name of the NEW folder which should be put under your ~/VirtualBox VMs/ folder, and assign 8 GB of hard-disk space, then press "create".
You will have a new VM in the left-hand side of the VirtualBox window. Move to the right-hand side, then:
- in box "System", in the "Accelerator" tab, check that the two boxes for "Enable VT-x/AMD-V" and "Enable Nested Paging" are enabled
- in box "Display", allocate 128 MB of video memory and check the "Enable 3D Acceleration" option
- in box "Network", go to "advanced" and choose "paravirtualized Network (virtio-net)".
Install the new VM
- start the machine by clicking the icon "Start" with the green arrow
- in the window asking for the installation medium choose the ISO file with the linux installation from its location.
If asked, confirm "Start Linux Mint". The system will boot from it the installation medium.
- double-click on the "Install Linux-Mint" disk symbol on the VM desktop
- it may take about 5-25 minutes, depending on your system, to
complete the installation. Select the required options (language,
keyboard, user name, password, etc.)
- at some point the installation will require to erase the disk.
Don't panic: it will just erase the virtual disk, not your PC hard disk
- at the end you have to restart by confirming "Please remove installation media... ENTER:"
In order to allow copy and paste to and from the VM, you may go to
the menu "Devices > Shared Clipboard" and check the option
"Bidirectional", so you can copy commands from this page to the
terminal.
Exercise sessions will require ROOT, with the components RooFit, RooStats and TMVA.
Your preferred text editor should be installed in order to edit source code files.
Editors
You need your preferred text editor installed to edit source code. On the Mint Linux installation pico is installed by default.
Install emacs or other preferred packages using the "Software Mananger" under the main "Menu"
Install required external packaged (Linux only)
A number of packges are required to compile ROOT. Below the list of
packages to be added for Linux (including the VM installation) and Mac
OS X.
You need to install the following packages: subversion,
dpkg-dev, make, g++, gcc, binutils, libfftw3-dev, libxml2-dev, libx11-dev, libxpm-dev, libxft-dev, libxext-dev, sqlite3, libsqlite3-dev, libboost-dev, libboost-filesystem-dev, libboost-thread-dev, libboost-system-dev, libboost-program-options-dev,
libboost-iostreams-dev, python-scipy.
- Before installing, you need to do a bit of patch to fix the Linux Mint repository:
sudo sed -i -e 's/archive.ubuntu.com\|security.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list
- Moreover, comment the folliwing line in the file /etc/apt/sources.list (edit as superuser: sudo pico /etc/apt/sources.list):
deb http://packages.medibuntu.org/ quantal free non-free
- Now you can install them via command line with:
sudo apt-get update
sudo apt install subversion dpkg-dev make g++ gcc cmake binutils libfftw3-dev
libxml2-dev libx11-dev libxpm-dev libxft-dev libxext-dev sqlite3
libsqlite3-dev libboost-dev libboost-filesystem-dev libboost-thread-dev
libboost-system-dev libboost-program-options-dev libboost-iostreams-dev
python-scipy
- Under Debian-like Linux you may need to use: sudo apt-get install ....
Alternatively, you can run the "Package Manager" that you can
find under the main start menu. This opens GUI where you can mark for
installation and then install the packages listed above.
For Mac OS users only
- When installing ROOT from sources, the XCode command line tools may need to be re-installed with:
xcode-select --install
- Install CMake.
Install ROOT
ROOT should be downloaded and build from source code. Compilation will take a fair amount of time.
Detailed installation insctructions are given here. here. Below the essential steps.
- download ROOT 6.16 complete source tree from CERN site here, or just use
wget https://root.cern.ch/download/root_v6.16.00.source.tar.gz
or, on Mac OS:
curl -O https://root.cern.ch/download/root_v6.16.00.source.tar.gz
- uncompress ROOT tar file and move to the root directory:
tar xvfz root_v6.16.00.source.tar.gz
- create a local area for ROOT installation:
sudo mkdir /usr/local/root
- configure the build with the following options:
mkdir root_bld
cd root_bld
cmake ../root-6.08.06/ -DCMAKE_INSTALL_PREFIX=/usr/local/root -Droofit=ON -Dtmva=ON -Dminuit2=ON -Dpython=ON
- compile ROOT using (-j4 uses four processors in parallel):
cmake --build . -- -j4
once compliation is finished, install compiled applications and libraries using sudo cmake --build . --target install
in order to set the correct ROOT execution path and environmental variable, add the following line to your .profile (Mac) or .bashrc (Linux) file in your home directory:
source /usr/local/root/bin/thisroot.sh
(or thisroot.csh in your .cshrc in case you use c shell).
You need to logout and login again to activate the new path.
locate the root command:
which root
should give you /usr/local/root/bin/root. Try to run it:
root
and, under the root prompt, type:
new TBrowser
A window with a file browser should be visible. Exit by typing .q.