Build instructions
==================
The MEmilio core library (MEmilio C++) is written in C++ and uses `CMake `__ as build system. For
building MEmilio C++, you need a C++20 compiler, CMake and a build tool (like GNU Make or Ninja) installed on your
device. Follow the steps from :doc:`../download_and_setup` to set up the required tools and the project.
The following guide will make use of the command line, but you can use graphical build tools from an IDE as well.
Quick start
-----------
These are minimal build instructions. More detailed steps and explanations are given below.
.. code:: bash
git clone https://github.com/SciCompMod/memilio # download the project
cd memilio # go into the project directory
cmake -S cpp -B cpp/build # *configure* the project, creating a "build" directory under cpp/
cmake --build cpp/build -j 2 # *build* all targets from the project with 2 threads
After the build process is done, you can run files from "cpp/build/bin", for example our test suite:
.. code:: bash
./cpp/build/bin/memilio-test
This will run several tests and should write out ``[ PASSED ]`` in the end.
Requirements
------------
MEmilio C++ is regularly tested with the following compilers (list will be extended over time):
- GCC, versions 11 and 13
- Clang, version 14 and 17
- AppleClang, version 21
- MSVC, versions 19.44+ (Visual Studio 2022) and 19.51+ (Visual Studio 2026)
MEmilio C++ is regularly tested on GitHub runners using Ubuntu 22.04 and 24.04, MacOS 26 and Windows Server 2022
and 2025. It is expected to run on any comparable Linux, MacOS or Windows system.
The following table lists the dependencies that are used. Most of them are required, but some are optional. The library
can be used without them but with slightly reduced features. CMake will warn about them during configuration. Most of
them are bundled with this library and do not need to be installed manually. Bundled libraries are either included with
this project or loaded from the web on demand. For each dependency, there is a CMake option to use an installed version
instead. Version compatibility needs to be ensured by the user, the version we currently use is included in the table.
.. list-table::
:header-rows: 1
* - Library
- Version
- Required
- Bundled
- Notes
* - spdlog
- 1.17.0
- Yes
- Yes (git repo)
- https://github.com/gabime/spdlog
* - Eigen
- 3.4.0
- Yes
- Yes (git repo)
- http://gitlab.com/libeigen/eigen
* - Boost
- 1.84.0
- Yes
- Yes (git repo)
- https://github.com/boostorg/boost
* - JsonCpp
- 1.9.6
- No
- Yes (git repo)
- https://github.com/open-source-parsers/jsoncpp
* - HDF5
- 1.12.0
- No
- No
- https://www.hdfgroup.org/, package libhdf5-dev on apt (Ubuntu)
* - GoogleTest
- 1.10
- For Tests only
- Yes (git repo)
- https://github.com/google/googletest
* - LibSBML
- 5.20.2
- No
- No
- https://sbml.org/software/libsbml/ (For SBML integration only)
See the `thirdparty directory `__ for more details.
Step-by-step instructions
-------------------------
In case you have not installed the required tools, or downloaded the MEmilio repository, first follow the steps from the
:doc:`../download_and_setup` section. From here on, we assume that you have a terminal open and have navigated into the MEmilio
repository.
Configuration
~~~~~~~~~~~~~
Before we can *build* anything, we need to *configure* the project first. If you want to use its default options,
simply run cmake in MEmilio's root directory.
.. code:: bash
cmake -S cpp -B cpp/build
The first time you run this it may take some time to complete, as this downloads all bundled dependencies, if not
disabled by the options below. Depending on your internet connection, this may take a couple minutes.
Additional options can be specified by appending one or more ``-D