Compilation Instructions V7.0

From Wiki OpenGATE
Jump to: navigation, search
!!IMPORTANT!! Before continuing, make sure all required packages are installed. See Package Requirements

Package required

The minimal software distribution should be the following:

Geant4 9.6.p03 (including the embedded CLHEP)
Gate V7.0
Users can also used the external CLHEP v2.1.3.1

Optionnal packages are required for output management:

ROOT
ECAT
LMF

CLHEP

By default, since the GATE V7.0 release, users can use the CLHEP embedded within Geant4 9.6 distribution. The CMAKE flag is ON by default.

However, users can fell use an external CLHEP version (2.1.3.1) by following the standard installation procedures.

!!!WARNING: Note that as of CLHEP 2.1.2.0, cmake is the preferred build option. Building with autotools and configure is deprecated!!!

Instructions for using cmake can be found in INSTALL.cmake file.

Note: With Ubuntu Linux distribution, the package is 'cmake'. sudo apt-get install cmake.

You can download CLHEP at this address:

http://proj-clhep.web.cern.ch/proj-clhep/DISTRIBUTION

Download the CLHEP version according the GEANT4 recommendations:

http://geant4.web.cern.ch/geant4/support/ReleaseNotes4.9.6.html

The recommended version for GATE v7.0 is CLHEP v2.1.3.1.

To install, unzip and untar the downloaded file:

tar -xzf clhep-2.1.3.1.tgz

In the same directory, create two directories to build and install CLHEP:

mkdir 2.1.3.1-build
mkdir 2.1.3.1-install

Move into the CLHEP build directory:

cd 2.1.3.1-build

Launching the cmake command and the make command as follow:

cmake -DCMAKE_INSTALL_PREFIX=/PATH_TO/2.1.3.1-install /PATH_TO/2.1.3.1/CLHEP/
make
make test
make install

Finally, update your environment variables file with the following command lines: (this part is summarized in the item 5 of this document)

• bash or zsh:

export PATH=$PATH:/PATH_TO/2.1.3.1-install/bin:/PATH_TO/2.1.3.1-install/include
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/PATH_TO/2.1.3.1-install/lib

• [t]csh:

setenv PATH ${PATH}:/PATH_TO/2.1.3.1-install/bin:/PATH_TO/2.1.3.1-install/include
setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/PATH_TO/2.1.3.1-install/lib

ROOT

You can download ROOT at this following address:

http://root.cern.ch/drupal

It is recommended to install directly the ROOT binaries. Users have to compile the ROOT sources only if necessary. Choose the ROOT version according to hardware architecture and uncompressed the downloaded file:

• 64 bits:

tar -xzf root_v5.XX.XX.Linux-slc5_amd64-gcc4.3.tar.gz

• 32 bits:

tar -xzf root_v5.XX.XX.Linux-slc5-gcc4.3.tar.gz

Move the ROOT name directory:

mv root root_v5.XX

Depending on your environment, you need to source ROOT as follow (this final step is summarized in the item 5 of this documentation):

• bash or zsh:

source /PATH_TO/root_v5.XX/bin/thisroot.sh

• [t]csh:

source /PATH_TO/root_v5.XX/bin/thisroot.csh

Geant4

!!!WARNING: From the 9.5 GEANT4 version, the installation procedure is managed by CMAKE!!!

(Note: With Ubuntu Linux distribution, the packages are 'cmake' and 'cmake-curses-gui'. sudo apt-get install cmake cmake-curses-gui)

First download the GEANT sources at this address:

http://geant4.web.cern.ch/geant4/support/download.shtml

To install, unzip and untar the downloaded file:

tar -xzf geant4.9.6.p03.tar.gz

In the same directory, create two directories to build and install GEANT4:

mkdir geant4.9.6.p03-build
mkdir geant4.9.6.p03-install

Move into the GEANT4 build directory:

cd geant4.9.6.p03-build

Launching the ccmake as follow:

ccmake ../geant4.9.6.p03

You will obtain the following screen and you need to configure the different options as it is done in this figure: (QT and OPENGL are optional, depending of what users want to do).

GEANT4_INSTALL_DATA and GEANT4_USE_SYSTEM_CLHEP are mandatory.
Press 'c' to configure and 'g' to generate the compilation environment.

After this step you will automatically back to the prompt terminal and then, you will launch the compilation:

make -jN (N is the number of processor(s) in your PC)
make install

CmakeG4.jpg

Finally, update your environment variables file with the following command lines: (this part is summarized in the item 5 of this document)

• bash or zsh:

source /PATH_TO/geant4.9.6.p03-install/bin/geant4.sh

• [t]csh:

source /PATH_TO/geant4.9.6.p03-install/bin/geant4.csh

For details, read the official GEANT4 installation procedure: http://geant4.web.cern.ch/geant4/UserDocumentation/UsersGuides/InstallationGuide/html/ch02.html

Gate V7.0

!!!WARNING: From the 6.2 GATE version, the installation procedure is managed by CMAKE!!!

Download the sources at this address:

www.opengatecollaboration.org

To install, unzip and untar the downloaded file:

tar -xzf gate_v7.0.tar.gz

In the same directory, create two directories to build and install GATE:

mkdir gate.7.0-build
mkdir gate.7.0-install

Move into the GATE build directory:

cd gate.7.0-build

Launching the ccmake command to the gate_v7.0 source directory:

ccmake ../gate_7.0

CmakeGate.jpg

Warning Information about following environment variables:

GATE_USE_ECAT7     OFF: by default, set to ON if you want to use this library
GATE_USE_LMF       OFF: by default, set to ON if you want to use this library
GATE_USE_OPTICAL   OFF: by default, set to ON if you want to perform simulation for optical imaging applications
GATE_USE_GPU       OFF: by default, set to ON if you want to use GPU modules       

As it was the case for Geant4, press 'c' to configure and 'g' to generate the compilation environment. Finally:

make -jN (N is the number of processor(s) in your PC)
make install

Finally, update your environment variables file with the following command lines: (this part is summarized in the item 5 of this document)

• bash or zsh:

export PATH=$PATH:/PATH_TO/gate.7.0-install/bin

• [t]csh

setenv PATH ${PATH}:$/PATH_TO/gate.7.0-install/bin

Environment configuration and starting GATE

We highly recommended to configure a your_file.bashrc (or .cshrc) file to set up all environment variables which are mandatory to perform a full Gate simulation.

This file should be defined as follow:

• bash or zsh:

source /PATH_TO/root_v5.XX/bin/thisroot.sh
export PATH=$PATH:/PATH_TO/2.1.3.1/CLHEP/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/PATH_TO/2.1.3.1/CLHEP/lib
source /PATH_TO/geant4.9.6.p03-install/bin/geant4.sh
export PATH=$PATH:/PATH_TO/gate.7.0-install/bin

• [t]csh

source /PATH_TO/root_v5.XX/bin/thisroot.csh
setenv PATH ${PATH}:/PATH_TO/2.1.3.1/CLHEP/bin
setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/PATH_TO/2.1.3.1/CLHEP/lib
source /PATH_TO/geant4.9.6.p03-install/bin/geant4.csh
setenv PATH ${PATH}:$/PATH_TO/gate.7.0-install/bin

Finally, before to start a GATE session:

$ source your_file.bashrc

then:

$ Gate

/!\ If you are using the Qt interface on non-English locales then you must force Qt to use a locale with a dot for the decimal separator:

$ LC_NUMERIC=C Gate --qt

GPU & CUDA tools

You need to download 2 packages which are the CUDA toolkit provided by NVIDIA and the GPU computing SDK. All details are provided on this web site : http://doc.ubuntu-fr.org/cuda

During the GATE configuration by using ccmake, you need to set ON the GATE_USE_GPU variable and give the correct path for CUDA_SDK_ROOT_DIR and CUDA_TOOLKIT_ROOT_DIR (as illustrated by the following print screen).


Ccmake.png

ECAT7

enter

/opt/simulation/ecat7

copy the right Makefile.<os> to Makefile if Makefile exists this step is not necessary

cp Makefile.unix Makefile

compile

make

this will build the library goto the utils directory copy the right Makefile.<os> to Makefile if Makefile exists this step is not necessary

cp Makefile.unix Makefile

compile do not use make -j4 !!!

make

this will create some ultility programs


After compilation create the following folder: include

mkdir /opt/simulation/ecat7/include

In this folder copy all *.h files

cp *.h /opt/simulation/ecat7/include

check that the file libecat.a is in lib/Linux-g++/ if it isn't copy it there

mkdir lib
mkdir lib/Linux-g++
cp libecat.a lib/Linux-g++/

LMF 3

enter

/opt/simulation/lmf_3_0

configure lmf

./configure

compile do not use make -j4 !!!

make clean
make

If it does not exist, after compilation create the following folder: includes

mkdir /opt/simulation/lmf_3_0/includes

In this folder copy all *.h files, if they aren't in there already

cp *.h /opt/simulation/lmf_3_0/includes

check that the file libLMF.a is in lib/Linux-g++/ if it isn't copy it there

mkdir lib/Linux-g++
cp lib/libLMF.a lib/Linux-g++/

Installation of cluster tools

jobsplitter

go to /opt/simulation/gate6_1/cluster_tools/jobsplitter

cd /opt/simulation/gate6_1/cluster_tools/jobsplitter

make sure Gate pathes are set

source /opt/simulation/gate6_1/env_gate.sh

compile

make

Copy the library to the correct place

cp /opt/simulation/gate6_1/cluster_tools/jobsplitter/tmp/Linux-g++/gjs/libgjs.so /opt/simulation/gate6_1/cluster_tools/jobsplitter/bin/Linux-g++

filemerger

go to /opt/simulation/gate6_1/cluster_tools/filemerger

cd /opt/simulation/gate6_1/cluster_tools/filemerger

make sure Gate pathes are set

source /opt/simulation/gate6_1/env_gate.sh

compile

make