Compilation Instructions V8.0

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

Package required

The minimal software distribution should be the following:

Geant4 10.3 (including the embedded CLHEP)
GATE V8.0
ITK (version 4.10.xx or later)
Users can also used the external CLHEP 2.3.4.3

Optionnal packages are required for output management:

ROOT (version 5.xx or ROOT 6.xx)
ECAT
LMF

CLHEP

Since the GATE V7.0 release, users can use the CLHEP embedded within each Geant4 distribution. This case, the CMAKE flag GEANT4_USE_SYSTEM_CLHEP, which is OFF by default, must stay OFF.

However, users can use an external CLHEP version (2.3.4.3) by turning flag GEANT4_USE_SYSTEM_CLHEP ON and following the standard installation procedures.

!!!WARNING: Note that since CLHEP version 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 following the GEANT4 recommendations:

http://geant4.web.cern.ch/geant4/support/ReleaseNotes4.10.3.html#2

The recommended version for Geant4 10.2 and GATE V7.2 is CLHEP 2.3.4.3

To install, unzip and untar the downloaded file:

tar -xzf clhep-2.3.4.3.tgz

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

mkdir 2.3.4.3-build
mkdir 2.3.4.3-install

Move into the CLHEP build directory:

cd 2.3.4.3-build

Launching the cmake command and the make command as follow:

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

• [t]csh:

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

ROOT

You can download ROOT at the following address:

https://root.cern.ch/downloading-root

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 your hardware architecture and uncompressed the downloaded file:

• Ubuntu 14 gcc4.8:

tar -xzf root_v6.xx.xx.Linux-ubuntu14-x86_64-gcc4.8.tar.gz

• CentOS Cern 7 gcc4.8:

tar -xzf root_v6.xx.xx.Linux-centos7-x86_64-gcc4.8.tar.gz

Move the ROOT name directory:

mv root root_v6.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_v6.xx/bin/thisroot.sh

• [t]csh:

source /PATH_TO/root_v6.xx/bin/thisroot.csh

Geant4

!!!WARNING: Minimum required version of CMake to build Geant4 10.3 or 10.2 is 3.3!!!

First, download the Geant sources at this address:

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

Unzip and untar the downloaded file:

tar -xzf geant4.10.03.tar.gz

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

mkdir geant4.10.03-build
mkdir geant4.10.03-install

Move into the Geant4 build directory:

cd geant4.10.03-build

Run ccmake as follows:

ccmake ../geant4.10.03

You will obtain the following screen and you need to configure the different options as it is done in this figure: CMakeGeant4.10.3.png

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 can launch the compilation:

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:

source /PATH_TO/geant4.10.03-install/bin/geant4.sh

• [t]csh:

source /PATH_TO/geant4.10.03-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 V8.0

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

First, download the GATE sources at this address:

http://www.opengatecollaboration.org/GATE80

Unzip and untar the downloaded file:

tar -xzf gate_v8.0.tar.gz

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

mkdir gate_v8.0-build
mkdir gate_v8.0-install

Move into the GATE build directory:

cd gate_v8.0-build

Run ccmake as follows:

ccmake ../gate_v8.0

CMakeGATE8.0.png

Warning Information about following environment variables:

BUILD_TESTING                      OFF: by default, set to ON if you want to perform build testing
GATE_DOWNLOAD_BENCHMARKS_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_ITK                       OFF: by default, set to ON if you want to access DICOM reader and thermal therapy capabilities
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_RTK                       OFF: by default, set to ON if you want to use this toolkit
GATE_USE_STDC11                    ON : by default, set to OFF if you want to use another standard for the C programming language (advanced users)
GATE_USE_DAVIS                     OFF: by default, set to ON if you want to use the Davis LUT model
GEANT4_USE_SYSTEM_CLHEP            OFF: by default, set to ON if you want to use an external CLHEP version

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_v8.0-install/bin

• [t]csh

setenv PATH ${PATH}:$/PATH_TO/gate_v8.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 follows:

• bash or zsh:

source /PATH_TO/root_v6.XX/bin/thisroot.sh
source /PATH_TO/geant4.10.03-install/bin/geant4.sh
export PATH=$PATH:/PATH_TO/gate_v8.0-install/bin

If using an external CLHEP library:

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

• [t]csh

source /PATH_TO/root_v6.XX/bin/thisroot.csh
source /PATH_TO/geant4.10.03-install/bin/geant4.csh
setenv PATH ${PATH}:$/PATH_TO/gate_v8.0-install/bin

If using an external CLHEP library:

setenv PATH ${PATH}:/PATH_TO/2.3.4.3/CLHEP/bin
setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/PATH_TO/2.3.4.3/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

ITK

First, download the ITK library sources at this address:

https://itk.org/ITK/resources/software.html

Unzip and tar the downloaded file:

tar -xzf InsightToolkit-4.10.xx.tar.gz

Move into the InsightToolkit-4.10.xx directory:

cd InsightToolkit-4.10.xx

In this directory, create a bin/ sub-directory:

mkdir bin

Move into the bin/ sub-directory:

cd bin

Run ccmake as follows:

ccmake -DITK_USE_REVIEW=ON ..

You will obtain the following screen and you need to configure the different options as follows:

BUILD_EXAMPLES                   ON
BUILD_TESTING                    ON
ITKV3_COMPATIBILITY              OFF
ITK_BUILD_DEFAULT_MODULES        ON
ITK_WRAP_PYTHON                  OFF

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 can launch the compilation:

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

ECAT7

First, create and enter an ecat7 sub-directory:

mkdir /PATH_TO/ecat7
cd /PATH_TO/ecat7

Download the ECAT library sources at this address:

http://www.opengatecollaboration.org/ECAT

Unzip and untar the downloaded file:

tar -xzf ecat.tar.gz
!!!WARNING: if you want to use ECAT7 output module, don't forget to set CMake option GATE_USE_ECAT7 to ON and to provide the path to ECAT7
source directory (i.e /PATH_TO/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

Go to 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 utility programs

After compilation, create the following folder: include/

mkdir /PATH_TO/ecat7/include

In this folder copy all *.h files

cp *.h /PATH_TO/ecat7/include

Check that the file libecat.a is in lib/. If it isn't copy it there

mkdir lib
cp libecat.a lib/

LMF 3

Enter the source directory

/PATH_TO/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 /PATH_TO/lmf_3_0/includes

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

cp *.h /PATH_TO/lmf_3_0/includes

Check that the file libLMF.a is in lib/ If it isn't copy it there

Installation of cluster tools

jobsplitter

Go to /PATH_TO/gate_v8.0/cluster_tools/jobsplitter

cd /PATH_TO/gate_v8.0/cluster_tools/jobsplitter

Make sure ROOT and Geant4 environment variables are set

source /PATH_TO/root_v6.XX/bin/thisroot.sh
source /PATH_TO/geant4.10.03-install/bin/geant4.sh

Compile

make

Copy the gjs executable file to the correct place

cp /PATH_TO/gate_v8.0/cluster_tools/jobsplitter/gjs /PATH_TO/gate_v8.0-install/bin

filemerger

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

source /PATH_TO/root_v6.XX/bin/thisroot.sh
source /PATH_TO/geant4.10.03-install/bin/geant4.sh

Compile

make

Copy the gjs executable file to the correct place

cp /PATH_TO/gate_v8.0/cluster_tools/filemerger/gjm /PATH_TO/gate_v7.2-install/bin

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