[Setting up Mac OS X ...], [Fink, CERNLIB,g77]

How to compile GEANT3 programs on Mac OS X

GEANT is a tool to simulate elementary particles passing through matter and detector. It is used widely for high energy physics.

Installing GEANT3

  1. Install Xcode if you haven't. (Japanese descriptions)
  2. Install Fink (0.8.0 for Mac OS X 10.4 Tiger, 0.7.2 for Mac OS X 10.3 Panther) if you haven't. (Japanese descriptions)
  3. Using Fink, install: by selecting the package and pressing button at the top right corner with "Blue Plus and A".
  4. If you are using Fink 0.7.2 (for Panther), simply install a precompiled "atlas" package.
  5. If you are using Fink 0.8.0 (for Tiger), you have to compile "atlas" by yourself. (The precompiled package is not available as of 2005-06-26.)
    1. On FinkCommander, under Preferences... > Fink, enable "Use unstable packages".
    2. Open Terminal, and type
      sudo fink install atlas
      
    3. This may take a couple of hours. Be patient.
    4. This will also ask you some questions. Hit RETURN key for default answers. (FinkCommander does not work, because of these questions asked by xconfig.)
    5. Wait more.
    6. After it is finished, disable "Use unstable packages" under FinkCommander > Preferences... > Fink.

Changing Makefile

Since some of the library names are different from Linux, you have to change the Makefile for compiling your program using GEANT. I leanred this method from Jon Nix at Univ. of Chicago. Thank you, Jon!

  1. Since you have installed cernlib by using Fink, the environment variable, $CERN_ROOT, should be already set to "/sw".
  2. In Makefile, change "/cern/pro" to "$(CERN_ROOT)".
  3. Change the linking libraries as follows.
    # Linking Flags
    # ~~~~~~~~~~~~~
    LFLAGSF =  -O2
    LFLAGSB = -L$(PACK) \
            -lgeant321 -lpawlib -lgraflib -lgrafX11 \
            -lpacklib -lmathlib -lkernlib -lphtools  \
            -llapack -lf77blas -lgsl -latlas \
            -L/usr/X11R6/lib -lX11 \
            -L/usr/lib/ -lcrypto -ldl
    
    
  4. Here is an example Makefile.
  5. Here is an example program (tgz, 7MB), originally made by Hiro Watanabe (KEK).

That's all, folks, good luck. Don't ask me about GEANT3, since I am just a beginner.


2005-06-27 Taku Yamanaka