Opened 5 years ago
Last modified 3 years ago
#5918 assigned defect
Size of Cpp FMU increased by more than 300% with OMSI
Reported by: | Rüdiger Franke | Owned by: | Niklas Worschech |
---|---|---|---|
Priority: | critical | Milestone: | |
Component: | Cpp Run-time | Version: | v1.16.0-dev |
Keywords: | Cc: | Lennart Ochel |
Description
The size of Cpp FMUs increased tremendously with OMSI. For instance the model dll of a simple integrator with one input, one state and one output grew by 7MB. Please remove unnecessary link dependencies!
Take this example:
setCommandLineOptions("+simCodeTarget=Cpp"); setCommandLineOptions("-d=newInst"); translateModelFMU(Modelica.Blocks.Continuous.Integrator, version="2.0");
The size of a win32 FMU grew from 693KB to 2239KB. The size of the extracted binaries/win32/Modelica_Blocks_Continuous_Integrator.dll grew from 2780KB to 9938KB!
Change History (16)
comment:1 by , 5 years ago
comment:2 by , 5 years ago
Cc: | added |
---|---|
Owner: | changed from | to
Status: | new → assigned |
comment:4 by , 5 years ago
One problem is, that the write simulation results functionality is linked to the fmu, but this is not needed. I will remove this dependency.
I used the 1.15 maintance branche and the current master branch to compare the sizes. In the 1.15 branch the size of the dll is 5.2MB and in the master branch the size is 9,6 MB
comment:5 by , 5 years ago
9.6 MB is more or less 9938 KB obtained by me. 5.2 MB is too large. The 1.15 dev version currently available from openmodelica.org:
generates a dll with size of 2.7 MB. Possibly another problem introduced into 1.15 dev since the last release of the installer on December 6, 2019?
comment:6 by , 5 years ago
Maybe the differences in the 1.15 versions are due to the fact that I created the build with the msys console and the runtimeCPPinstall target and that builds a debug version and not a release version.
comment:7 by , 5 years ago
PR https://github.com/OpenModelica/OpenModelica/pull/817 restructures the system library so that only the part that is needed is linked to the cpp fmu.
comment:8 by , 5 years ago
I built the cpp runtime with the BUILDTYPE=RELEASE flag and then the size for 1.15 version is 2.7 MB
comment:9 by , 5 years ago
With today's nightly build I can confirm that the size of the Integrator FMU/DLL reduced to 760KB/2980KB, which is not that much more than 693KB/2780KB without OMSI.
comment:10 by , 5 years ago
... but attempting to simulate a model with the Cpp runtime from OMEdit under Win32, I get the error:
"libOMCppExtensionUtilities.dll was not found. Reinstalling the program may fix this problem."
follow-up: 12 comment:11 by , 5 years ago
I used this commands to reproduce Error:
loadModel(Modelica); getErrorString(); importFMU("Modelica.Blocks.Continuous.Integrator.fmu"); getErrorString(); loadFile("Modelica_Blocks_Continuous_Integrator_me_FMU.mo"); getErrorString(); simulate(Modelica_Blocks_Continuous_Integrator_me_FMU); getErrorString();
But I git the error message:
Modelica_Blocks_Continuous_Integrator_me_FMU.mo:77:7-77:37:writable] Error: Operator reinit may only be used in the body of a when equation.
Is there a problem with the importFMU function?
comment:13 by , 5 years ago
@rfranke, from comment:9 it looks the issue you raised in this ticket was fixed.
If there are other problems because of missing dll's, and they are still there, would you mind opening a separate ticket?
Thanks!
comment:15 by , 4 years ago
Milestone: | 1.17.0 → 1.18.0 |
---|
Retargeted to 1.18.0 because of 1.17.0 timed release.
Wow. I would also argue that 2780 kB is quite a lot for an integrator block.