#5119 closed defect (fixed)
Segmentation fault in getNumericalJacobianHomotopy when doing a fmuCheck
Reported by: | Owned by: | Lennart Ochel | |
---|---|---|---|
Priority: | blocker | Milestone: | Future |
Component: | FMI | Version: | v1.13.0-dev-nightly |
Keywords: | Cc: |
Description
I hope providing component FMI here is correct, as this seems to only happen when I compile a FMU (on win32).
I marked this a blocker, because it causes a problem on my real application, when using the FMU with Vector CANoe 11.
Backtrace:
#0 0x6ac8b2c4 in getNumericalJacobianHomotopy () from C:\Users\tknodt\AppData\Local\Temp\fmucktmpa13460\binaries\win32\CANoe.dll #1 0x6ac8dbd5 in wrapper_fvec_der () from C:\Users\tknodt\AppData\Local\Temp\fmucktmpa13460\binaries\win32\CANoe.dll #2 0x6ac931eb in solveHomotopy () from C:\Users\tknodt\AppData\Local\Temp\fmucktmpa13460\binaries\win32\CANoe.dll #3 0x6ac89f05 in solve_nonlinear_system () from C:\Users\tknodt\AppData\Local\Temp\fmucktmpa13460\binaries\win32\CANoe.dll #4 0x6abdc2d3 in CANoe_eqFunction_98 (data=data@entry=0x4d511c8, threadData=threadData@entry=0x4d53d28) at CANoe_06inz.c:444 #5 0x6abdca3f in CANoe_functionInitialEquations_0 (data=data@entry=0x4d511c8, threadData=threadData@entry=0x4d53d28) at CANoe_06inz.c:719 #6 0x6abdcf4f in CANoe_functionInitialEquations (data=0x4d511c8, threadData=0x4d53d28) at CANoe_06inz.c:792 #7 0x6ac98c69 in symbolic_initialization () from C:\Users\tknodt\AppData\Local\Temp\fmucktmpa13460\binaries\win32\CANoe.dll #8 0x6ac996d3 in initialization () from C:\Users\tknodt\AppData\Local\Temp\fmucktmpa13460\binaries\win32\CANoe.dll #9 0x6abc2a42 in fmi2EnterInitializationMode (c=0x4d39d38) at include/fmi2/fmu2_model_interface.c:570
Relevant disassemble:
Dump of assembler code for function getNumericalJacobianHomotopy: 0x6ac8b290 <+0>: push %ebp 0x6ac8b291 <+1>: push %edi 0x6ac8b292 <+2>: push %esi 0x6ac8b293 <+3>: push %ebx 0x6ac8b294 <+4>: mov %eax,%ebx 0x6ac8b296 <+6>: sub $0x5c,%esp 0x6ac8b299 <+9>: mov 0x8c(%eax),%esi 0x6ac8b29f <+15>: mov %edx,0x48(%esp) 0x6ac8b2a3 <+19>: mov %ecx,0x4c(%esp) 0x6ac8b2a7 <+23>: test %esi,%esi 0x6ac8b2a9 <+25>: jne 0x6ac8b3ed <getNumericalJacobianHomotopy+349> 0x6ac8b2af <+31>: mov 0x4(%eax),%ecx 0x6ac8b2b2 <+34>: test %ecx,%ecx 0x6ac8b2b4 <+36>: jle 0x6ac8b3e3 <getNumericalJacobianHomotopy+339> 0x6ac8b2ba <+42>: movsd 0x6acd4820,%xmm7 0x6ac8b2c2 <+50>: xor %edi,%edi => 0x6ac8b2c4 <+52>: movaps %xmm7,0x20(%esp) 0x6ac8b2c9 <+57>: movsd 0x6acd4830,%xmm7
I can workaround this, by modifying the Makefile
in the fmu
file and recreating it.
nozip: $(MAINOBJ) CANoe_functions.h CANoe_literals.h $(OFILES) $(RUNTIMEFILES) $(SOLVEROBJSPATH:%=$(RUNTIMEDIR)/%.o) $(CXX) -shared -I. -o CANoe$(DLLEXT) $(MAINOBJ) $(SOLVEROBJSPATH:%=$(RUNTIMEDIR)/%.o) $(RUNTIMEFILES) $(OFILES) $(CPPFLAGS) -L"..." "-LC:/OpenModelica1.13.0-dev-32bit/lib//omc" "-LC:/OpenModelica1.13.0-dev-32bit/lib/" "-L%APPDATA%/.openmodelica/binaries/Modelica" "-LC:/OpenModelica1.13.0-dev-32bit/lib/omlibrary/Modelica 3.2.2/Resources/Library/mingw32" "-LC:/OpenModelica1.13.0-dev-32bit/lib/omlibrary/Modelica 3.2.2/Resources/Library/win32" "-LC:/OpenModelica1.13.0-dev-32bit/lib/omlibrary/Modelica 3.2.2/Resources/Library" -lModelicaStandardTables -lModelicaIO -lModelicaMatIO -lzlib $(CFLAGS) $(LDFLAGS) -llis -Wl,--kill-at
Added is the $(SOLVEROBJSPATH:%=$(RUNTIMEDIR)/%.o)
in both lines.
This also happened with version 1.12.0, not only with the 1.13.0-dev-nightly.
Change History (16)
follow-up: 2 comment:1 by , 6 years ago
comment:2 by , 6 years ago
Replying to adrpo:
Looking at this:
https://github.com/OpenModelica/OMCompiler/blob/master/Compiler/Template/CodegenFMU.tpl#L1204
for the Windows Makefile (generated on the fly, not via configure) we might just need to defineNEED_RUNTIME
to be non-zero.
Works, thanks.
Interestingly with the latest FMU it is not required any more. I am wondering, because they are all nearly equal.
I am beginning to believe that some of the effects are caused by solar radiation. ;-)
follow-up: 4 comment:3 by , 6 years ago
Yeah, the process is complex and there are many things that can affect it, but hopefully solar radiation is not one of them :)
I can confirm the crash, for me it dies in:
#0 0x6abd5a51 in initializeSparsePatternNLS98 () from C:\OMDev\tools\msys\tmp\fmucktmpa28608\binaries\win32\CANoe.dll #1 0x6ac7d764 in updateStaticDataOfNonlinearSystems () from C:\OMDev\tools\msys\tmp\fmucktmpa28608\binaries\win32\CANoe.dll #2 0x6ac8d847 in initialization () from C:\OMDev\tools\msys\tmp\fmucktmpa28608\binaries\win32\CANoe.dll #3 0x6abc269b in fmi2EnterInitializationMode () from C:\OMDev\tools\msys\tmp\fmucktmpa28608\binaries\win32\CANoe.dll
Maybe if is compiled with debug it goes further. Seems too look like an uninitialized something that give random crashes. Time for valgrind I guess.
comment:4 by , 6 years ago
Replying to adrpo:
Yeah, the process is complex and there are many things that can affect it, but hopefully solar radiation is not one of them :)
I can confirm the crash, for me it dies in:
#0 0x6abd5a51 in initializeSparsePatternNLS98 () from C:\OMDev\tools\msys\tmp\fmucktmpa28608\binaries\win32\CANoe.dll #1 0x6ac7d764 in updateStaticDataOfNonlinearSystems () from C:\OMDev\tools\msys\tmp\fmucktmpa28608\binaries\win32\CANoe.dll #2 0x6ac8d847 in initialization () from C:\OMDev\tools\msys\tmp\fmucktmpa28608\binaries\win32\CANoe.dll #3 0x6abc269b in fmi2EnterInitializationMode () from C:\OMDev\tools\msys\tmp\fmucktmpa28608\binaries\win32\CANoe.dllMaybe if is compiled with debug it goes further. Seems too look like an uninitialized something that give random crashes. Time for valgrind I guess.
Would be an explanation. However, I wonder how the simulation results could be correct with having a pointer in these structures something pointing to something valid, but still to the wrong place.
How do you use valgrind under Windows? Or do you "hope" that the same happens under linux/ unix based systems?
comment:5 by , 6 years ago
I hope the same happens in Linux, there is no valgrind for Windows (yet).
comment:6 by , 6 years ago
Too bad, valgrind doesn't show anything. I'll try debugging on Windows a bit more.
comment:7 by , 6 years ago
When I compiled the fmuchecker 32bit myself and used it, it works fine.
I guess there might be some bad interaction between the different compiler runtimes, the fmuchecker one and the FMU one.
adrpo33@ida-0030 MINGW32 /c/home/adrpo33/dev/OMTesting/bugs/5117 # ~/dev/fmucheck/32/fmuCheck.win32.exe CANoe.fmu > trace.txt 2>&1 [INFO][FMUCHK] FMI compliance checker Test [FMILibrary: Test] build date: Sep 13 2018 [INFO][FMUCHK] Called with following options: [INFO][FMUCHK] C:\home\adrpo33\dev\fmucheck\32\fmuCheck.win32.exe CANoe.fmu [INFO][FMUCHK] Will process FMU CANoe.fmu [INFO][FMILIB] XML specifies FMI standard version 2.0 [INFO][FMUCHK] Model name: CANoe [INFO][FMUCHK] Model GUID: {7c923c30-c47c-4a33-919e-22f8e2f9063a} [INFO][FMUCHK] Model version: [INFO][FMUCHK] FMU kind: CoSimulation [INFO][FMUCHK] The FMU contains: 0 constants 2 parameters 14 discrete variables 330 continuous variables 29 inputs 15 outputs 300 local variables 0 independent variables 321 calculated parameters 605 real variables 22 integer variables 5 enumeration variables 27 boolean variables 8 string variables [INFO][FMUCHK] No input data provided. In case of simulation initial values from FMU will be used. [INFO][FMUCHK] Printing output file header [INFO][FMUCHK] Model identifier for CoSimulation: CANoe [INFO][FMILIB] Loading 'win32' binary with 'default' platform types [INFO][FMUCHK] Version returned from CS FMU: 2.0 [INFO][FMUCHK] Initialized FMU for simulation starting at time 0 "time","BCS_Cells_Volt[1]","BCS_Cells_Volt[2]","BCS_Cells_Volt[3]","BCS_Cells_Volt[4]","BCS_Cells_Volt[5]","BCS_Cells_Volt[6]","BCS_Cells_Volt[7]","BCS_Cells_Volt[8]","BCS_Cells_Volt[9]","BCS_Cells_Volt[10]","BCS_Cells_Volt[11]","BCS_Cells_Volt[12]","BCS_Temps_Res[1]","BCS_Temps_Res[2]","klemme_61" 0.0000000000000000E+000,3.5000000000000000E+000,3.5000000000000000E+000,3.5000000000000000E+000,3.5000000000000000E+000,4.6666666666666661E+000,4.6666666666666661E+000,4.6666666666666661E+000,4.6666666666666661E+000,4.6666666666666661E+000,4.6666666666666661E+000,1.4000000000000002E-119,0.0000000000000000E+000,1.0795666237541591E+004,1.0795666237541591E+004,0 1.2000000000000000E-001,3.5000000000000000E+000,3.5000000000000000E+000,3.5000000000000000E+000,3.5000000000000000E+000,4.6666666666666661E+000,4.6666666666666661E+000,4.6666666666666661E+000,4.6666666666666661E+000,4.6666666666666661E+000,4.6666666666666661E+000,1.4000000000000002E-119,0.0000000000000000E+000,1.0795666237541591E+004,1.0795666237541591E+004,0 2.3999999999999999E-001,3.5000000000000000E+000,3.5000000000000000E+000,3.5000000000000000E+000,3.5000000000000000E+000,4.6666666666666661E+000,4.6666666666666661E+000,4.6666666666666661E+000,4.6666666666666661E+000,4.6666666666666661E+000,4.6666666666666661E+000,1.4000000000000002E-119,0.0000000000000000E+000,1.0795666237541591E+004,1.0795666237541591E+004,0 5.9399999999999501E+001,3.5000000000000000E+000,3.5000000000000000E+000,3.5000000000000000E+000,3.5000000000000000E+000,4.6666666666666661E+000,4.6666666666666661E+000,4.6666666666666661E+000,4.6666666666666661E+000,4.6666666666666661E+000,4.6666666666666661E+000,1.4000000000000002E-119,0.0000000000000000E+000,1.0795666237541591E+004,1.0795666237541591E+004,0 5.9519999999999499E+001,3.5000000000000000E+000,3.5000000000000000E+000,3.5000000000000000E+000,3.5000000000000000E+000,4.6666666666666661E+000,4.6666666666666661E+000,4.6666666666666661E+000,4.6666666666666661E+000,4.6666666666666661E+00 [INFO][FMUCHK] Simulation finished successfully at time 60 FMU check summary: FMU reported: 0 warning(s) and error(s) Checker reported: 0 Warning(s) 0 Error(s) 0,4.6666666666666661E+000,1.4000000000000002E-119,0.0000000000000000E+000,1.0795666237541591E+004,1.0795666237541591E+004,0 5.9639999999999496E+001,3.5000000000000000E+000,3.5000000000000000E+000,3.5000000000000000E+000,3.5000000000000000E+000,4.6666666666666661E+000,4.6666666666666661E+000,4.6666666666666661E+000,4.6666666666666661E+000,4.6666666666666661E+000,4.6666666666666661E+000,1.4000000000000002E-119,0.0000000000000000E+000,1.0795666237541591E+004,1.0795666237541591E+004,0 5.9759999999999494E+001,3.5000000000000000E+000,3.5000000000000000E+000,3.5000000000000000E+000,3.5000000000000000E+000,4.6666666666666661E+000,4.6666666666666661E+000,4.6666666666666661E+000,4.6666666666666661E+000,4.6666666666666661E+000,4.6666666666666661E+000,1.4000000000000002E-119,0.0000000000000000E+000,1.0795666237541591E+004,1.0795666237541591E+004,0 5.9879999999999491E+001,3.5000000000000000E+000,3.5000000000000000E+000,3.5000000000000000E+000,3.5000000000000000E+000,4.6666666666666661E+000,4.6666666666666661E+000,4.6666666666666661E+000,4.6666666666666661E+000,4.6666666666666661E+000,4.6666666666666661E+000,1.4000000000000002E-119,0.0000000000000000E+000,1.0795666237541591E+004,1.0795666237541591E+004,0 6.0000000000000000E+001,3.5000000000000000E+000,3.5000000000000000E+000,3.5000000000000000E+000,3.5000000000000000E+000,4.6666666666666661E+000,4.6666666666666661E+000,4.6666666666666661E+000,4.6666666666666661E+000,4.6666666666666661E+000,4.6666666666666661E+000,1.4000000000000002E-119,0.0000000000000000E+000,1.0795666237541591E+004,1.0795666237541591E+004,0
follow-up: 9 comment:8 by , 6 years ago
Good news!
If I compile the dll with all other dependent libs statically it works to run it even with downloaded fmuChecker (the one that previously crashed with).
I'll try to push in this stuff asap which will also fix #5117 via static linking.
comment:9 by , 6 years ago
Replying to adrpo:
Good news!
If I compile the dll with all other dependent libs statically it works to run it even with downloaded fmuChecker (the one that previously crashed with).
I'll try to push in this stuff asap which will also fix #5117 via static linking.
Sounds like there is a compiler and/ or linker flag, which causes an incompatible ABI. As far as I have checked nothing is used which could result in this.
follow-up: 12 comment:10 by , 6 years ago
I spoke too soon, out of 5 runs 2 are crashes.
The problem is more complicated and it has to do with sse and function alignment.
See here for an explanation: http://www.peterstock.co.uk/games/mingw_sse/
Basically we need to compile the simulation/fmi runtime and the FMU with -mstackrealign and then the crash goes away.
comment:11 by , 6 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Should be fixed with 22bbcb/OMCompiler.
comment:12 by , 6 years ago
Replying to adrpo:
I spoke too soon, out of 5 runs 2 are crashes.
The problem is more complicated and it has to do with sse and function alignment.
See here for an explanation: http://www.peterstock.co.uk/games/mingw_sse/
Basically we need to compile the simulation/fmi runtime and the FMU with -mstackrealign and then the crash goes away.
Thanks, I'll test this out today.
What do you think about having a follower ticket, to be more precise here. When my understanding is right, we "only" have to add __attribute__((force_align_arg_pointer))
to every function exported in the DLL, right?
comment:13 by , 6 years ago
Yes, we could probably do that, but it would mean adding it to the FMI function definitions which would be a bit weird. Just open another ticket and we'll keep this in mind.
follow-up: 15 comment:14 by , 6 years ago
What I mean is that the function definitions for FMI are given by the standard:
https://fmi-standard.org/downloads/ (get complete package)
there is an fmi2Functions.h in there.
comment:15 by , 6 years ago
Replying to adrpo:
What I mean is that the function definitions for FMI are given by the standard:
https://fmi-standard.org/downloads/ (get complete package)
there is an fmi2Functions.h in there.
I see, seems to be something for an improvement ticket for the FMI standard. E.g. in AutoSAR there is a compiler abstraction layer for similar things, which allows to add e.g. attributes to function and variable definitions. When you agree, I would see how to create one for the standard.
To the test results. Sorry for being late, the download and installation in our lab finally took a bit too much time for Friday.
Compilation of the simulation in OMEdit:
C:/OpenModelica1.13.0-dev-32bit/share/omc/scripts/Compile.bat CANoe gcc mingw32 parallel 20 0 PATH = "C:\OpenModelica1.13.0-dev-32bit\tools\msys\mingw32\bin;C:\OpenModelica1.13.0-dev-32bit\tools\msys\mingw32\bin\..\..\usr\bin;" gcc -O0 -g -falign-functions -mstackrealign -msse2 -mfpmath=sse -I"C:/OpenModelica1.13.0-dev-32bit/include/omc/c" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME -DOMC_MODEL_PREFIX=CANoe -DOMC_NUM_MIXED_SYSTEMS=0 -DOMC_NUM_LINEAR_SYSTEMS=0 -DOMC_NUM_NONLINEAR_SYSTEMS=2 -DOMC_NDELAY_EXPRESSIONS=0 -DOMC_NVAR_STRING=0 -c -o CANoe.o CANoe.c gcc -O0 -g -falign-functions -mstackrealign -msse2 -mfpmath=sse -I"C:/OpenModelica1.13.0-dev-32bit/include/omc/c" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME -DOMC_MODEL_PREFIX=CANoe -DOMC_NUM_MIXED_SYSTEMS=0 -DOMC_NUM_LINEAR_SYSTEMS=0 -DOMC_NUM_NONLINEAR_SYSTEMS=2 -DOMC_NDELAY_EXPRESSIONS=0 -DOMC_NVAR_STRING=0 -c -o CANoe_functions.o CANoe_functions.c gcc -O0 -g -falign-functions -mstackrealign -msse2 -mfpmath=sse -I"C:/OpenModelica1.13.0-dev-32bit/include/omc/c" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME -DOMC_MODEL_PREFIX=CANoe -DOMC_NUM_MIXED_SYSTEMS=0 -DOMC_NUM_LINEAR_SYSTEMS=0 -DOMC_NUM_NONLINEAR_SYSTEMS=2 -DOMC_NDELAY_EXPRESSIONS=0 -DOMC_NVAR_STRING=0 -c -o CANoe_records.o CANoe_records.c gcc -O0 -g -falign-functions -mstackrealign -msse2 -mfpmath=sse -I"C:/OpenModelica1.13.0-dev-32bit/include/omc/c" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME -DOMC_MODEL_PREFIX=CANoe -DOMC_NUM_MIXED_SYSTEMS=0 -DOMC_NUM_LINEAR_SYSTEMS=0 -DOMC_NUM_NONLINEAR_SYSTEMS=2 -DOMC_NDELAY_EXPRESSIONS=0 -DOMC_NVAR_STRING=0 -c -o CANoe_01exo.o CANoe_01exo.c gcc -O0 -g -falign-functions -mstackrealign -msse2 -mfpmath=sse -I"C:/OpenModelica1.13.0-dev-32bit/include/omc/c" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME -DOMC_MODEL_PREFIX=CANoe -DOMC_NUM_MIXED_SYSTEMS=0 -DOMC_NUM_LINEAR_SYSTEMS=0 -DOMC_NUM_NONLINEAR_SYSTEMS=2 -DOMC_NDELAY_EXPRESSIONS=0 -DOMC_NVAR_STRING=0 -c -o CANoe_02nls.o CANoe_02nls.c gcc -O0 -g -falign-functions -mstackrealign -msse2 -mfpmath=sse -I"C:/OpenModelica1.13.0-dev-32bit/include/omc/c" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME -DOMC_MODEL_PREFIX=CANoe -DOMC_NUM_MIXED_SYSTEMS=0 -DOMC_NUM_LINEAR_SYSTEMS=0 -DOMC_NUM_NONLINEAR_SYSTEMS=2 -DOMC_NDELAY_EXPRESSIONS=0 -DOMC_NVAR_STRING=0 -c -o CANoe_03lsy.o CANoe_03lsy.c gcc -O0 -g -falign-functions -mstackrealign -msse2 -mfpmath=sse -I"C:/OpenModelica1.13.0-dev-32bit/include/omc/c" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME -DOMC_MODEL_PREFIX=CANoe -DOMC_NUM_MIXED_SYSTEMS=0 -DOMC_NUM_LINEAR_SYSTEMS=0 -DOMC_NUM_NONLINEAR_SYSTEMS=2 -DOMC_NDELAY_EXPRESSIONS=0 -DOMC_NVAR_STRING=0 -c -o CANoe_04set.o CANoe_04set.c gcc -O0 -g -falign-functions -mstackrealign -msse2 -mfpmath=sse -I"C:/OpenModelica1.13.0-dev-32bit/include/omc/c" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME -DOMC_MODEL_PREFIX=CANoe -DOMC_NUM_MIXED_SYSTEMS=0 -DOMC_NUM_LINEAR_SYSTEMS=0 -DOMC_NUM_NONLINEAR_SYSTEMS=2 -DOMC_NDELAY_EXPRESSIONS=0 -DOMC_NVAR_STRING=0 -c -o CANoe_05evt.o CANoe_05evt.c gcc -O0 -g -falign-functions -mstackrealign -msse2 -mfpmath=sse -I"C:/OpenModelica1.13.0-dev-32bit/include/omc/c" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME -DOMC_MODEL_PREFIX=CANoe -DOMC_NUM_MIXED_SYSTEMS=0 -DOMC_NUM_LINEAR_SYSTEMS=0 -DOMC_NUM_NONLINEAR_SYSTEMS=2 -DOMC_NDELAY_EXPRESSIONS=0 -DOMC_NVAR_STRING=0 -c -o CANoe_06inz.o CANoe_06inz.c gcc -O0 -g -falign-functions -mstackrealign -msse2 -mfpmath=sse -I"C:/OpenModelica1.13.0-dev-32bit/include/omc/c" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME -DOMC_MODEL_PREFIX=CANoe -DOMC_NUM_MIXED_SYSTEMS=0 -DOMC_NUM_LINEAR_SYSTEMS=0 -DOMC_NUM_NONLINEAR_SYSTEMS=2 -DOMC_NDELAY_EXPRESSIONS=0 -DOMC_NVAR_STRING=0 -c -o CANoe_07dly.o CANoe_07dly.c gcc -O0 -g -falign-functions -mstackrealign -msse2 -mfpmath=sse -I"C:/OpenModelica1.13.0-dev-32bit/include/omc/c" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME -DOMC_MODEL_PREFIX=CANoe -DOMC_NUM_MIXED_SYSTEMS=0 -DOMC_NUM_LINEAR_SYSTEMS=0 -DOMC_NUM_NONLINEAR_SYSTEMS=2 -DOMC_NDELAY_EXPRESSIONS=0 -DOMC_NVAR_STRING=0 -c -o CANoe_08bnd.o CANoe_08bnd.c gcc -O0 -g -falign-functions -mstackrealign -msse2 -mfpmath=sse -I"C:/OpenModelica1.13.0-dev-32bit/include/omc/c" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME -DOMC_MODEL_PREFIX=CANoe -DOMC_NUM_MIXED_SYSTEMS=0 -DOMC_NUM_LINEAR_SYSTEMS=0 -DOMC_NUM_NONLINEAR_SYSTEMS=2 -DOMC_NDELAY_EXPRESSIONS=0 -DOMC_NVAR_STRING=0 -c -o CANoe_09alg.o CANoe_09alg.c gcc -O0 -g -falign-functions -mstackrealign -msse2 -mfpmath=sse -I"C:/OpenModelica1.13.0-dev-32bit/include/omc/c" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME -DOMC_MODEL_PREFIX=CANoe -DOMC_NUM_MIXED_SYSTEMS=0 -DOMC_NUM_LINEAR_SYSTEMS=0 -DOMC_NUM_NONLINEAR_SYSTEMS=2 -DOMC_NDELAY_EXPRESSIONS=0 -DOMC_NVAR_STRING=0 -c -o CANoe_10asr.o CANoe_10asr.c gcc -O0 -g -falign-functions -mstackrealign -msse2 -mfpmath=sse -I"C:/OpenModelica1.13.0-dev-32bit/include/omc/c" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME -DOMC_MODEL_PREFIX=CANoe -DOMC_NUM_MIXED_SYSTEMS=0 -DOMC_NUM_LINEAR_SYSTEMS=0 -DOMC_NUM_NONLINEAR_SYSTEMS=2 -DOMC_NDELAY_EXPRESSIONS=0 -DOMC_NVAR_STRING=0 -c -o CANoe_11mix.o CANoe_11mix.c gcc -O0 -g -falign-functions -mstackrealign -msse2 -mfpmath=sse -I"C:/OpenModelica1.13.0-dev-32bit/include/omc/c" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME -DOMC_MODEL_PREFIX=CANoe -DOMC_NUM_MIXED_SYSTEMS=0 -DOMC_NUM_LINEAR_SYSTEMS=0 -DOMC_NUM_NONLINEAR_SYSTEMS=2 -DOMC_NDELAY_EXPRESSIONS=0 -DOMC_NVAR_STRING=0 -c -o CANoe_12jac.o CANoe_12jac.c gcc -O0 -g -falign-functions -mstackrealign -msse2 -mfpmath=sse -I"C:/OpenModelica1.13.0-dev-32bit/include/omc/c" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME -DOMC_MODEL_PREFIX=CANoe -DOMC_NUM_MIXED_SYSTEMS=0 -DOMC_NUM_LINEAR_SYSTEMS=0 -DOMC_NUM_NONLINEAR_SYSTEMS=2 -DOMC_NDELAY_EXPRESSIONS=0 -DOMC_NVAR_STRING=0 -c -o CANoe_13opt.o CANoe_13opt.c gcc -O0 -g -falign-functions -mstackrealign -msse2 -mfpmath=sse -I"C:/OpenModelica1.13.0-dev-32bit/include/omc/c" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME -DOMC_MODEL_PREFIX=CANoe -DOMC_NUM_MIXED_SYSTEMS=0 -DOMC_NUM_LINEAR_SYSTEMS=0 -DOMC_NUM_NONLINEAR_SYSTEMS=2 -DOMC_NDELAY_EXPRESSIONS=0 -DOMC_NVAR_STRING=0 -c -o CANoe_14lnz.o CANoe_14lnz.c gcc -O0 -g -falign-functions -mstackrealign -msse2 -mfpmath=sse -I"C:/OpenModelica1.13.0-dev-32bit/include/omc/c" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME -DOMC_MODEL_PREFIX=CANoe -DOMC_NUM_MIXED_SYSTEMS=0 -DOMC_NUM_LINEAR_SYSTEMS=0 -DOMC_NUM_NONLINEAR_SYSTEMS=2 -DOMC_NDELAY_EXPRESSIONS=0 -DOMC_NVAR_STRING=0 -c -o CANoe_15syn.o CANoe_15syn.c gcc -O0 -g -falign-functions -mstackrealign -msse2 -mfpmath=sse -I"C:/OpenModelica1.13.0-dev-32bit/include/omc/c" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME -DOMC_MODEL_PREFIX=CANoe -DOMC_NUM_MIXED_SYSTEMS=0 -DOMC_NUM_LINEAR_SYSTEMS=0 -DOMC_NUM_NONLINEAR_SYSTEMS=2 -DOMC_NDELAY_EXPRESSIONS=0 -DOMC_NVAR_STRING=0 -c -o CANoe_16dae.o CANoe_16dae.c gcc -O0 -g -falign-functions -mstackrealign -msse2 -mfpmath=sse -I"C:/OpenModelica1.13.0-dev-32bit/include/omc/c" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME -DOMC_MODEL_PREFIX=CANoe -DOMC_NUM_MIXED_SYSTEMS=0 -DOMC_NUM_LINEAR_SYSTEMS=0 -DOMC_NUM_NONLINEAR_SYSTEMS=2 -DOMC_NDELAY_EXPRESSIONS=0 -DOMC_NVAR_STRING=0 -c -o CANoe_17inl.o CANoe_17inl.c In file included from CANoe_16dae.c:7:0: CANoe_model.h:4:0: warning: "OMC_FILE" redefined #define OMC_FILE "C:/Users/tknodt/AppData/Local/Temp/OpenModelica/OMEdit/CANoe/CANoe_model.h" ^ CANoe_16dae.c:4:0: note: this is the location of the previous definition #define OMC_FILE "C:/Users/tknodt/AppData/Local/Temp/OpenModelica/OMEdit/CANoe/CANoe_16dae.c" ^ In file included from CANoe_04set.c:7:0: CANoe_model.h:4:0: warning: "OMC_FILE" redefined #define OMC_FILE "C:/Users/tknodt/AppData/Local/Temp/OpenModelica/OMEdit/CANoe/CANoe_model.h" ^ In file included from CANoe_02nls.c:7:0: CANoe_model.h:4:0: warning: "OMC_FILE" redefined #define OMC_FILE "C:/Users/tknodt/AppData/Local/Temp/OpenModelica/OMEdit/CANoe/CANoe_model.h" ^ CANoe_04set.c:4:0: note: this is the location of the previous definition #define OMC_FILE "C:/Users/tknodt/AppData/Local/Temp/OpenModelica/OMEdit/CANoe/CANoe_04set.c" ^ In file included from CANoe_03lsy.c:7:0: CANoe_model.h:4:0: warning: "OMC_FILE" redefined #define OMC_FILE "C:/Users/tknodt/AppData/Local/Temp/OpenModelica/OMEdit/CANoe/CANoe_model.h" ^ CANoe_02nls.c:4:0: note: this is the location of the previous definition #define OMC_FILE "C:/Users/tknodt/AppData/Local/Temp/OpenModelica/OMEdit/CANoe/CANoe_02nls.c" ^ CANoe_03lsy.c:4:0: note: this is the location of the previous definition #define OMC_FILE "C:/Users/tknodt/AppData/Local/Temp/OpenModelica/OMEdit/CANoe/CANoe_03lsy.c" ^ In file included from CANoe_01exo.c:7:0: CANoe_model.h:4:0: warning: "OMC_FILE" redefined #define OMC_FILE "C:/Users/tknodt/AppData/Local/Temp/OpenModelica/OMEdit/CANoe/CANoe_model.h" ^ CANoe_01exo.c:4:0: note: this is the location of the previous definition #define OMC_FILE "C:/Users/tknodt/AppData/Local/Temp/OpenModelica/OMEdit/CANoe/CANoe_01exo.c" ^ In file included from CANoe_09alg.c:7:0: CANoe_model.h:4:0: warning: "OMC_FILE" redefined #define OMC_FILE "C:/Users/tknodt/AppData/Local/Temp/OpenModelica/OMEdit/CANoe/CANoe_model.h" ^ CANoe_09alg.c:4:0: note: this is the location of the previous definition #define OMC_FILE "C:/Users/tknodt/AppData/Local/Temp/OpenModelica/OMEdit/CANoe/CANoe_09alg.c" ^ In file included from CANoe_11mix.c:7:0: CANoe_model.h:4:0: warning: "OMC_FILE" redefined #define OMC_FILE "C:/Users/tknodt/AppData/Local/Temp/OpenModelica/OMEdit/CANoe/CANoe_model.h" ^ CANoe_11mix.c:4:0: note: this is the location of the previous definition #define OMC_FILE "C:/Users/tknodt/AppData/Local/Temp/OpenModelica/OMEdit/CANoe/CANoe_11mix.c" ^ In file included from CANoe_10asr.c:7:0: CANoe_model.h:4:0: warning: "OMC_FILE" redefined #define OMC_FILE "C:/Users/tknodt/AppData/Local/Temp/OpenModelica/OMEdit/CANoe/CANoe_model.h" ^ CANoe_10asr.c:4:0: note: this is the location of the previous definition #define OMC_FILE "C:/Users/tknodt/AppData/Local/Temp/OpenModelica/OMEdit/CANoe/CANoe_10asr.c" ^ In file included from CANoe.c:12:0: CANoe_model.h:4:0: warning: "OMC_FILE" redefined #define OMC_FILE "C:/Users/tknodt/AppData/Local/Temp/OpenModelica/OMEdit/CANoe/CANoe_model.h" ^ CANoe.c:4:0: note: this is the location of the previous definition #define OMC_FILE "C:/Users/tknodt/AppData/Local/Temp/OpenModelica/OMEdit/CANoe/CANoe.c" ^ In file included from CANoe_05evt.c:7:0: CANoe_model.h:4:0: warning: "OMC_FILE" redefined #define OMC_FILE "C:/Users/tknodt/AppData/Local/Temp/OpenModelica/OMEdit/CANoe/CANoe_model.h" ^ In file included from CANoe_12jac.c:7:0: CANoe_model.h:4:0: warning: "OMC_FILE" redefined #define OMC_FILE "C:/Users/tknodt/AppData/Local/Temp/OpenModelica/OMEdit/CANoe/CANoe_model.h" ^ CANoe_05evt.c:4:0: note: this is the location of the previous definition #define OMC_FILE "C:/Users/tknodt/AppData/Local/Temp/OpenModelica/OMEdit/CANoe/CANoe_05evt.c" ^ CANoe_12jac.c:4:0: note: this is the location of the previous definition #define OMC_FILE "C:/Users/tknodt/AppData/Local/Temp/OpenModelica/OMEdit/CANoe/CANoe_12jac.c" ^ In file included from CANoe_13opt.c:7:0: CANoe_model.h:4:0: warning: "OMC_FILE" redefined #define OMC_FILE "C:/Users/tknodt/AppData/Local/Temp/OpenModelica/OMEdit/CANoe/CANoe_model.h" ^ In file included from CANoe_14lnz.c:7:0: CANoe_model.h:4:0: warning: "OMC_FILE" redefined #define OMC_FILE "C:/Users/tknodt/AppData/Local/Temp/OpenModelica/OMEdit/CANoe/CANoe_model.h" ^ CANoe_13opt.c:4:0: note: this is the location of the previous definition #define OMC_FILE "C:/Users/tknodt/AppData/Local/Temp/OpenModelica/OMEdit/CANoe/CANoe_13opt.c" ^ CANoe_14lnz.c:4:0: note: this is the location of the previous definition #define OMC_FILE "C:/Users/tknodt/AppData/Local/Temp/OpenModelica/OMEdit/CANoe/CANoe_14lnz.c" ^ In file included from CANoe_07dly.c:7:0: CANoe_model.h:4:0: warning: "OMC_FILE" redefined #define OMC_FILE "C:/Users/tknodt/AppData/Local/Temp/OpenModelica/OMEdit/CANoe/CANoe_model.h" ^ CANoe_07dly.c:4:0: note: this is the location of the previous definition #define OMC_FILE "C:/Users/tknodt/AppData/Local/Temp/OpenModelica/OMEdit/CANoe/CANoe_07dly.c" ^ In file included from CANoe_08bnd.c:7:0: CANoe_model.h:4:0: warning: "OMC_FILE" redefined #define OMC_FILE "C:/Users/tknodt/AppData/Local/Temp/OpenModelica/OMEdit/CANoe/CANoe_model.h" ^ CANoe_08bnd.c:4:0: note: this is the location of the previous definition #define OMC_FILE "C:/Users/tknodt/AppData/Local/Temp/OpenModelica/OMEdit/CANoe/CANoe_08bnd.c" ^ In file included from CANoe_06inz.c:7:0: CANoe_model.h:4:0: warning: "OMC_FILE" redefined #define OMC_FILE "C:/Users/tknodt/AppData/Local/Temp/OpenModelica/OMEdit/CANoe/CANoe_model.h" ^ CANoe_06inz.c:4:0: note: this is the location of the previous definition #define OMC_FILE "C:/Users/tknodt/AppData/Local/Temp/OpenModelica/OMEdit/CANoe/CANoe_06inz.c" ^ In file included from CANoe_15syn.c:7:0: CANoe_model.h:4:0: warning: "OMC_FILE" redefined #define OMC_FILE "C:/Users/tknodt/AppData/Local/Temp/OpenModelica/OMEdit/CANoe/CANoe_model.h" ^ CANoe_15syn.c:4:0: note: this is the location of the previous definition #define OMC_FILE "C:/Users/tknodt/AppData/Local/Temp/OpenModelica/OMEdit/CANoe/CANoe_15syn.c" ^ In file included from CANoe_17inl.c:7:0: CANoe_model.h:4:0: warning: "OMC_FILE" redefined #define OMC_FILE "C:/Users/tknodt/AppData/Local/Temp/OpenModelica/OMEdit/CANoe/CANoe_model.h" ^ CANoe_17inl.c:4:0: note: this is the location of the previous definition #define OMC_FILE "C:/Users/tknodt/AppData/Local/Temp/OpenModelica/OMEdit/CANoe/CANoe_17inl.c" ^ In file included from CANoe_functions.h:42:0, from CANoe_functions.c:6: CANoe_model.h:4:0: warning: "OMC_FILE" redefined #define OMC_FILE "C:/Users/tknodt/AppData/Local/Temp/OpenModelica/OMEdit/CANoe/CANoe_model.h" ^ CANoe_functions.c:4:0: note: this is the location of the previous definition #define OMC_FILE "C:/Users/tknodt/AppData/Local/Temp/OpenModelica/OMEdit/CANoe/CANoe_functions.c" ^ In file included from CANoe_12jac.c:8:0: CANoe_12jac.h:4:0: warning: "OMC_FILE" redefined #define OMC_FILE "C:/Users/tknodt/AppData/Local/Temp/OpenModelica/OMEdit/CANoe/CANoe_12jac.h" ^ In file included from CANoe_functions.h:42:0, from CANoe_model.h:28, from CANoe_12jac.c:7: CANoe_model.h:4:0: note: this is the location of the previous definition #define OMC_FILE "C:/Users/tknodt/AppData/Local/Temp/OpenModelica/OMEdit/CANoe/CANoe_model.h" ^ In file included from CANoe_06inz.c:9:0: CANoe_12jac.h:4:0: warning: "OMC_FILE" redefined #define OMC_FILE "C:/Users/tknodt/AppData/Local/Temp/OpenModelica/OMEdit/CANoe/CANoe_12jac.h" ^ In file included from CANoe_functions.h:42:0, from CANoe_model.h:28, from CANoe_06inz.c:7: CANoe_model.h:4:0: note: this is the location of the previous definition #define OMC_FILE "C:/Users/tknodt/AppData/Local/Temp/OpenModelica/OMEdit/CANoe/CANoe_model.h" ^ In file included from CANoe_13opt.c:8:0: CANoe_12jac.h:4:0: warning: "OMC_FILE" redefined #define OMC_FILE "C:/Users/tknodt/AppData/Local/Temp/OpenModelica/OMEdit/CANoe/CANoe_12jac.h" ^ In file included from CANoe_functions.h:42:0, from CANoe_model.h:28, from CANoe_13opt.c:7: CANoe_model.h:4:0: note: this is the location of the previous definition #define OMC_FILE "C:/Users/tknodt/AppData/Local/Temp/OpenModelica/OMEdit/CANoe/CANoe_model.h" ^ In file included from CANoe_02nls.c:8:0: CANoe_12jac.h:4:0: warning: "OMC_FILE" redefined #define OMC_FILE "C:/Users/tknodt/AppData/Local/Temp/OpenModelica/OMEdit/CANoe/CANoe_12jac.h" ^ In file included from CANoe_03lsy.c:8:0: CANoe_12jac.h:4:0: warning: "OMC_FILE" redefined #define OMC_FILE "C:/Users/tknodt/AppData/Local/Temp/OpenModelica/OMEdit/CANoe/CANoe_12jac.h" ^ In file included from CANoe_functions.h:42:0, from CANoe_model.h:28, from CANoe_02nls.c:7: CANoe_model.h:4:0: note: this is the location of the previous definition #define OMC_FILE "C:/Users/tknodt/AppData/Local/Temp/OpenModelica/OMEdit/CANoe/CANoe_model.h" ^ In file included from CANoe_functions.h:42:0, from CANoe_model.h:28, from CANoe_03lsy.c:7: CANoe_model.h:4:0: note: this is the location of the previous definition #define OMC_FILE "C:/Users/tknodt/AppData/Local/Temp/OpenModelica/OMEdit/CANoe/CANoe_model.h" ^ In file included from CANoe_04set.c:9:0: CANoe_12jac.h:4:0: warning: "OMC_FILE" redefined #define OMC_FILE "C:/Users/tknodt/AppData/Local/Temp/OpenModelica/OMEdit/CANoe/CANoe_12jac.h" ^ In file included from CANoe_functions.h:42:0, from CANoe_model.h:28, from CANoe_04set.c:7: CANoe_model.h:4:0: note: this is the location of the previous definition #define OMC_FILE "C:/Users/tknodt/AppData/Local/Temp/OpenModelica/OMEdit/CANoe/CANoe_model.h" ^ In file included from C:/Users/tknodt/AppData/Local/Temp/OpenModelica/OMEdit/CANoe/CANoe_model.h:3424:0: CANoe_12jac.h:4:0: warning: "OMC_FILE" redefined #define OMC_FILE "C:/Users/tknodt/AppData/Local/Temp/OpenModelica/OMEdit/CANoe/CANoe_12jac.h" ^ In file included from CANoe_functions.h:42:0, from CANoe_model.h:28, from CANoe.c:12: CANoe_model.h:4:0: note: this is the location of the previous definition #define OMC_FILE "C:/Users/tknodt/AppData/Local/Temp/OpenModelica/OMEdit/CANoe/CANoe_model.h" ^ In file included from C:/Users/tknodt/AppData/Local/Temp/OpenModelica/OMEdit/CANoe/CANoe_model.h:3425:0: CANoe_13opt.h:4:0: warning: "OMC_FILE" redefined #define OMC_FILE "C:/Users/tknodt/AppData/Local/Temp/OpenModelica/OMEdit/CANoe/CANoe_13opt.h" ^ In file included from C:/Users/tknodt/AppData/Local/Temp/OpenModelica/OMEdit/CANoe/CANoe_model.h:3424:0: CANoe_12jac.h:4:0: note: this is the location of the previous definition #define OMC_FILE "C:/Users/tknodt/AppData/Local/Temp/OpenModelica/OMEdit/CANoe/CANoe_12jac.h" ^ gcc -I. -o CANoe.exe CANoe.o CANoe_functions.o CANoe_records.o CANoe_01exo.o CANoe_02nls.o CANoe_03lsy.o CANoe_04set.o CANoe_05evt.o CANoe_06inz.o CANoe_07dly.o CANoe_08bnd.o CANoe_09alg.o CANoe_10asr.o CANoe_11mix.o CANoe_12jac.o CANoe_13opt.o CANoe_14lnz.o CANoe_15syn.o CANoe_16dae.o CANoe_17inl.o -I"C:/OpenModelica1.13.0-dev-32bit/include/omc/c" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME -DOMC_MODEL_PREFIX=CANoe -DOMC_NUM_MIXED_SYSTEMS=0 -DOMC_NUM_LINEAR_SYSTEMS=0 -DOMC_NUM_NONLINEAR_SYSTEMS=2 -DOMC_NDELAY_EXPRESSIONS=0 -DOMC_NVAR_STRING=0 -L"C:/Users/tknodt/Documents/porsche_sb/tools/BCS_CANoe_Configuration/FMIs" "-LC:/OpenModelica1.13.0-dev-32bit/lib//omc" "-LC:/OpenModelica1.13.0-dev-32bit/lib/" "-L%APPDATA%/.openmodelica/binaries/Modelica" "-LC:/OpenModelica1.13.0-dev-32bit/lib/omlibrary/Modelica 3.2.2/Resources/Library/mingw32" "-LC:/OpenModelica1.13.0-dev-32bit/lib/omlibrary/Modelica 3.2.2/Resources/Library/win32" "-LC:/OpenModelica1.13.0-dev-32bit/lib/omlibrary/Modelica 3.2.2/Resources/Library" -lModelicaStandardTables -lModelicaIO -lModelicaMatIO -lzlib -O0 -g -falign-functions -mstackrealign -msse2 -mfpmath=sse -I"C:/OpenModelica1.13.0-dev-32bit/include/omc/c" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME -DOMC_MODEL_PREFIX=CANoe -DOMC_NUM_MIXED_SYSTEMS=0 -DOMC_NUM_LINEAR_SYSTEMS=0 -DOMC_NUM_NONLINEAR_SYSTEMS=2 -DOMC_NDELAY_EXPRESSIONS=0 -DOMC_NVAR_STRING=0 -L"C:/OpenModelica1.13.0-dev-32bit/lib//omc" -L"C:/OpenModelica1.13.0-dev-32bit/lib" -Wl,--stack,16777216,-rpath,"C:/OpenModelica1.13.0-dev-32bit/lib//omc" -Wl,-rpath,"C:/OpenModelica1.13.0-dev-32bit/lib" -fopenmp -Wl,-Bstatic -lregex -ltre -lintl -liconv -lexpat -lomcgc -lpthread -loleaut32 -limagehlp -lz -lhdf5 -lszip -Wl,-Bdynamic -Wl,-Bstatic -lSimulationRuntimeC -Wl,-Bdynamic -Wl,-Bstatic -lomcgc -lregex -ltre -lintl -liconv -lexpat -static-libgcc -luuid -loleaut32 -lole32 -limagehlp -lws2_32 -llis -lumfpack -lklu -lcolamd -lbtf -lamd -Wl,-Bdynamic -lsundials_idas -lsundials_kinsol -lsundials_nvecserial -Wl,-Bstatic -lipopt -lcoinmumps -lpthread -lm -lgfortranbegin -lgfortran -lquadmath -lmingw32 -lgcc_eh -lmoldname -lmingwex -lmsvcrt -luser32 -lkernel32 -ladvapi32 -lshell32 -lopenblas -lcminpack -Wl,-Bdynamic -lwsock32 -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic C:/OpenModelica1.13.0-dev-32bit/tools/msys/mingw32/bin/../lib/gcc/i686-w64-mingw32/5.3.0/../../../../lib\libhdf5.a(H5Zdeflate.c.obj):(.text+0x1e9): undefined reference to `compress2' collect2.exe: error: ld returned 1 exit status CANoe.makefile:31: recipe for target 'omc_main_target' failed OpenModelica1.13.0-dev-32bit\tools\msys\mingw32\bin\mingw32-make: *** [omc_main_target] Error 1 Compilation process failed. Exited with code 2.
The FMI builds fine now, also the FMUChecker runs without issues.
In CANoe I have still issues. I will add here more, when I have root-caused them into the DLL.
comment:16 by , 6 years ago
The compress2 undefined reference I fixed in the next commit, so you would need an newer nightly build.
OMC_FILE redefined happens because you compile with -gendebugsymbols. I will check why it actually happens, it shouldn't.
Looking at this:
https://github.com/OpenModelica/OMCompiler/blob/master/Compiler/Template/CodegenFMU.tpl#L1204
for the Windows Makefile (generated on the fly, not via configure) we might just need to define
NEED_RUNTIME
to be non-zero.