Geant4.5.0 / CLHEP1.8 /

on MacOSX (Japanese page is here)

Note

Geant4.5.0 compiles without any patch as long as you use gcc2.95.2 and CLHEP compiled with it.
You can get a binary tarball of CLHEP1.8.00 from here.

If you prefer gcc3.1, you need to apply a patch provided in this page together with a CLHEP-rpm compiled with gcc3.1.
Note that STEP library is currently not supported. If you really want to use STEP, use gcc2.95.2 instead of gcc3.1.


In any case, you need to install the rpm command beforehand since a binary executable of DAWN is only available as a RPM package.
Note also that DAWN requires X11.
(See HEP on X page by Keisuke Fujii.)
Use old binaly for DAWN. Recompiled DAWN by gcc3.1 may not work.

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.5 / kernel : Darwin 6.5
Development
environment
gcc-with-g77-1175-1a
X11 (You can obtain it from Apple's home page.)


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.5.0.p01.gtar.gz
    % ln -s geant4.5.0.p01 pro
    % mv Geant4.5.0-macosx10.2gcc3.patch pro
    % cd pro
    % patch -p1 -s < Geant4.5.0-macosx10.2gcc3.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 ###(/usr/local is included in the default search path. )
    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
    % unset G4OPTIMISE
    % 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
    unset G4OPTIMISE
    our putting this line into your ~/.bashrc.


    If you see following messages, you can quit tail by ctrl + C.

    Reading dependency files...
    Checking for circular dependencies...
    Reordering according to dependencies...
    Writing new library map file...

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

    % cd $G4DATA
    % gnutar -zxvf G4NDL3.7.tar.gz
    % gnutar -zxvf G4EMLOW1.1.tar.gz
    % gnutar -zxvf G4PhotonEvaporation.2.0.tar.gz
    % gnutar -zxvf G4RadiactiveDecay.3.0.tar.gz

  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