Build instructions
==================
The MEmilio core library (MEmilio C++) is written in C++ and uses `CMake `_ as build system. Before
installing MEmilio C++, make sure a C++20 compiler, CMake and a build tool (like GNU Make or Ninja) is installed on your
device. 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
- MSVC, version 19.43 (Visual Studio 2022)
MEmilio C++ is regularly tested on GitHub runners using Ubuntu 22.04 and 24.04 and Windows Server 2022 and 2025. It is
expected to run on any comparable Linux or Windows system. It is currently not tested on macOS.
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.15.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
-------------------------
Download
~~~~~~~~
Start by downloading the newest version (or a specific release) of MEmilio from our
`github repository `_ to a directory of your choice, or clone it directly using
git by first opening a terminal in that directory and then running
.. code:: bash
git clone https://github.com/SciCompMod/memilio
.. dropdown:: :fa:`gears` Note for developers
If you need to push changes to the main repo, register an ssh key with GitHub and clone from
*git@github.com:SciCompMod/memilio.git* instead. You can also change to the ssh address later using
.. code:: bash
git remote set-url origin git@github.com:SciCompMod/memilio.git
This will create a new directory called "memilio". Change into this directory.
.. code:: bash
cd memilio
Configuration
~~~~~~~~~~~~~
Before we can *build* anything, we need to *configure* the project first. If you want to use its default options,
simply run
.. code:: bash
cmake -S cpp -B cpp/build
Additional options can be specified by appending one or more ``-D