The OpenModelica FMI & SSP-based co-simulation environment.
OMSimulator can be installed as stand-alone application, as C library to be linked into custom applications, and as python package. OMSimulator is also shipped with the OpenModelica installer, which also includes OMEdit as the graphical editor.
- OpenModelica
- Stand-alone package
- Python 3.8+:
pip3 install OMSimulator
The latest documentation is available as pdf and html versions. For OMSimulatorLib a Doxygen source code documentation is available as well.
Required
- A C++ compiler with C++17 support.
- cmake
Optional
- Sphinx for generating documentation.
- Doxygen for generating documentation.
- GNU Flex for verifying testsuite results.
Note Make sure you have fetched and initialized the OMSimulator submodules
You can do this in one of two ways
-
If you have already cloned OMSimulator, then run
git submodule update --init --recursive
-
If you are cloning the repository, then use
git clone https://github.com/OpenModelica/OMSimulator.git --recurse-submodules
-
Configure OMSimulator
cd OMSimulator cmake -S . -B build/ -DCMAKE_INSTALL_PREFIX=install/
-
Build and install OMSimulator
cd OMSimulator cmake --build build/ --target install ./install/bin/OMSimulator --version
-
Setup OMDev
- Clone OMDev (OpenModelica Development Environment):
git clone https://openmodelica.org/git/OMDev.git
- Follow the instructions in
OMDev/INSTALL.txt
- Clone OMDev (OpenModelica Development Environment):
-
Open a MinGW-64 terminal
-
Configure OMSimulator
cd OMSimulator cmake -S . -B build/ -G "MSYS Makefiles" -DCMAKE_INSTALL_PREFIX=install/
-
Build and install OMSimulator
cd OMSimulator cmake --build build/ --target install ./install/bin/OMSimulator --version
The following versions of Visual Studio are supported:
- Visual Studio 15 2017 Win64 and later
It is not strictly required to install the full Visual Studio IDE. The build only requires Visual C++ Build Tools.
-
Open a Visual Studio command prompt
-
Configure OMSimulator
cd OMSimulator cmake -S . -B build/ -DCMAKE_INSTALL_PREFIX=install/
-
Build and install OMSimulator
cd OMSimulator cmake --build build/ --config Release --target install ./install/bin/OMSimulator.exe --version
The testsuite of OMSimulator is run on Jenkins for every commit and creating test reports. The project is tested for the following OS:
- linux64 without OMPython
- mingw-ucrt64
- msvc64
- cross-compiled OSX
In addition the OpenModelica project has a number of test cases using OMSimulator for FMU simulation that can be find in this OpenModelica test reports.
To verify your build is compiled and installed correctly see the following instructions.
-
Build test dependencies
cmake --build build/ --target testsuite-depends
-
Run partest
cd testsuite/partest/ ./runtests.pl -j4
Use
-jN
to test withN
threads.To disable Python tests add
-asan
.
We currently have no bat-Script to build and test with CMD, so you have to use OMDev mingw shell for the tests.
-
Build test dependencies
cmake --build build/ --target testsuite-depends
-
Run partest
cd testsuite/partest/ ./runtests.pl -j4 -platform=win
Use
-jN
to test withN
threads. To disable TLM tests add-notlm
, to disable Python tests add-asan
.