Installation for Linux

Installing compulsory dependencies

GAMBIT has a number of compulsory dependencies, which must be installed for GAMBIT to be built and run. Some basic information is provided for each dependency. When given the option, it is almost always better to install from source than from a package manager. Installing from source means that the package will be present on your system in the same structure and configuration as the developers intended, which cannot always be guaranteed when using package managers. This might save you some headaches when you configure CMake to build GAMBIT.

C/C++ compiler

One of:

  • GCC (GNU Compiler Collection) ≥ 9,
  • LLVM Clang ≥ 10
  • ICC (Intel C/C++ Compiler) ≥ 15.0.2
More info Gambit is written mainly in C++. It is likely that one of these compilers is already present on your system.
Package nameAvailable via major Linux package managersBinaries availableCan be built from sourceNotes
gccYesYes ⧉Yes ⧉-
clangYesYes ⧉Yes ⧉-
iccNoYesNoBinaries can be downloaded as part of the Intel oneAPI Base Toolkit ⧉ (which also includes the Ifort Fortran compiler) or from the standalone component page ⧉.
Fortran compiler

One of:

  • GFortran (GNU Fortran Compiler) ≥ 9
  • ifort (Intel Fortran Compiler) ≥ 15.0.2
More info

Some parts of GAMBIT are written in Fortran. GFortran is associated with GCC and ifort is associated with ICC, so depending on your C++ compiler you may already have a Fortran compiler installed.

Package nameAvailable via major Linux package managersBinaries availableCan be built from sourceNotes
gcc-gfortranYes ⧉Yes ⧉Yes ⧉ as part of GCC-
ifortNoYesNoBinaries can be downloaded as part of the Intel oneAPI Base Toolkit ⧉ (which also includes the ICC C++ compiler) or from the standalone component page ⧉.
Cmake ≥ 3.16.3
More info

GAMBIT uses the Cmake build system.

Package nameAvailable via major Linux package managersBinaries availableCan be built from sourceNotes
cmakeYesYes ⧉Yes ⧉-
Python + modules

GAMBIT needs Python 3, and Python modules numpy, future, datetime, pyyaml, re, os, sys, getopt, shutil, and itertools

More info

Depending on your current Python installation you might consider installing Anaconda ⧉ instead, which packages Python along with various libraries and tools designed for scientific computing.

Package nameAvailable via major Linux package managersBinaries availableCan be built from sourceNotes
python3YesYes ⧉Yes ⧉-
python-dev or python-devel or numbered variationYesNoNo-

It is good practice to install Python modules within a virtual environment rather than system-wide; see I can’t or don’t want to install dependencies system-wide.

There are a number of Python package managers, however pip is the most common. If you have an up-to-date installation of Python then this should already be installed, otherwise refer to the Pip installation page ⧉. With Python 3 the command to use may be pip3 in place of pip. The individual modules can be installed using pip install $MODULE_NAME, and a list of installed modules can be viewed using pip list. Note that re, os, sys, getopt, shutil, and itertools are part of the Python Standard Library and should already be packaged with Python (attempting to install them with pip will result in ERROR: No matching distribution found for $MODULE_NAME).

Git
More info Git is used for version control.
Package nameAvailable via major Linux package managersBinaries availableCan be built from sourceNotes
gitYes ⧉NoYes ⧉-
Boost ≥ 1.48
More info Boost is a set of commonly-used C++ libraries.
Package nameAvailable via major Linux package managersBinaries availableCan be built from sourceNotes
boostYesNoYes ⧉Most of the components of Boost are header-only.
GSL (GNU Scientific Library) ≥ 2.1
More info GSL is a C software library written for scientific applications.
Package nameAvailable via major Linux package managersBinaries availableCan be built from sourceNotes
gslYesNoYes ⧉-
Eigen ≥ 3.1.0
More info Eigen is a header-only C++ library for linear algebra.
Package nameAvailable via major Linux package managersBinaries availableCan be built from sourceNotes
eigenNoNoYes ⧉Eigen is a header-only library, so does not need to built. Installation involves simply downloading the folder of header files.
LAPACK (Linear Algebra Package)
More info LAPACK is a Fortran library for numerical linear algebra.
Package nameAvailable via major Linux package managersBinaries availableCan be built from sourceNotes
lapackYesYes ⧉Yes ⧉-
pkg-config
More info pkg-config is a tool which makes sure correct compiler options are used on the command line.
Package nameAvailable via major Linux package managersBinaries availableCan be built from sourceNotes
pkg-configNoNoYes ⧉-

Installing optional dependencies

GAMBIT has a number of optional dependencies which you may wish to install depending on how you plan to use GAMBIT.

Show optional dependencies
  • HDF5 (for use of the hdf5 printer)
  • MPI (required for parallel sampling)
  • axel (speeds up downloads of backends and scanners)
  • graphviz (required for model hierarchy and dependency tree plots)
  • ROOT (required for RestFrames support in ColliderBit, or the GreAT scanner from ScannerBit)
  • Mathematica 7.0 or greater (required for the use of Mathematica backends and GUM)
  • UUID (required for the use of the WSTP interface for Mathematica backends and GUM)
  • X11 development libraries (required for the use of GUM)
  • Boost compiled libraries (required for the use of GUM):
    • Boost.Python
    • Boost.Filesystem
    • Boost.System
  • Python modules:
    • cython (required for using the classy backend)
    • scipy (required for using the MontePython or DarkAges backends)
    • numpy ≥ 1.12 (required for using the classy or DarkAges backends)
    • dill (required for using the DarkAges backend)
    • pandas, numexpr (required for using the MontePython backend)
    • h5py (required to use hdf5 utilities located in gambit/Printers/scripts)

Downloading GAMBIT

GAMBIT source code can be obtained either by cloning the GitHub repository from the GitHub page ⧉ or by downloading a compressed .zip or .tar.gz file. In both cases you should download the most recent version available.

Cloning the repository

To clone the repository of version *.* into a specified $FOLDER, use the command:

git clone https://github.com/GambitBSM/gambit_*.*.git $FOLDER
Downloading compressed folders

To instead download a .zip or .tar.gz file, visit the releases page ⧉ or run one of the following commands:

wget https://github.com/GambitBSM/gambit_2.2/archive/refs/tags/v*.*.*.zip       # Download .zip file
wget https://github.com/GambitBSM/gambit_2.2/archive/refs/tags/v*.*.*.tar.gz    # Download .tar.gz file

Note that these files have versions of the form *.*.*. Once downloaded, the files can be extracted via either:

tar -xvf v*.*.*.tar.gz    # Extract .tar.gz file
unzip v*.*.*.zip          # Extract .zip file

Building GAMBIT

Navigate to the folder containing GAMBIT source code. Create a build directory and run Cmake:

mkdir build
cd build
cmake ..

The cmake command will automatically try to find the packages it needs to build GAMBIT. However, it will probably need some help via optional flags. Commonly used flags are listed below; you can add these to the cmake command using the syntax FLAG=VALUE.

If CMake cannot find a package then try adding a relevant flag. For example, Boost will usually require the addition of the -DBoost_INCLUDE_DIR flag pointing to the include subdirectory of the Boost installation directory.

A full list of flags and their values can be found at /build/CMakeCache.txt after every run, and examples of cmake commands can be found on the Configuration Examples page.

FlagValueDescription
-DBoost_INCLUDE_DIRPathShows CMake where to find the Boost include directory.
-DEIGEN3_INCLUDE_DIRPathShows CMake where to find the Eigen include directory. Since Eigen is header-only, point this towards the folder containing the downloaded headers.
-DGSL_CONFIG_EXECUTABLEPathShows CMake where to find the GSL config executable, usually located within the GSL install directory at bin/gsl-config.
-DGSL_INCLUDE_DIRSPathShows CMake where to find the GSL include directory.
-DGSL_LIBRARYPathShows CMake where to find the GSL lib directory.
-DPYTHON_EXECUTABLEPathShows CMake where to find the Python executable. If working from a virtual environment, this will default to the executable in the environment’s bin directory.
-DPYTHON_INCLUDE_DIRPathShows CMake where to find the system’s Python include directory, for example /usr/include/python3.10.
-DPYTHON_LIBRARYPathShows CMake where to find the system’s Python library file. For example, /usr/lib64/libpython3.10.so.1.0.
-DLAPACK_LIBRARIESPathShows CMake where to find the LAPACK library file. For example, /usr/lib64/liblapack.so.3.
-DBLAS_LIBRARIESPathShows CMake where to find the Blas library file. For example, /usr/lib64/libblas.so.3.
-DPKG_CONFIG_EXECUTABLEPathShows CMake where to find the pkg-config config executable, usually located within the pkg-config install directory at bin/pkg-config.
DPKG_CONFIG_PATHPathShows CMake where to find the pkg-config installation directory.
-DitchSemi-colon separated list of Bits and other components, surrounded by quotation marksDitches parts of GAMBIT that you don’t intend to use.
-DCMAKE_BUILD_TYPERelease, Debug or NoneSets the build type
-DBUILD_FS_MODELSSemi-colon separated list of models, surrounded by quotation marksDefines which FlexibleSUSY models to build (model names must correspond to directories in /contrib/MassSpectra/flexiblesusy/models).
-DCMAKE_C_COMPILERPathSets the C compiler.
-DCMAKE_C_flagsC compiler flagsAdds additional C compiler flags.
-DCMAKE_CXX_COMPILERPathSets the C++ compiler.
-DCMAKE_CXX_FLAGSC++ compiler flagsAdds additional C++ compiler flags.
-DCMAKE_Fortran_COMPILERPathSets the Fortran compiler.
-DCMAKE_Fortran_FLAGSFortran compiler flagsAdds additional Fortran compiler flags.
-DWITH_HEPMCOn or OffSwitches HepMC on or off.
-DWITH_RESTFRAMESOn or OffSwitches RestFrames on or off.
-DWITH_ROOTOn or OffSwitches ROOT on or off.
-DPYTHIA_OPTOn or OffSwitches Intel’s multi-file interprocedural optimisation on or off (for use with Pythia).
-DCMAKE_VERBOSE_MAKEFILEOn or OffSwitches verbose build output on or off, useful for debugging.
-DWITH_MPIOn or OffSwitches MPI on or off.
-DWITH_YODAOn or OffSwitches Yoda on or off.
-DSUPPRESS_LIBRARY_WARNINGSOn or OffEnables or disables suppression of some common compiler warnings that are due to external library headers.
-DHAVE_GRAPHVIZOn or OffEnables or disables the creation of Graphviz files.

Next, build GAMBIT’s scanners, specifying the number of cores to use:

make -j$NUMBER_OF_CORES scanners

Then re-run CMake:

cmake ..

Then finally build GAMBIT:

make -j$NUMBER_OF_CORES gambit

Using GAMBIT

Now that GAMBIT has been built, there should be a gambit executable in the directory above the build subdirectory. You can view the installed scanners using ./gambit scanners and the installed backends using ./gambit backends. You can also control the installation of backends using the following:

make -j$NUMBER_OF_CORES backends         # Install all backends
make -j$NUMBER_OF_CORES $BACKEND_NAME    # Install specific backend
make clean-$BACKEND_NAME                 # Clean specific backend

For basic guidance on how to use GAMBIT, please see the tutorials section.