Geant4.4.1 / CLHEP1.8 /

on MacOSX (10.2 default) (Japanese page is here)

Note

Patches of Geant4.4.1 and precompiled CLHEP(RPM file) for MacOS10.2 (gcc3.1) are available from this page.
In order to install them, you need to install the rpm command beforehand.
Note also that DAWN requires XDarwin, the Darwin port of XFree86 (X11).
(See HEP on X page by Dr. Keisuke Fujii.)

While Geant4.4.1 and CLHEP1.8 must be updated for MacOS10.2, DAWN have not been ported yet.
Use old binaly for DAWN. Recompiled DAWN by gcc3.1 may not work.
STEP library is currently not supported. If you really want to use STEP, use g++2(gcc2.95.2) instead of g++(gcc3.1). In that case, you need to use CLHEP compiled with g++2. See older page.

All patches have been tested on my machine but may not work on your platform.
Install them thus at your own risk.

If you have questions, send mail here. Don't ask Geant4 Official developers.

Spec

Machines

Macintosh PowerBookG4 500MHz Memory 512MB
Macintosh G4 dual 800MHz Memory 1GB

OS MacOSX10.2.1 / kernel : Darwin 6.1
Development
environment
gcc-1151-1b
XFree86-4.2.0.1 (You can obtain it from here.)

How to install

  1. Install CLHEP1.8
    The binary and source packages are available from RPM and SRPM, respectively.
    Typing

    % rpm -ivh clhep-1.8.0.0-1b.ppc.rpm

    installs the binary rpm under /usr/local.

  2. Get Geant4.4.1 source files and patches
    The original source tarball is here. In addition, you need the following patchies to build Geant4 on MacOSX.
  3. Expand the tarball and apply the patches
    Move the source tarball and the patches to a directory of your convenience, then in that directory, type

    % gnutar -zxvf geant4.4.1.gtar.gz
    % ln -s geant4.4.1 pro
    % mv Geant4.4.1-macsox.patch pro
    % cd pro
    % patch -p1 -s < Geant4.4.1-macosx.patch
    % patch -p1 -s < Geant4.4.1-macosx10.2.patch

    Geant4 requires an environmental variable called G4INSTALL be set to the top directory of the Geant4 package.
    In our case, G4INSTALL will be <your convenient directry>/pro.

  4. Define environmental variables
    Add the following lines to ~/.bashrc.

    ##### Geant4 general setting ####
    export G4SYSTEM=Darwin-g++
    export G4USE_STL=1
    export G4INSTALL=$HOME/work/G4/pro (or your convenient directry)
    export CLHEP_BASE_DIR=/usr/local
    export G4DATA=$G4INSTALL/../share/data
    export G4LEVELGAMMADATA=$G4DATA/PhotonEvaporation

    ###### 2. UI

    ############ 2-1. Selection of (G)UI in installation of libraries
    export G4UI_BUILD_TERMINAL_SESSION=1
    export G4UI_BUILD_GAG_SESSION=1

    ############ 2-2. Selection of (G)UI in compiling executables
    export G4UI_USE_TERMINAL=1
    export G4UI_USE_GAG=1

    ###### 3. Visualization
    export G4VRMLFILE_VIEWER=vrwave

    ############ 3-1. Home directory of Mesa
    export OGLHOME=/usr/X11R6

    ############ 3-2. Selection of visualization drivers
    # in installation of libraries
    export G4VIS_BUILD_DAWNFILE_DRIVER=1
    export G4VIS_BUILD_OPENGLX_DRIVER=1
    export G4VIS_BUILD_VRMLFILE_DRIVER=1

    ############ 3-3. Selection of visualization drivers
    # in compiling executables
    export G4VIS_USE_DAWNFILE=1
    export G4VIS_USE_OPENGLX=1
    export G4VIS_USE_VRMLFILE=1

    ############ Selection of viewer
    export GVRMLFILE_VIEWER=vrwave

    ########### image file directry ##############
    export G4DAWNFILE_DEST_DIR=./images/dawn/
    export G4VRMLFILE_DEST_DIR=./images/vrml/

  5. Build Geant4
    Type

    % source ~/.bashrc
    % cd $G4INSTALL/source
    % export G4OPTIMIZE=0
    % make >& make.log &
    % tail -f make.log

    !!!ATTENTION!!!
    We have experienced some anomalous behavior for some of our application programs linked to Geant4 libraries compiled with optimization ("-O").
    The problem disappeared when the entire Geant4 libraries had been recompiled without any optimization ("-O0").
    We have not yet identified exactly which source files should be compiled without optimization.
    For the moment, therefore, using any nonzero optimization level for Geant4 compilation is not recommended on MacOS X.
    By default, a Geant4 config file sets optimization flag.
    Swich off the optimization by typing
    export G4OPTIMIZE=0
    our putting this line into your ~/.bashrc.


  6. Install data files
    Expand data files under $G4DATA.

    % cd $G4DATA
    % gnutar -zxvf G4NDL0.2.tar.gz
    % ln -s PhotonEvaporation.1.0 PhotonEverporation

  7. Install Dawn-3_85b-1 (if you need)
    The old binary package is available from RPM .
    Typing

    % rpm -ivh dawn-3_85b-1.rpm

    installs dawn under /usr/local.

HOME