create new tag
view all tags

BDSIM Install

*This page is no longer maintained. For the most up to date installation instructions see http://www.pp.rhul.ac.uk/bdsim/manual/installation.html*

This page is left for now since it contains some additional information on how to install dependent packages.

Please send any comments to laurie.nevay at rhul.ac.uk



  • tested on Mac OS 10.8 and older
  • The XQuartz package for X11 windowing under MacOSX should be installed.


Macports allows various packages to be installed along with their necessary dependencies. We use it to install the dependencies of Geant:

sudo port install xercesc3

For Qt visualisation (recommended) install qt4 for Geant4 versions 10:

sudo port install qt4-mac

And openmotif (for motif support):

sudo port install openmotif

Geant4 is available on Macports also:

sudo port install geant4.10.1

CLHEP can also be installed from macports (or from source, see below)

sudo port install clhep


If not installed with macports, download the or newer version from the CLHEP website.

Move and unpack to a suitable place:

tar -xzf clhep-

Make build directory:

mkdir build
cd build
cmake ../
sudo make install

Configure and Build:

See configure options for more details.

Configure and build (as always building can be sped up by using multiple threads depending on the number of cores, with 'make -j4'):


Test and build:

make check
sudo make install


If not built with MacPorts then download Geant4.10.1 or an older version from the Geant archive.

Move and unpack to a suitable place:

tar -xzf geant4.10.01.p01.tar.gz
cd geant4.10.01.p01

Make build directory

mkdir build
cd build


Configure and select C/C++ compiler (optional). Switch on GDML support and visualisation drivers in Geant4 as preferred. A full list of options can be found on the Geant website.





Check if options are alright (some users reported problems here), or if you want to switch some (for example the installation directory):

ccmake .

If not correct, then change manually (by pressing return), press 'c' and then 'q' (configure and quit)

Build and install

'make' or 'make -j4' (for speedup, using multiple processors, in this case 4)
sudo make install



Move and unpack to a suitable place:

tar -xzf geant4.10.01.p01.tar.gz
cd geant4.10.01.p01

Install necessary packages CLHEP and xerces-c. xerces-c can be installed from sources or via a package installer like yum.

ROOT (optional)

Download the sources from ROOT and follow the instructions. Both versions 5 and 6 are compatible with BDSIM.

AFS connected machine (not for Mac so far, since not aware of Mac-compatible Geant version on AFS)

  • tested on SLC5 and SLC6
When the machine has AFS connection, then the dependent packages like Geant4 can be taken from there and don't need to be installed.

The same compiler version needs to be used for BDSIM as the one for Geant4.

For version 0.6 and older

source /afs/cern.ch/user/j/jsnuveri/public/gcc46-setup.sh
source /afs/cern.ch/user/j/jsnuveri/public/geant4.9.6-setup.sh

For the versions 0.61-0.65 and the develop branch

source /afs/cern.ch/user/j/jsnuveri/public/gcc47-setup.sh
source /afs/cern.ch/user/j/jsnuveri/public/geant4.10-setup.sh



The recommended possibility is to clone the git repository

If the clone gets stuck with "error: RPC failed; result=22, HTTP code = 405" then just CTRL-C. The checkout will have been successful.

git clone --recursive https://bitbucket.org/jairhul/bdsim
cd bdsim

The recursive flag is to get a copy of various utilities that exist as separately developed git repositories. Entirely optional. This will get you the official version 0.65.

make build directory:

mkdir build
cd build


cmake ..

If not succesful, additional debug output can be generated with setting the environment variable VERBOSE:

'export VERBOSE=1'

Check or change options (optional):

ccmake .



Doxygen documentation can be generated with

make doc

Test (optional)

Note that when using the Geant4 physics processes one needs to source the Geant4 data script. This can be found in the installation directory of Geant4, e.g.:

source /opt/local/bin/geant4.(c)sh

It can be advised to put this line into your profile.

All tests (several minutes):


Only short tests:

ctest -E LONG

Visualisation test. Run one of the examples, e.g.

cd examples/ATF2
../../bdsim --file=atf2.gmad

Select a graphics system in the file vis.mac that is available for you. An OpenGL one (e.g. OGLSQt) is recommended.


sudo make install

Trouble shooting

Run Error

"Environment variable G4LEDATA not defined"

This means that the geant4.(c)sh script was not sourced. It can be found in the bin directory of the Geant4 installation. It can be advised to put this line into your profile.

Visualisation does not work

"parameter value is not listed in the candidate List."

Check which graphics systems BDSIM has available, this is shown in the terminal. E.g.:

You have successfully registered the following graphics systems.
Current available graphics systems are:
  G4HepRepFile (HepRepFile)
  OpenGLImmediateQt (OGLIQt)
  OpenGLImmediateX (OGLIX)
  OpenGLImmediateXm (OGLIXm)
  OpenGLStoredQt (OGLSQt)
  OpenGLStoredX (OGLSX)
  OpenGLStoredXm (OGLSXm)
  RayTracerX (RayTracerX)

If your favourite is not there check that Geant4 is correctly compiled with those graphics system.

Error from OpenGL

G4OpenGLImmediateX::CreateViewer: error flagged by negative view id in
G4OpenGLImmediateXViewer creation.

Check that your graphics card driver is installed correctly for your memory card and possibly reinstall them.

For Ubuntu, run:


If fglrx is installed and working well you should see an output similar to:

display: :0  screen: 0
OpenGL vendor string: Advanced Micro Devices, Inc.
OpenGL renderer string: ATI Radeon HD 4300/4500 Series       
OpenGL version string: 3.3.11399 Compatibility Profile Context

For more info see https://help.ubuntu.com/community/BinaryDriverHowto/AMD

Build does not work

GLIBCXX errors

If one gets errors like

Linking CXX executable bdsim
/afs/cern.ch/sw/lcg/external/geant4/9.6.p02/x86_64-slc6-gcc46-opt/lib64/libG4analysis.so: undefined reference to `std::__detail::_List_node_base::_M_unhook()@GLIBCXX_3.4.15'

This means compiler version for BDSIM is different from the one used to compile Geant4. Make sure it is the same compiler version. Remember to start from a clean build directory otherwise cmake does NOT update the compiler version.

CLHEP undefined symbols from HepRandom

Undefined symbols for architecture x86_64:
  "CLHEP::HepRandom::saveFullState(std::__1::basic_ostream<char, std::__1::char_traits<char> >&)", referenced from:

Make sure the manual installed CLHEP is linked to.

Edit | Attach | Watch | Print version | History: r54 < r53 < r52 < r51 < r50 | Backlinks | Raw View | Raw edit | More topic actions

Physics WebpagesRHUL WebpagesCampus Connect • Royal Holloway, University of London, Egham, Surrey TW20 0EX; Tel/Fax +44 (0)1784 434455/437520

Topic revision: r54 - 30 Aug 2017 - LaurieNevay

This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2022 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding RHUL Physics Department TWiki? Send feedback