﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
3238	Export FMI2 with Cpp runtime	Rüdiger Franke	Rüdiger Franke	"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:
1. `translateModelFMU(<model>, version=""2.0"")` to get the `modelDescription.xml` file for FMI2.0
2. `setCommandLineOptions(""+simCodeTarget=Cpp"")` and `translateModelFMU(<model>, version=""2.0"")` to get the C++ code
3. generate the regular simulation executable of the Cpp runtime to get the C++ files updated
4. 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
5. 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  
6. 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."	defect	closed	high	1.9.3	Cpp Run-time	trunk	fixed		Marcus Walther Volker Waurich Niklas Worschech
