- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Standalone FMU: include all DLL
Standalone FMU: include all DLL
Standalone FMU: include all DLL
Simulating FMU created with OpenModlica requires to install OpenModelica.
Trying to load an FMU produced with OpenModelica with PyFmi on a machine that has not OpenModelica installed on raised the following error:
Code:
pyfmi.fmi.FMUException: Error loading the binary. Could not load the DLL: libSimulationRuntimeC.so: cannot open shared object file: No such file or directory
Is it possible to produce standalone a FMU by including all required component such as libSimulationRuntimeC.so?
Re: Standalone FMU: include all DLL
Yes, use the "static" target of the FMU. Also check the cross compilation options if you want to create FMUs that work on multiple platforms: https://github.com/OpenModelica/OpenMod … ompile.mos
- sjoelund.se
- 1700 Posts
Re: Standalone FMU: include all DLL
Thank you very much, this sounds good.
Could you expand a little on what you mean by “use the static target of the FMU”
For now I am simply using omc's command
Code:
translateModelFMU(className=className, version="2.0", fmuType="me_cs")
Re: Standalone FMU: include all DLL
So you use the default, which is platforms={"dynamic"} (depend on OM being installed). Using platforms={"static"} builds the same FMU as for cross-compilation (try to statically link as much as possible; this is much slower in general, but the FMU should work on more systems).
- sjoelund.se
- 1700 Posts
Re: Standalone FMU: include all DLL
Is “platforms={"static"} ” an argument to be passed to translateModelFMU? In seems to fail in OMShell-terminal
Code:
>>> translateModelFMU(className=className, version="2.0", fmuType="me_cs", platforms={"static"})
>>> getErrorString()
"[<interactive>:1:1-1:0:writable] Error: Class translateModelFMU not found in scope <global scope> (looking for a function or record).
"
By the way, omc --version returns
Code:
OpenModelica 1.12.0~dev-450-gdeecfb
and I use Ubuntu.
Re: Standalone FMU: include all DLL
Works for me when not using className=className, just passing className using positional arguments.
- sjoelund.se
- 1700 Posts
Re: Standalone FMU: include all DLL
Thank you. The same goes here; the following command succeed:
Code:
translateModelFMU(className, version="2.0", fmuType="me_cs", platforms={"static"})
Unfortunately I still get
Code:
FMUException: Error loading the binary. Could not load the DLL: libSimulationRuntimeC.so: cannot open shared object file: No such file or directory
when trying to load it with PyFmi on a machine without OpenModlica installed.
- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Standalone FMU: include all DLL