Opened 10 years ago
Closed 10 years ago
#3238 closed defect (fixed)
Export FMI2 with Cpp runtime
Reported by: | Rüdiger Franke | Owned by: | Rüdiger Franke |
---|---|---|---|
Priority: | high | Milestone: | 1.9.3 |
Component: | Cpp Run-time | Version: | trunk |
Keywords: | Cc: | Marcus Walther, Volker Waurich, Niklas Worschech |
Description (last modified by )
The FMI export of +simCodeTarget=Cpp
needs to be maintained to work again. Moreover it should be upgraded to support FMI2.0.
Find attached an initial version of FMU2 export. It is proposed to be added to the svn trunc besides the existing FMU
folder under:
SimulationRuntime/cpp/Include/FMU2
The code is derived from the existing C++ FMU export. So far it works for simple models, like a double integrator, including repeated evaluations for trajectory optimization and parameter estimation.
It is still a bit cumbersome to create such an FMU. It works with the following steps:
translateModelFMU(<model>, version="2.0")
to get themodelDescription.xml
file for FMI2.0setCommandLineOptions("+simCodeTarget=Cpp")
andtranslateModelFMU(<model>, version="2.0")
to get the C++ code- generate the regular simulation executable of the Cpp runtime to get the C++ files updated
- adapt OMCpp<model>FMU.cpp to include FMU2/FMU2Wrapper.cpp and FMU2/FMU2Interface.cpp and to create an FMU2Wrapper instead of FMU/FMUWrapper.cpp, FMU/FMULibInterface.cpp, FMUWrapper, respectively
- fix and extend the generated <model>_FMU.makefile (SUITESPARSE_INCLUDE, see #3232, remove misspelled
-l:
LDFLAGS, add the four source files OMCpp<model>CalcHelperMain{2,3,4,5}.cpp - more sophisticated models seem to also need more link libraries ... I didn't identify which ones so far
Can someone confirm that this initial version can be added to the svn as a starting point?
Note that the only difference between FMI1 and FMI2 are three names in the generated OMCpp<model>FMU.cpp
.
Moreover: help for fixing translateModelFMU
so that the result of the above steps is achieved with on call is appreciated. This would also fix the root cause of #3234.
Attachments (1)
Change History (8)
by , 10 years ago
comment:1 by , 10 years ago
comment:2 by , 10 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:3 by , 10 years ago
Description: | modified (diff) |
---|---|
Status: | assigned → accepted |
Summary: | Export FMI2 from Cpp runtime → Export FMI2 with Cpp runtime |
comment:4 by , 10 years ago
comment:5 by , 10 years ago
comment:6 by , 10 years ago
Component: | FMI → FMI-CPP |
---|
comment:7 by , 10 years ago
Resolution: | → fixed |
---|---|
Status: | accepted → closed |
r25341 solves the last point 6.
that is ok, you can add your modifications to the svn.