[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
- Install Xcode if you haven't.
(Japanese descriptions)
- 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)
- Using Fink, install:
- g77
- cernlib
- cernlib-dev
- cernlib-geant321
- gsl and gsl-shlibs
by selecting the package and pressing button at the top right corner with "Blue Plus and A".
- If you are using Fink 0.7.2 (for Panther), simply install a precompiled "atlas" package.
- 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.)
- On FinkCommander, under Preferences... > Fink, enable "Use unstable packages".
- Open Terminal, and type
sudo fink install atlas
- This may take a couple of hours. Be patient.
- This will also ask you some questions. Hit RETURN key for default answers.
(FinkCommander does not work, because of these questions asked by xconfig.)
- Wait more.
- 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!
- Since you have installed cernlib by using Fink, the environment variable, $CERN_ROOT, should be already set to "/sw".
- In Makefile, change "/cern/pro" to "$(CERN_ROOT)".
- 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
- Here is an example Makefile.
- 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