1. Prerequisites

OS recommended: Ubuntu 16.04

Once you have installed Geant4 you need to install other tools to work with Geant4 source code properly. These tools are the Eclipse IDE and the ROOT data analysis framework.

2. Installing JDK (Java Development Kit)

In order for Eclipse to work you need to install the JDK (Java Development Kit). If you have not installed synaptic type this in the terminal:

$ sudo apt-get install synaptic

Once it is installed, open Synaptic, then search and install "default-jdk".

3. Eclipse installation

Go to the download section of the Eclipse web page by typing this in your browser:


Search for the Eclipse IDE for C/C++ Developers section and download the 32 or 64 bit version depending on your system characteristics.

If you haven't created an applications folder, create it like this:

$ cd /opt/
$ sudo mkdir applications

Now decompress the Eclipse file you just downloaded:

$ tar -zxvf eclipse-cpp-neon-3-linux-gtk-x86_64.tar.gz

A folder named eclipse is created. Move it to the applications folder:

$ sudo mv ~/Downloads/eclipse /opt/applications/

In order to pin Eclipse to the Unity launcher create a .desktop file for eclipse:

$ gedit ~/.local/share/applications/opt_eclipse.desktop

Copy the following code inside Gedit and save the file:

[Desktop Entry]
Comment=Eclipse Integrated Development Environment

Give the file execution permissions:

$ chmod +x ~/.local/share/applications/opt_eclipse.desktop

Finally, now you can search for Eclipse like any other application and pin it to the Unity launcher.

4. Eclipse configuration

In order for Eclipse to recognize the Geant4 source headers, once you have created a project do the following:

  1. Right click in your project's name and select Properties.
  2. Go to the C/C++ General section and select Paths and Symbols.
  3. In the Languages box select GNU C++ and click the Add... button to the right.
  4. In the Directory text field type "/opt/applications/geant4/geant4.10.01-install/include/Geant4".
  5. Click OK, then Apply and finally OK.
The configuration is done. Now Eclipse will recognize the Geant4 source headers.

5. ROOT installation

In order to install ROOT you first need to install some other packages. To do that type:

$ sudo apt-get install git dpkg-dev cmake g++ gcc binutils libx11-dev libxpm-dev libxft-dev libxext-dev ==

Now install the last iteration of the 5.34 version of ROOT by typing this in your browser:


Go to the Source distribution section and download the ROOT source file.

Once it's downloaded go to the applications folder and create a folder for ROOT:

$ cd /opt/applications/
$ sudo mkdir root

Now move the file you downloaded to folder you just created:

$ sudo mv ~/Downloads/root_v5.34.36.source.tar.gz /opt/applications/root/

Go to the root folder and decompress the file:

$ cd root
$ sudo tar -zxvf root_v5.34.36.source.tar.gz

Go to the decompressed folder and compile the source code:

$ cd root
$ sudo ./configure
$ sudo make -jN

Note: N is the number of cores available in your PC.

Now open your .bashrc file:

$ gedit ~/.bashrc

Copy the following code at the end of the file and save it:

# root
source /opt/applications/root/root/bin/thisroot.sh

Finally type this:

$ source ~/.bashrc

Now ROOT is ready to use.

-- CamiloSevilla - 2017-05-15

Edit | Attach | Watch | Print version | History: r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r1 - 2017-05-15 - CamiloSevilla
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    Main All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback