-
Notifications
You must be signed in to change notification settings - Fork 168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrong link order of Libraries used by Modelica.Blocks.Tables #2470
Comments
Hm, Mat_Open and Mat_VarReadInfo are declared in module ModelicaMatIO.c and utilized by module ModelicaStandardTables.c. Thus, the other way round. Can you check the OMC linking again with current master, especially after my 11.5 months old commit 7ac5e51 for #2192? |
I suppose because we mostly test OpenModelica on Linux which uses dynamic linking, and there all so-files are already linked against their respective symbols. |
If the functions are defined in ModelicaMatIO and utilized by ModelicaStandardTables, then the annotation should indeed be changed to:
|
If they are defined in ModelicaMatIO but used by Tables, Tables should be before on the list, just like zlib is last because the functions are defined in zlib and used by ModelicaMatIO. |
Yes, you are right, sorry. This would mean that OpenModelica messes up C source names and libarary names, because libModelicaMatIO does not have the functions (link order
The linker error disappears with reversed link order |
I would suggest trying to compile with the actual libraries generated by the ModelicaExternalC project instead of the custom CMakeLists.txt used by the Cppruntime. ModelicaIO doesn't seem to have its own library there which is sure to cause some problems. The ModelicaMatIO.a only contains ModelicaIO.c as well... Just crazy. |
OK, closing as invalid then. |
Use libs from C runtime for Cpp as well, see also modelica/ModelicaStandardLibrary#2470 Belonging to [master]: - #2229
Sorry for having spammed this tracker with OpenModelica issues. I couldn't imagine that sources and libraries would flip names. The following commit should clean it up: OpenModelica/OMCompiler@9062175 |
Modelica.Blocks.Tables.CombiTable{1D,1Ds,2D} contain external function calls and
This is the wrong link order, because ModelicaMatIO uses functions of ModelicaStandardTables (Mat_Open, Mat_VarReadInfo, ...).
The annotation should be:
The problem can be reproduced with OpenModelica's FMI export under Windows using a model like
OpenModelica contains MinGW. FMI export shall produce a dll that contains all external dependencies. Using the bundled g++ version 5.3.0, the linker call is as follows,
This produces the error:
The problem is worked around in the current nightly build of OpenModelica by linking ModelicaStandardTables a second time after the model defined external libs, see:
OpenModelica/OMCompiler@cacc8bf
It should be solved by changing the order of libraries in Modelica.Blocks.Tables.*.
The text was updated successfully, but these errors were encountered: