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, and Theta framework.
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. We assume that participants will do the exercise sessions in groups of 3-4 people, so at least one laptop over 3 should have the required software preinstalled. We encourage anyway all participants to preinstall the software below.
Supported platforms
The supported platforms for the exercises are:
- Linux: Ubuntu, Scientific Linux, Linux Mint
- Mac OS X 10.8 (mountain lion): 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.
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 4.2.12 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-2013", 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)".
Download a preinstalled VM
You can download a preinstalled VM. It requires to download about 6GB of data, but may save you all the following installation steps.
- Go to the directory "VirtualBox VMs" that VirtualBox created in your home directory.
- Create a subdirectory called "infn-stat-Mint".
- Download in the newly created directory the three files you can find here.
- Run VirtualBox, you should see the new VM. The main use hereis vietri with password sulmare.
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, and Theta framework. 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 hte main "Menu"
Install required external packaged
A number of packges are required to compile ROOT and Theta. Below the list of packages to be added for Linux (including the VM installation) and Mac OS X.
- Under Linux:
You need to install the following packages: subversion (required by both ROOT and Theta),
dpkg-dev, make, g++, gcc, binutils, libfftw3-dev, libxml2-dev, libx11-dev, libxpm-dev, libxft-dev, libxext-dev (required by ROOT), sqlite3, libsqlite3-dev, libboost-dev, libboost-filesystem-dev, libboost-thread-dev, libboost-system-dev, libboost-program-options-dev,
libboost-iostreams-dev, python-scipy and python-matplotlib (required by Theta).
You can install them via command line with:
sudo apt install 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 and python-matplotlib
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.
- Under Mac OS X 10.8:
Install MacPorts. The final part of the installation may take a while.
Install the following packages by command line:
sudo port install python27
sudo port install sqlite3
sudo port install boost
sudo port install py-matplotlib
sudo port install py27-scipy
Set the default python version:
sudo port select --set python python27
Now, if you type:
which python
It should give you /opt/local/bin/python.
For an easier management of installed MacPorts packages, you can install the GUI Pallet:
sudo port install Pallet
If you find problems installing Pallet via ports (typically on Mac OS X 10.8), you may need to run the Xcode licence agreement first:
sudo xcodebuild -license
In the Application directory you will find a new folder MacPorts. Inside it, run the application "Pallet". Anyway, sometimes Pallet may hide error messages which are explicitly written using the command line.
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 5.34 complete source tree from CERN site here, or just use
wget ftp://root.cern.ch/root/root_v5.34.07.source.tar.gz
- uncompress ROOT tar file and move to the root directory:
tar xvfz root_v5.34.07.source.tar.gz
cd root
- create a local area for ROOT installation:
sudo mkdir /usr/local/root
- run configure with the following options, plus an additional ones for Mac OS X 10.8:
- If you run Mac OS X 10.8 (mountain lion), you need to add the option --enable-cocoa in order to use native graphics, since 10.8 does not support X11 graphics by default, as earlier versions up to 18.7.
./configure --enable-minuit2 --enable-roofit --enable-tmva --enable-fftw3 --enable-gsl-shared --enable-xml --enable-python --prefix=/usr/local/root
- compile ROOT using
make
- If you want to speed up compilation using multiple CPU (so, not in the case of a VM if you use the defaut of a single CPU), use
make -j n
if you want to use n CPUs in parallel
- once compliation is finished, install compiled applications and libraries using
sudo make 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.
Install Theta
You need to preinstall sqlite3, boost libraries and the non-default python packages SciPy and MatPlotLib. Below instructions follow for Linux and Mac OS X:
Download and install Theta:
- check out Theta by using svn (available in the subversion package for Linux and under Xcode for Mac OS X):
svn co https://ekptrac.physik.uni-karlsruhe.de/public/theta/tags/testing theta
cd theta
- under Linux, compile using
make
- under Mac OS 10.8, you need to compile using the cross-platform make CMake which you can download here:
export CC=gcc
export CXX=g++
export DYLD_LIBRARY_PATH=YourThetaInstallationPath/lib
mkdir build
cd build
cmake ..
make
where YourThetaInstallationPath is the directory where you installed theta.
As before, you can use multiple CPUs to compile:
make -j n
where n is the number of CPU you want to use in parallel.
- run a simple test:
cd ../utils2/examples/mle
../../theta-auto.py fit.py
you should see the result of a fit with no errors, something like the following:
./../theta-auto.py fit.py
[INFO] executing script fit.py
[INFO] Running '/Users/lista/Downloads/theta/bin/theta /Users/lista/Downloads/theta/utils2/examples/mle/fit/mle-data-s-218340e273.cfg --nowarn'
progress: 1 / 1 [100.0%] errors: 0 [ 0.0%]
Total number of likelihood evaluations: 32
{'s': {' nll': [-17.818879797456002], 'beta signal': [(0.9999999999999996, 0.3446387620636294)]}}
[INFO] workdir is /Users/lista/Downloads/theta/utils2/examples/mle/fit