Hello Friends,
You must have already had a look at the Geant4-Installation-Guide -
1. http://geant4.web.cern.ch/geant4/UserDocumentation/UsersGuides/InstallationGuide/fo/BookInstalGuide.pdf
on Geant4 webpage -
2. http://geant4.web.cern.ch/geant4/
While installing on my system, sure enough I realized that I need more help with my installation to overcome some of the problems faced. Therefore I am creating this help-page for my own future reference and also to help people with similar platform installing for the first time.
NOTE: This help-page is NOT self-sufficient and just a supplementary to the above Installation-Guide document.
set(CMAKE_INSTALL_BINDIR /Users/jaydeep/activity/GEANT4-all/Geant4_10_00-Install/bin CACHE STRING "")
set(CMAKE_INSTALL_INCLUDEDIR /Users/jaydeep/activity/GEANT4-all/Geant4_10_00-Install/include CACHE STRING "")
set(CMAKE_INSTALL_LIBDIR /Users/jaydeep/activity/GEANT4-all/Geant4_10_00-Install/lib CACHE STRING "")
set(CMAKE_INSTALL_DATAROOTDIR /Users/jaydeep/activity/GEANT4-all/Geant4_10_00-Install/share CACHE STRING "")
set(MOTIF_INCLUDE_DIR /opt/local/include CACHE STRING "")
set(MOTIF_LIBRARIES /opt/local/lib/libXm.dylib CACHE STRING "")
set(OPENGL_X11_INCLUDE_DIR /opt/X11/include/GL CACHE STRING "")
set(OPENGL_X11_gl_LIBRARY /opt/X11/lib/libGL.dylib CACHE STRING "")
set(OPENGL_X11_glu_LIBRARY /opt/X11/lib/libGLU.dylib CACHE STRING "")
set(GEANT4_USE_XM ON CACHE BOOL "")
set(GEANT4_USE_OPENGL_X11 ON CACHE BOOL "")
set(GEANT4_USE_RAYTRACER_X11 ON CACHE BOOL "")
set(GEANT4_INSTALL_DATA ON CACHE BOOL "")
set(GEANT4_USE_GDML ON CACHE BOOL "")
set(GEANT4_USE_QT ON CACHE BOOL "")
set(GEANT4_USE_USOLIDS ON CACHE BOOL "")
set(GEANT4_BUILD_EXAMPLES OFF CACHE BOOL "")
1. Introduction
You must have already had a look at the Geant4-Installation-Guide -
1. http://geant4.web.cern.ch/geant4/UserDocumentation/UsersGuides/InstallationGuide/fo/BookInstalGuide.pdf
on Geant4 webpage -
2. http://geant4.web.cern.ch/geant4/
While installing on my system, sure enough I realized that I need more help with my installation to overcome some of the problems faced. Therefore I am creating this help-page for my own future reference and also to help people with similar platform installing for the first time.
NOTE: This help-page is NOT self-sufficient and just a supplementary to the above Installation-Guide document.
2. Specifications of my OS/Machine
- MacBook pro 13" (mid-2009): 2.26 GHz Intel Core 2 Duo, Ram 4 GB, DDR3, 1067 MHz
- OS X: 10.9.1 (13B42) Mavericks
- Command line terminal: Bashrc
3. Basic necessary Pre-installations
(IMPORTANT FOR GEANT4 INSTALLATION)
- Xcode and command line tools :
- From the installation disk/CD or
- Apple App-store or
- Macports webpage - http://www.macports.org/install.php
- If you have already installed Xcode but not the command line tools, install it by running following command from a terminal => xcode-select --install
- XQuartz/X11 :
- From the installation disk/CD or
- Apple App-store
- Cmake -GUI (Optional): This provides a GUI to build and install the Geant4 source code. Basically for the steps mentioned in Chapter 2 of the Geant4-Installation-Guide.
- Macports (Darwin ports) : Obtain a .dmg file from - http://www.macports.org/install.php. Using Mac ports install the following ports from command line terminal (e.g. sudo port install packagename) -
- Qt4-mac
- Cmake
- Clang
- Xercesc
- Openmotif
- Boost
- Geant4 Source code (GNU or Linux format) - http://geant4.web.cern.ch/geant4/support/download.shtml
4. Installation of Geant4
- Under a general name Geant4-all, create 3 different directories.
- Geant4-all/Geant4_10_00 (This contains Source code)
- Geant4-all/Geant4_10_00-Build (This will contain build, unix executable makefiles)
- Geant4-all/Geant4_10_00-Install (This will contain the installation files - bin, lib, share etc.)
- Along with these folders also create a text file named as mySettings.cmake (i.e. at location Geant4-all/mySettings.cmake) containing following lines
set(CMAKE_INSTALL_BINDIR /Users/jaydeep/activity/GEANT4-all/Geant4_10_00-Install/bin CACHE STRING "")
set(CMAKE_INSTALL_INCLUDEDIR /Users/jaydeep/activity/GEANT4-all/Geant4_10_00-Install/include CACHE STRING "")
set(CMAKE_INSTALL_LIBDIR /Users/jaydeep/activity/GEANT4-all/Geant4_10_00-Install/lib CACHE STRING "")
set(CMAKE_INSTALL_DATAROOTDIR /Users/jaydeep/activity/GEANT4-all/Geant4_10_00-Install/share CACHE STRING "")
set(MOTIF_INCLUDE_DIR /opt/local/include CACHE STRING "")
set(MOTIF_LIBRARIES /opt/local/lib/libXm.dylib CACHE STRING "")
set(OPENGL_X11_INCLUDE_DIR /opt/X11/include/GL CACHE STRING "")
set(OPENGL_X11_gl_LIBRARY /opt/X11/lib/libGL.dylib CACHE STRING "")
set(OPENGL_X11_glu_LIBRARY /opt/X11/lib/libGLU.dylib CACHE STRING "")
set(GEANT4_USE_XM ON CACHE BOOL "")
set(GEANT4_USE_OPENGL_X11 ON CACHE BOOL "")
set(GEANT4_USE_RAYTRACER_X11 ON CACHE BOOL "")
set(GEANT4_INSTALL_DATA ON CACHE BOOL "")
set(GEANT4_USE_GDML ON CACHE BOOL "")
set(GEANT4_USE_QT ON CACHE BOOL "")
set(GEANT4_USE_USOLIDS ON CACHE BOOL "")
set(GEANT4_BUILD_EXAMPLES OFF CACHE BOOL "")
- Save and close this file.
- From terminal goto the Build directory
- and run cmake command as below. This will create the Unix executable files for installation.
- then run- make -j1 VERBOSE=1
- then run- make install
- This should install the Geant4 with the above specified options without error.
- You can also perform above steps using a graphical user interface for Cmake i.e. Cmake -GUI, if you have it installed.
====================================================================
***** NOTE the variable declared *****
- Cmake vaiables
- INSTALL variables (are explicitly declared to avoid mess with other system packages):
- CMAKE_INSTALL_PREFIX=/Users/jaydeep/activity/GEANT4-all/Geant4_10_00-Install
- CMAKE_INSTALL_BINDIR=/Users/jaydeep/activity/GEANT4-all/Geant4_10_00-Install/bin
- CMAKE_INSTALL_INCLUDEDIR=/Users/jaydeep/activity/GEANT4-all/Geant4_10_00-Install/include
- CMAKE_INSTALL_LIBDIR=/Users/jaydeep/activity/GEANT4-all/Geant4_10_00-Install/lib
- CMAKE_INSTALL_DATAROOTDIR=/Users/jaydeep/activity/GEANT4-all/Geant4_10_00-Install/share
- FOR Motif (these variables declared because usual Geant4 installation failed to locate the files. Find the correct location on your system and replace it below):
- MOTIF_INCLUDE_DIR=/opt/local/include (contains - /Xm/Xm.h)
- MOTIF_LIBRARIES=/opt/local/lib/libXm.dylib
- FOR OpenGL (these variables declared because usual Geant4 installation failed to locate the files. Find the correct location on your system and replace it below):
- OPENGL_X11_INCLUDE_DIR=/opt/X11/include/GL (contains gl.h)
- OPENGL_X11_gl_LIBRARY=/opt/X11/lib/libGL.dylib
- OPENGL_X11_glu_LIBRARY=/opt/X11/lib/libGLU.dylib
- Geant4 variables
- GEANT4_USE_XM=ON
- GEANT4_USE_OPENGL_X11=ON
- GEANT4_USE_RAYTRACER_X11=ON
- GEANT4_INSTALL_DATA=ON
- GEANT4_USE_GDML=ON
- GEANT4_USE_QT=ON
- GEANT4_USE_USOLIDS=ON
- GEANT4_BUILD_EXAMPLES=OFF
- Done! See Chapter 3 of the Geant4-Installation-Guide for further procedure.
These variables are declared because the 'cmake' command without these variables failed to find - (1) OpenGL dir and lib (2) Motif dir and lib, which are necessary for GEANT4_USE_XM=ON and GEANT4_USE_OPENGL_X11=ON.
====================================================================
5. Setting up the environment
Once the installation is done successfully, we can go ahead to run a basic test example. But before that we need to initialise Geant4 environment.
Purely for a personal choice of having an uncluttered, clean and tidy environment for Geant4 work projects, I created another folder under Geant4-All called G4-WorkDIR.
Then my geant4 parent directory Geant4-All looks like this -
> cd Geant4-All
> ls
G4-WorkDIR/
Geant4_10_00/
Geant4_10_00-Build/
Geant4_10_00-Install/
mySettings.cmake
**** THIS SECTION IS INCOMPLETE......