Compiling GiBUU usually is as easy as typing make in the GiBUU base directory. However, a couple of options are available for special situations (see also Makefile Documentation).
Before compiling, make sure that all prerequisites are fulfilled.
You may compile your code via
make [VAR=val | ...]
with VAR = ...
- FORT = ifort,gfortran,...
- FORT = /path/to/compiler/mycompiler
- MODE = opt0,opt1,opt2,opt3
- MODE = opt4
- MODE = opt5
- MODE = lto
- MODE = prof
- MODE = callGraph
- STATIC = 0|1
- FPE = 0|1|2|3
- ARCH = 32
- ARGS = "..."
Choosing a Compiler
By default the Makefile uses the first supported compiler which is found on your system (ifort, gfortran, sunf95 or pgf95 - in this order). But you can also tell the Makefile which compiler to use, by doing e.g.:
In this way you can also specify the exact path of the compiler explicitly:
Choosing an Optimization Level
By default GiBUU is compiled with optimizing flags switched on, corresponding to compiler flags '-O3'. You may change the optimization level by calling e.g.
This works with all compilers and lets you specify the optimization level (0-3).
1) Full debugging code for development and bug tracking is generated withmake MODE=opt0
2) Another option is to use profiling flags:make MODE=prof
Currently this only works with ifort & gfortran, and produces an executable which is suitable for profiling with gprof.
3) In order to get the most optimized code, you may use e.g.make FORT=gfortran MODE=lto ARGS="-march=native"make FORT=ifort MODE=opt3 ARGS="-xHost"
Static vs. Dynamic Linking
Up to release 1.4, the GiBUU executable was always linked statically. Starting with 1.5, dynamic linking is the default, but the old behavior can be recovered via:
Floating Point Exceptions
Checks for floating point exceptions are turned off by default. To change this you can use e.g.
This sets the level for floating point exceptions, which can be 0-3, where FPE=3 means none and FPE=0 means all. FPE=3 is the default. This flag is only supported with ifort and gfortran. Note: We recommend not to use FPE, unless you feel really adventurous. The resulting executable is likely to crash (in particular, PYTHIA has trouble with FPE).
Compiling against a ROOT installation
If you want to use the option of having event output in ROOT format (and have followed our instructions according the prerequisites ROOT and libRootTuple), you have to compile the code with the additional option
This allows, that you may choose ROOT output in your jobcard. It does not automatically sets this as the default output!
If you have a multi-core machine, you can speed up the compilation process by specifying the number of cores to be used by make. E.g. on a quad-code machine you could do
This can potentially be up to four times faster than the standard single-threaded make ("-j1"), since four files can be compiled in parallel.
Rebuilding from scratch
If you want to discard all the object files which have already been generated (e.g. to rebuild with a different compiler or different options, or after making major changes to the code), you should type
This will clean up all present object and module files and rebuild the dependencies, giving you a fresh start in building GiBUU.