forked from alcap-org/g4sim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install-geant4.sh
executable file
·38 lines (30 loc) · 1.42 KB
/
install-geant4.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash
# install-root.sh: installs the ROOT package in AlcapDAQ from source
# creates three directories: root/ -- the source directory
# root-build/ -- the build directory
# root-install/ -- the install directory
# Created by: Andrew Edmonds
# Date: 25-04-2014
#
# Requirements: Cmake v2.8 or higher
set -e # Make bash stop if an error occurs
if [ -d "geant4-install" ] ;then
echo It seems Geant4 is already installed. Check the directory:
echo " `pwd`/geant4-install"
echo and remove it if you wish to replace that version of geant4.
exit 1
fi
GEANT4_VERSION=4.10.00.p02
# Get the Geant4 tarball
wget http://geant4.cern.ch/support/source/geant${GEANT4_VERSION}.tar.gz
# Unpack the GEANT4 tarball, this creates the geant4/ directory
# using checkpoint and the pipe tricks is to reduce output down to ~20 lines
tar --checkpoint -xzf geant${GEANT4_VERSION}.tar.gz 2>&1 | grep ".*000$"
# Create the other two directories
mkdir -p geant4-build geant4-install
# Use cmake to create the Makefiles for your system
cd geant4-build/
cmake -DCMAKE_INSTALL_PREFIX=../geant4-install -DGEANT4_INSTALL_DATA=ON -DGEANT4_USE_G3TOG4=ON -DGEANT4_USE_OPENGL_X11=ON -DGEANT4_USE_RAYTRACER_X11=ON ../geant${GEANT4_VERSION}/ 2>&1 |tee install_log.txt
# Now compile and install
make 2>&1 |tee -a install_log.txt
make install 2>&1 |tee -a install_log.txt