Compilation Instructions V7.1

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 10.1 (including the embedded CLHEP)
GATE V7.1
Users can also used the external CLHEP 2.2.0.4

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 distributions. The CMAKE flag GEANT4_USE_SYSTEM_CLHEP is OFF by default.

However, users can fell use an external CLHEP version (2.2.0.4) 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.10.1.html

The recommended version for Geant4 10.1 and GATE V7.1 is CLHEP 2.2.0.4

To install, unzip and untar the downloaded file:

tar -xzf clhep-2.2.0.4.tgz

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

mkdir 2.2.0.4-build
mkdir 2.2.0.4-install

Move into the CLHEP build directory:

cd 2.2.0.4-build

Launching the cmake command and the make command as follow:

cmake -DCMAKE_INSTALL_PREFIX=/PATH_TO/2.2.0.4-install /PATH_TO/2.2.0.4/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.2.0.4/-install/bin:/PATH_TO/2.2.0.4/-install/include
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/PATH_TO/2.2.0.4/-install/lib

• [t]csh:

setenv PATH ${PATH}:/PATH_TO/2.2.0.4/-install/bin:/PATH_TO/2.2.0.4/-install/include
setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/PATH_TO/2.2.0.4/-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.10.01.tar.gz

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

mkdir geant4.10.01-build
mkdir geant4.10.01-install

Move into the GEANT4 build directory:

cd geant4.10.01-build

Launching the ccmake as follow:

ccmake ../geant4.10.01

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

CMakeG410.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.10.01-install/bin/geant4.sh

• [t]csh:

source /PATH_TO/geant4.10.01-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.1

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

Download the sources at this address:

http://www.opengatecollaboration.org/GATE71

To install, unzip and untar the downloaded file:

tar -xzf gate_v7.1.tar.gz

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

mkdir gate_v7.1-build
mkdir gate_v7.1-install

Move into the GATE build directory:

cd gate_v7.1-build

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

ccmake ../gate_v7.1

CMakeGATE7.1.jpg

Warning Information about following environment variables:

GATE_DOWNLOAD_BENCHMARKS_DATA      OFF: by default, set to ON if you want to download them
GATE_DOWNLOAD_EXAMPLES_DATA        OFF: by default, set to ON if you want to download them
GATE_USE_ECAT7                     OFF: by default, set to ON if you want to use this library
GATE_USE_GPU                       OFF: by default, set to ON if you want to use GPU modules
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
GEANT4_USE_SYSTEM_CLHEP            OFF: by default, set to ON if you want to use an external CLHEP version (2.2.0.4)

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_v7.1-install/bin

• [t]csh

setenv PATH ${PATH}:$/PATH_TO/gate_v7.1-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
source /PATH_TO/geant4.10.01-install/bin/geant4.sh
export PATH=$PATH:/PATH_TO/gate_v7.1-install/bin

If using an external CLHEP library:

export PATH=$PATH:/PATH_TO/2.2.0.4/CLHEP/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/PATH_TO/2.2.0.4/CLHEP/lib

• [t]csh

source /PATH_TO/root_v5.XX/bin/thisroot.csh
source /PATH_TO/geant4.10.01-install/bin/geant4.csh
setenv PATH ${PATH}:$/PATH_TO/gate_v7.1-install/bin

If using an external CLHEP library:

setenv PATH ${PATH}:/PATH_TO/2.2.0.4/CLHEP/bin
setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/PATH_TO/2.2.0.4/CLHEP/lib

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 /PATH_TO/gate_v7.1/cluster_tools/jobsplitter

cd /PATH_TO/gate_v7.1/cluster_tools/jobsplitter

Make sure ROOT and Geant4 environment variables are set

source /PATH_TO/root_v5.XX/bin/thisroot.sh
source /PATH_TO/geant4.10.01-install/bin/geant4.sh

Compile

make

Copy the gjs executable file to the correct place

cp /PATH_TO/gate_v7.1/cluster_tools/jobsplitter/gjs /PATH_TO/gate_v7.1-install/bin

filemerger

Go to /PATH_TO/gate_v7.1/cluster_tools/filemerger Make sure ROOT and Geant4 environment variables are set

source /PATH_TO/root_v5.XX/bin/thisroot.sh
source /PATH_TO/geant4.10.01-install/bin/geant4.sh

Compile

make

Copy the gjs executable file to the correct place

cp /PATH_TO/gate_v7.1/cluster_tools/filemerger/gjm /PATH_TO/gate_v7.1-install/bin