Opened 7 years ago

Closed 7 years ago

#4772 closed defect (fixed)

Problems with Cpp runtime under Win32

Reported by: Rüdiger Franke Owned by: Martin Sjölund
Priority: normal Milestone: 1.13.0
Component: Build Environment Version:
Keywords: Cc: Niklas Worschech, Adrian Pop

Description

The following model simulates and can be exported as FMU with the Cpp runtime under Linux.

model TableTest
  extends Modelica.Blocks.Tables.CombiTable2D(
      table = [0.0,   1.0,   2.0,   3.0;
               1.0,   1.0,   3.0,   5.0;
               2.0,   2.0,   4.0,   6.0]);
  annotation(uses(Modelica(version="3.2.2")));
end TableTest;

The 32bit Windows release of OpenModelica produces the following errors:

  1. Simulation from OMEdit stops with the error message:
     simulation manager: Simulation failed for C:/Users/Someone/AppData/Local/Temp/OpenModelica/OMEdit/TableTest/TableTest_res.mat with error in simulation manager:
    Could not initialize system
    Could not read start values. Current variable reference is 1
    
  1. FMI export from OMEdit raises linker errors:
    C:/OpenModelica1.13.0-dev-32bit//lib//omc\libModelicaIO.a(ModelicaIO.o): In function `readMatIO': 
    C:\dev\OpenModelica32bit\OMCompiler\3rdParty\ModelicaExternalC\BuildProjects\autotools/../../C-Sources/ModelicaIO.c:446: undefined reference to `Mat_Open' 
    C:\dev\OpenModelica32bit\OMCompiler\3rdParty\ModelicaExternalC\BuildProjects\autotools/../../C-Sources/ModelicaIO.c:455: undefined reference to `Mat_VarReadInfo' 
    ...
    

It appears that EXTRA_LIBS that is initialized during code generation from makefileParams.libs has the wrong order:

-lModelicaStandardTables -lModelicaIO -lModelicaMatIO -lzlib

The linker error disappears with:

-lModelicaIO -lModelicaMatIO -lModelicaStandardTables

Btw. why do you link -lzlib to the FMU?

Moreover, -lModelicaStandardTables also finds in c:/OpenModelica1.13.0-dev-32bit/lib/omc/cpp. Should this possibly be removed and taken from Modelica 3.2.2 Resources instead?

Change History (8)

comment:1 by Rüdiger Franke, 7 years ago

Cc: Adrian Pop added

comment:2 by Rüdiger Franke, 7 years ago

A new ticket will be opened for the first problem.

Commt cacc8b works around the second problem.

The external function calls in Modelica.Blocks.Tables (MSL 3.2.2) define:

   annotation (Library={"ModelicaStandardTables", "ModelicaMatIO", "zlib"})

It should be:

   annotation (Library={"ModelicaMatIO", "ModelicaStandardTables", "zlib"})

considering the order of mutual dependencies (if zlib is needed at all).

The questions arise, if MSL 3.2.2 is really wrong and why OpenModelica additionally links -lModelicaIO. Also the second linkage of -lModelicaStandardTables should be removed once the order is correct.

comment:3 by Rüdiger Franke, 7 years ago

Priority: blockernormal

Commt cacc8b came just in time for today's nightly Win32 build. FMU export works now and the criticality of this ticket can be reduced.

See #4773 for the first problem though.

comment:4 by Rüdiger Franke, 7 years ago

Commit 906217 removes duplicated and erroneous Modelica external C libs from the Cpp runtime.

Let's see if there are remaining issues with MSVC ...

comment:5 by Rüdiger Franke, 7 years ago

The Windows build seems to work. Since two days it fails to deliver the result and send a notification about the failure though:

+ mv OpenModelica.exe /c/dev/OpenModelica_releases/v1.13.0-dev-476-g90621756a8/OpenModelica-v1.13.0-dev-476-g90621756a8-32bit.exe
...
+ ssh adrpo@build.openmodelica.org
/c/dev/OpenModelica32bit/OpenModelicaSetup/BuildWindowsRelease.sh: line 205: ssh: command not found
...
Sending e-mails to: adrian.pop@liu.se adeel.asghar@liu.se
ERROR: Could not connect to SMTP host: localhost, port: 25

Is there anyone out there who cares about such problems?
See also ticket:4773 and ticket:4774.

comment:6 by Adrian Pop, 7 years ago

@rfranke: I had to update git for windows to a newer version as github started to reject the one installed on that system. Then ssh was installed in a different place. Then our IT department wanted us to close ports on the test machine so we closed also 25 but it seems Hudson needs it.
All these should be solved now. I will restart the jobs.

comment:7 by Martin Sjölund, 7 years ago

Was this resolved?

comment:8 by Adrian Pop, 7 years ago

Resolution: fixed
Status: newclosed

As far as I know, yes.

Note: See TracTickets for help on using tickets.