Opened 4 years ago
Last modified 4 years ago
#6122 new defect
FMU/FMI not working neither for local machine nor for cross compilation
Reported by: | Owned by: | Lennart Ochel | |
---|---|---|---|
Priority: | high | Milestone: | Future |
Component: | FMI | Version: | v1.16.0-dev |
Keywords: | FMI FMU | Cc: |
Description
Explaining the scenarios with building and compiling FMI models:
CASE 1: OUTPUT If OMSimulator is used with an FMU created on ARM processor specifying platform as "arm-linux-gnueabihf": (why do we need this when it is not cross-platform compilation?)
OMSimulator works but the output is incorrect when plotted
CASE 2: OUTPUT If OMSimulator is used with an FMU created on ARM processor but without specifying platform: (with the assumption that it will create FMU for the native machine)
execution fails with the following message
error: module FMILIB: Could not change to the DLL directory /tmp/temp_ZaD1mT/binaries/arm-linux-gnueabihf/
error: module FMILIB: The FMU contains no binary for this platform.
error: Could not create the DLL loading mechanism (C-API). Error: The FMU contains no binary for this platform.
info: Result file: model_res.mat
info: Simulation finished.
info: Removed model from scope: model
CASE 3: OUTPUT If OMShell-terminal is used for importing FMU and then simulating:(irrespective of specifying platform)
importFMU() works fine and generates a .mo file but simulation fails with following message
simulate(RLC_me_FMU, stopTime=30.0)
record SimulationResult
resultFile = "",
messages = "Simulation execution failed for model: RLC_me_FMU
module = FMILIB, log level = FATAL: Could not change to the DLL directory /home/pi/Desktop/NPCIL/OMS/binaries/linux32/
module = FMILIB, log level = FATAL: The FMU contains no binary for this platform.
assert | debug | Loading of FMU dynamic link library failed with status : UNEXPECTED
assert | info | simulation terminated by an assertion at initialization
Limited backtrace at point of segmentation fault
Segmentation fault
"
end SimulationResult;
CASE 4: Output when Cross-compiling on a different machine for ARM:
Same output as CASE 2 and CASE 3
Change History (2)
comment:1 by , 4 years ago
comment:2 by , 4 years ago
Problem is generic and not for just one code but I tried for a simple RLC circuit example. Here is the code. It showed the behavior as described in the 4 cases in the ticket:
model RLC type Voltage=Real(unit="V"); type Current=Real(unit="A"); type Resistance=Real(unit="Ohm"); type Capacitance=Real(unit="F"); type Inductance=Real(unit="H"); parameter Voltage Vb=24 "Battery voltage"; parameter Inductance L = 1; parameter Resistance R = 100; parameter Capacitance C = 1e-3; Voltage V; Current i_L; Current i_R; Current i_C; equation V = i_R*R; C*der(V) = i_C; L*der(i_L) = (Vb-V); i_L=i_R+i_C; annotation( experiment(StartTime = 0, StopTime = 30, Interval = 0.01), __OpenModelica_simulationFlags(rt = "1.0") ); end RLC;
@ritesh, please provide test models (you can attach them to this ticket) so that we can reproduce the issues, otherwise it is hard to fix them.