Build StochBB from sources
Although there are some binary packages available for Windows, MacOS X and some Linux distributions, you may need or want to build StochBB from its sources. This page provides a step-by-step guide.
Required Software
Before StochBB can be build, some software must be installed.
- git — This version control system will be used to download the current sources.
- cmake — The build system used by StochBB.
- Qt5 — The graphical widget library used by the StochBB GUI application.
- eigen 3 — The linear algebra library used by StochBB.
- gcc/clang — Or any other modern C++ compiler.
These software packages must be installed for compiling StochBB. All these packages are usually available via the package management system of the Linux distribution you use. Please note that also the so-called development packages of Qt5 must be installed.
Building StochBB
Once the required software is installed, StochBB can be build & installed.
First the core library must be build. To download the sources directly from the repository, call from the command line
> git clone https://github.com/stochbb/libstochbb.git
This will download the sources of the core library into a directory named libstochbb. Change into that directory and configure the build with the following commands.
> cd libstochbb/ > mkdir build > cd build > cmake ..
This will prepare the build an check if all needed packages are installed. The last step may fail if a required library and its development files cannot be found by cmake. This step also prepares the installation of the software under the default path (usually /usr/local). If you want to install libstochbb somewhere else, call cmake with an additional argument like
> cmake .. -DCMAKE_INSTALL_PREFIX=/usr
Once the build is configured, the core library can be build with
> make
and installed with
> sudo make install
Now, the core library should be installed. In a next step, the GUI application will be downloaded, build and installed in the same way.
> git clone https://github.com/stochbb/stochbb.git > cd stochbb > cmake .. > make > sudo make install
Again, if you installed the core library not to the default directory, you should also pass the same install prefix to the cmake call that prepares the build of the GUI application.
Under Linux, cmake will install a so-called desktop file. You should then find the StochBB GUI application under applications in your desktop environment. Alternatively, you may start StochBB from the command line with
> stochbb