OMDc
1.0.0
created from 0b26fa0 on deploy-documentation
|
This repo contains the implementation of OMDc that was presented at the European Control Conference 2025.
Assuming that you are in the repo's directory, the quick start is
Note that you have to activate optimized compilation with -DCMAKE_BUILD_TYPE=Release
when configuring the project with cmake
. See the sections Configurations and Targets below to build the Matlab or Python interface, and generate the documentation with doxygen.
If you found OMDc useful in your scientific work, we encourage you to cite our main paper:
This project is documented with doxygen within the source code. The documentation can be compiled with
Ensure that doxygen is available to cmake. The documenation is also available on Gitlab-Pages under OMDc Documentation.
You may use Awesome Doxygen by specifying
The cmake project supplies several options for building interfaces
Key | Info | required cmake -packages | Default |
---|---|---|---|
BUILD_Matlab | builds with Matlab mex interface | Matlab mex | Off |
BUILD_Python | builds with Python interface | Python, pybind11 | Off |
USE_BLAS | links to external BLAS lib. | BLAS | Off |
USE_OPEN_MP | multi-threading with OpenMP | OpenMP | Off |
GENERATE_DOCS | generate html documentation | Doxygen | Off |
USE_UTF8_FMT | print iter. with UT8 formatting | n/a | Off |
The default configuration only requires the Eigen3 library. The project only specifies static libraries to be linked with, see below. The following command will compile a test target that links against the OMDc framework.
cmake -S . -B <YOUR_BUILD_DIR> cmake --build <YOUR_BUILD_DIR> --target testOMDc --parallel
It only requires Eigen3 to be accessible to cmake. A list of all user-defined variables can be queried with
cmake -S . -B <YOUR_BUILD_DIR> -LH
This project is not built with the mex
command inside Matlab, but with the compiler specified to CMake. Find the related documentation under FindMatlab(). Also note the cross-compilation remarks below.
The interface targets are only available if corresponding options are activated. The static libraries are always configured, and used by the interfaces.
Framework | Static library | Matlab interface | Python interface | Other |
---|---|---|---|---|
Documenation | n/a | n/a | n/a | documentation |
OMD | omd-impl | omd-mex | omd-py | n/a |
OMDc | omdc-impl | omdc-mex | omdc-py | n/a |
The Matlab interface can be cross-compiled from Windows Subsystem for Linux (WSL) to Windows, linking to a Matlab installation on the hosting Windows. It was tested with WSL/Ubuntu-22.04 using mingw64 from the standard Ubuntu packages. The Matlab installation must be accessible from WSL with drvfs. The project is configured by
cmake -S . -B <YOUR_BUILD_DIR> --toolchain TC-windows.cmake -DBUILD_Matlab=True
where a toolchain file, e.g. TC-windows.cmake
, defines the necessary environment:
set(CMAKE_SYSTEM_NAME Windows) set(Matlab_ROOT_DIR "<WSL_PATH_TO_MATLAB_DIR>") # explicitly set mex extension for windows, because mexext.bat is badly executed set(Matlab_MEX_EXTENSION "mexw64") # matlab version cannot be identified, ensure C++ set(Matlab_HAS_CPP_API True) # ensure posix thread model for std::future set(CMAKE_C_COMPILER x86_64-w64-mingw32-gcc-10-posix) set(CMAKE_CXX_COMPILER x86_64-w64-mingw32-g++-posix) # The necessary .dll's libraries are under: # /usr/lib/gcc/x86_64-w64-mingw32/10-posix # the windows pthreads (winpthread.dll) are under # /usr/x86_64-w64-mingw32/lib # copied from online: cmake cross compile set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)