OMSimulator
OMSimulator copied to clipboard
The OpenModelica FMI & SSP-based co-simulation environment.
OMSimulator
The OpenModelica FMI & SSP-based co-simulation environment.
Downloads
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
Documentation
The latest documentation is available as pdf and html versions. For OMSimulatorLib a Doxygen source code documentation is available as well.
FMI cross-check results
- https://libraries.openmodelica.org/fmi-crosschecking/OMSimulator/history/
Dependencies
- Boost (system, filesystem)
- cmake
- Sphinx
- readline (if using Lua)
-
3rdParty subproject
- FMILibrary
- Lua
- PugiXML
- SUNDIALS CVODE
- SUNDIALS KINSOL
- CTPL
Compilation
Note: Make sure to fetch the submodules, e.g., using git submodule update --init
.
Linux / MacOS
-
Install libxml2-dev
sudo apt-get install libxml2-dev
-
Configure OMSimulator
make config-3rdParty make config-OMSimulator
For the debug configuration add
BUILD_TYPE=Debug
tomake config-OMSimulator
. -
Build OMSimulator
make OMSimulator -j4
Windows (OMDev mingw)
-
Setup OMDev
- Checkout OMDev (OpenModelica Development Environment):
git clone https://openmodelica.org/git/OMDev.git
- Follow the instructions in
OMDev/INSTALL.txt
- Checkout OMDev (OpenModelica Development Environment):
-
Configure OMSimulator
make config-3rdParty make config-OMSimulator
For the debug configuration add
BUILD_TYPE=Debug
tomake config-OMSimulator
. -
Build OMSimulator
make OMSimulator -j4
Windows (Visual Studio)
The following versions of Visual Studio are supported:
- "VS14-Win32" -> "Visual Studio 14 2015"
- "VS14-Win64" -> "Visual Studio 14 2015 Win64"
- "VS15-Win32" -> "Visual Studio 15 2017"
- "VS15-Win64" -> "Visual Studio 15 2017 Win64"
It is not strictly required to install the full Visual Studio IDE. The batch scripts only require Visual C++ Build Tools.
-
Install boost (VS14: 1.63, VS15: 1.64)
- Download and install precompiled boost libs, e.g. from this source
- Set environment variable
BOOST_ROOT
to install path, e.g:-
BOOST_ROOT=C:\local\boost_1_64_0
-
-
Configure OMSimulator
.\configWinVS.bat VS15-Win64
To build the debug version change
CMAKE_BUILD_TYPE
toDebug
or change the release type in Visual Studio todebug
. -
Build OMSimulator
.\buildWinVS.bat VS15-Win64
Test your build
The testsuite of OMSimulator is run on Jenkins for every commit and creating test reports. The project is tested for the following OS:
- linux-arm32
- linux64 without OMPython
- cross-compiled mingw64
- 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 corrrectly see the following instructions.
Linux / MacOS / Windows (OMDev mingw)
-
Build test dependencies
make -C testsuite/ difftool resources
-
Run partest
cd testsuite/partest/ ./runtests.pl -j4
Use
-jN
to test withN
threads. To disable TLM tests add-notlm
, to disable Python tests add-asan
.
Windows (Visual Studio)
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
make -C testsuite/ difftool resources
-
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
.