Installation

Requirements

The Stonefish library requires a modern multi-core processor to run the physics calculations in realtime. A powerful GPU with the support for OpenGL 4.3 or higher is required to run graphical simulations. If the GPU is not fulfilling the requirements it is still possible to run simulation in console mode, with limitted functionality.

Dependencies

The following dependencies have to be installed prior to building the library:

Note

SDL2 library may need a small fix to the CMake configuration file, to avoid build errors. Remove a space after -lSDL2 in /usr/lib/x86_64-linux-gnu/cmake/SDL2/sdl2-config.cmake.

Building

The easiest way to build the library is to let CMake do its job at configuring the build process. The standard build configuration includes building the dynamic library for system-wide use and creating the install target for make. The installation includes the library binary, header files and internal resources. It is possible to define the install location by modifying the standard variable CMAKE_INSTALL_PREFIX, through the command line or the cmake-gui tool.

There are two special build options defined for CMake:

  1. BUILD_TESTS
    • build dynamic library for local use, without an option for system-wide installation

    • set path of internal resources to the source code location

    • build tests/examples of simulators

  2. EMBED_RESOURCES
    • generate C++ code from all internal resources

    • compile the resources and embed them inside the library binary file

    • no need to install resources as files in the shared system location

    • useful for a binary release

The following terminal commands are necessary to clone, build and install the library with a standard configuration (X number of cores to use):

$ git clone "https://github.com/patrykcieslak/stonefish.git"
$ cd stonefish
$ mkdir build
$ cd build
$ cmake ..
$ make -jX
$ sudo make install

Generating code documentation

The following steps are needed to generate and open the documentation of the library code. It is assumed that Doxygen is already installed in the system.

  1. Go to “stonefish” directory.

  2. $ doxygen doxygen

  3. Open “docs/html/index.html”.

3rd party code

The following 3rd party code is included in the source of the library and will be updated manually by the author: