Instalando GEANT4 en un Mac

Bajando, descomprimiendo y compilando

sudo curl -O geant4.web.cern.ch/geant4/support/source/geant4.9.4.p04.tar.gz
sudo tar xzvvf geant4.9.4.p04.tar.gz
sudo mv geant4.9.4.p04 geant4_9.4.4
cd geant4_9.4.4
sudo ./Configure -build
Bla bla
                --- Geant4 Toolkit Build  ---
 
Would you like to see the instructions? [n] y
 
This installation shell script will examine your system and ask you questions
to determine how the Geant4 Toolkit should be installed.  If you get stuck on
a question, you may use a ! shell escape to start a subshell or execute a
command.  Many of the questions will have default answers in square brackets;
typing carriage return will set the default.

On AFS it is allowed to specify either absolute or relative
paths (i.e. starting with the ~username construct).

[Type carriage return to continue] 

The prompt used in this script allows you to use shell variables and backticks
in your answers. You may use $1, $2, etc...  to refer to the words in the
default answer, as if the default line was a set of arguments given to a
script shell. This means you may also use $* to repeat the whole default line.

Everytime there is a substitution, you will have to confirm.  If there is an
error (e.g. an unmatched backtick), the default answer will remain unchanged
and you will be prompted again.

Running 'Configure -d' will bypass nearly all the questions and
use the computed defaults (or answers saved in a configuration
previously generated).

Type 'Configure -h' for a list of options.

You may also start interactively and then answer '& -d' at any prompt to turn
on the non-interactive behaviour for the rest of the execution.

[Type carriage return to continue] 

Much effort has been spent to ensure that this shell script will run on any
Unix system. If despite that you can't run Configure for some reason, you'll
have to set the proper environment variables by hand and follow the "manual"
installation as specified in the Geant4 Installation Guide.

[Type carriage return to continue] 

Definition of G4SYSTEM variable is Darwin-g++.
That stands for:

1) OS      : Darwin

2) Compiler   : g++

To modify default settings, select number above (e.g. 2) 
[Press [Enter] for default settings] 
 
I can set things up so that your shell scripts and binaries are more portable,
at what may be a noticable cost in performance.  In particular, if you
ask to be portable, the following happens:

     1) Shell scripts will rely on the PATH variable rather than using
   the paths derived above.
     2) ~username interpretations will be done at run time rather than
   by Configure.

Do you expect to run these scripts and binaries on multiple machines? [n] 
 
*OPTIONS FOR GEANT4 INSTALLATION PATHS*
What is the path to the Geant4 source tree? 
[/Applications/physics/geant4_9.4.4] 
 
Where should Geant4 be installed?  [/Applications/physics/geant4_9.4.4] 
 
Do you want to install all Geant4 headers in one directory? [n] y
 
*GEANT4 LIBRARY BUILD OPTIONS*
Do you want to build shared libraries? [y] 
Do you want to build static libraries too? [n] 
Do you want to build global libraries? [y] 
Do you want to build granular libraries as well? [n] 
Do you want to build libraries with debugging information? [n] 
 
*CHECKS AND OPTIONS FOR GEANT4 PHYSICS DATA FILES*
Specify the path where the Geant4 data libraries are installed:
[/Applications/physics/geant4_9.4.4/data] 
checking for PhotonEvaporation2.1... no
checking for RadioactiveDecay3.3... no
checking for G4EMLOW6.19... no
checking for G4NDL3.14... no
checking for G4ABLA3.0... no
checking for RealSurface1.0... no
checking for G4NEUTRONXS1.0... no
checking for G4PII1.2... no

Failed to locate one or more of the Geant4 data libraries in 

/Applications/physics/geant4_9.4.4/data 

Please enter
1) Another path to search in
2) 'f' to force the use of the path you entered previously (the data libraries
   are NOT needed to build Geant4, but are needed to run applications later).
3) 'c' to customize the data paths, e.g. if you have the data libraries
   installed in different locations.
[f] 
 
*CHECKS FOR CORRECT MAKE IMPLEMENTATION*
Checking for make... /usr/bin/make
Checking for gmake... no
Checking if make is GNU make... yes
How many parallel jobs should make launch? [1] 4
Checking that 4 is a valid number... yes
 
*CHECKS FOR REQUIRED EXTERNAL PACKAGE CLHEP*

Could not find CLHEP installed on this system!
Please, specify where CLHEP is installed:

CLHEP_BASE_DIR:           /Applications/physics/clhep_2.1.0.1/CLHEP

You can customize paths and library name of you CLHEP installation:

1) CLHEP_INCLUDE_DIR:      /Applications/physics/clhep_2.1.0.1/CLHEP/include
2) CLHEP_LIB_DIR:      /Applications/physics/clhep_2.1.0.1/CLHEP/lib
3) CLHEP_LIB:         CLHEP
To modify default settings, select number above (e.g. 2)
[Press [Enter] for default settings] 
 
*OPTIONS FOR GEANT4 USER INTERFACE MODULES*
Enable building of User Interface (UI) modules? [y] 
Enable building of the XAW (X11 Athena Widget set) UI module? [n] 
Enable building of the X11-Motif (Xm) UI module? [n] 
Enable building of the Qt UI module? [n] 
 
*OPTIONS FOR GEANT4 VISUALIZATION DRIVERS*
Enable building of visualization drivers? [y] 
Enable building of the X11 OpenGL visualization driver? [n] y
Enable building of the X11-Motif OpenGL visualization driver? [n] 
Enable building of the FukuiRenderer/DAWN visualization driver? [n] 
Enable building of the X11 OpenInventor visualization driver? [n] 
Enable building of the X11 RayTracer visualization driver? [n] y
Enable building of the VRML visualization driver? [n] 
 
*OPTIONS FOR GEANT4 OPTIONAL EXTENSION MODULES*
Enable the Geometry Description Markup Language (GDML) module? [n] 
Enable build of the g3tog4 utility module? [n] 
Enable internal zlib compression for HepRep visualization? [n] 
 
End of configuration phase.
 
 
Creating configuration setup file...

WARNING: the generated configuration file
can be edited if necessary!
You can introduce any change to the configuration file
/Applications/physics/geant4_9.4.4/.config/bin/Darwin-g++/config.sh before the final installation. 
To do so, use a shell escape now (e.g. !vi /Applications/physics/geant4_9.4.4/.config/bin/Darwin-g++/config.sh).

Press [Enter] to start installation or use a shell escape to edit config.sh: 
Con un enter emepezará a construirse GEANT4.

/Applications/physics/clhep_2.1.0.1/CLHEP

Bajando los datos

cd /Applications/physics/geant4_9.4.4/data
sudo curl -O geant4.cern.ch/support/source/G4PhotonEvaporation.2.1.tar.gz
sudo curl -O geant4.cern.ch/support/source/G4EMLOW.6.19.tar.gz
sudo curl -O geant4.cern.ch/support/source/G4RadioactiveDecay.3.3.tar.gz
sudo curl -O geant4.cern.ch/support/source/G4NDL.3.14.tar.gz
sudo curl -O geant4.cern.ch/support/source/G4ABLA.3.0.tar.gz
sudo curl -O geant4.cern.ch/support/source/RealSurface.1.0.tar.gz 
sudo curl -O geant4.cern.ch/support/source/G4NEUTRONXS.1.0.tar.gz
sudo curl -O geant4.cern.ch/support/source/G4PII.1.2.tar.gz  
sudo tar xzvvf G4PhotonEvaporation.2.1.tar.gz
sudo tar xzvvf G4EMLOW.6.19.tar.gz
sudo tar xzvvf G4RadioactiveDecay.3.3.tar.gz
sudo tar xzvvf G4NDL.3.14.tar.gz
sudo tar xzvvf G4ABLA.3.0.tar.gz
sudo tar xzvvf RealSurface.1.0.tar.gz
sudo tar xzvvf G4NEUTRONXS.1.0.tar.gz
sudo tar xzvvf G4PII.1.2.tar.gz

Configurando

faq@Obatala.local/Applications/physics/geant4_9.4.4$ sudo ./Configure 
 
                --- Geant4 Toolkit Installation  ---
                  (setting environments for USER )
 
---------------------------------------------------
The Geant4 toolkit installation was found.
The files env.[c]sh will be copied to your current directory.
For setting Geant4 environments you should make:

source env.csh

or

. env.sh

It will also check G4WORKDIR setting and set it to
your HOME if needed.
You can use these files also for further modifications
(adding your own environments).
---------------------------------------------------
faq@Obatala.local/Applications/physics/geant4_9.4.4$ 

Configuren las variables de ambiente y correr un ejemplo.

export G4WORKDIR=$HOME
export DYLD_LIBRARY_PATH=/Applications/physics/clhep_2.1.0.1/CLHEP/lib
source /Applications/physics/geant4_9.4.4/env.sh
Esto nos permitirá trabajar en nuestro $HOME cualquier proyecto de geant4 (excepto los que no se configuraron a la hora de instalar). Hacer solo una vez source .bashrc. Las otras veces que se quiera usar geant4 no será necesario hacer lo mismo.

Ejemplo

Tomar la carpeta de ejemplos que viene con geant4
cd $G4WORKDIR
cp -r /Applications/physics/geant4_9.4.4/examples .
cd examples/novice/N02
make -j4
Estos nos generará un ejecutable en $G4WORKDIR/bin/Darwin-g++/ llamado exampleN02. Para correrlo hacer: ../../../bin/Darwin-g++/exampleN02 .

-- FernandoAndresQuinonezGranados - 02-Jun-2012

Edit | Attach | Watch | Print version | History: r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r1 - 2012-06-02 - FernandoAndresQuinonezGranados
 
    • 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-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback