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
Latest ModelicaExternalC breaks MSL 3.2.1 #1928
Comments
Comment by otter on 28 Feb 2016 09:05 UTC
Lets first summarize the current difference:
The reason for the restructuring was the introduction of the new functions to write matrices in various Matlab binary formats and to read matrices in various Matlab binary formats. The C-code of this new functionality was included in ModelicaIO.c (with the plan to introduce more read/write functions in future releases, e.g., to read/write Excel binary files). Since ModelicaIO.c needs ModelicaMatIO.c and zlib/*.c, and these C-functions are unrelated to ModelicaStandardTables.c, they have been stored in separate libraries. I was not aware of the issues that this could cause for OpenModelica. In Dymola, and as I understand this is the same in SimulationX, these object libraries are shipped separately for every release. To me, this is "cleaner" because a new MSL release (or also a maintenance release) by sure does not have any influence on a previous MSL release (like 3.2.1). If the same object libraries are always shipped with a tool, then suddenly a new MSL release (3.2.2) also influences a previous release (3.2.1). Anyway, if a tool vendor prefers this approach for practical reasons, then MSL should support this view, if reasonably possible. In this case there seems to be two options (and both are fine with me): Option 1:
This means that ModelicaStandardTables must be used in the Library annotation, when ModelicaIO is used in this library annotation. Option 2:
We could use either option 1 or option 2 and in a later MSL release restructure (and then clarify the consequences beforehand with the tool vendors), if the restructring has advantages. |
Comment by sjoelund.se on 28 Feb 2016 09:16 UTC
This is wrong. At least my copy of Dymola comes with a single version of ModelicaExternalC which is used for both MSL 2.x and 3.x.
Actually, we can't because MSL 3.2.1 already used option 2. It also does not make sense to refactor the libraries at this time since the IO parts are only used in Tables functions (you need both Library annotations at the same time always and never only use IO). It could have made sense if this was done for MSL 3.2.1. |
Comment by otter on 28 Feb 2016 09:34 UTC
You are right. I just concentrated on the issue with the tables and overlooked ModelicaExternalC. Shipping ModelicaExternalC with Dymola is also not a good solution (besides the issue above), because any change to this library requires that a user gets a new Dymola version and it is therefore very awkward to include new features in this library. Therefore, for the MSL version following 3.2.2, we should try to change this (so include the ModelicaExternalC object libraries in the MSL distribution).
Hm. Don't misunderstand me. Option 2 is fine for me and we can just use it. However, option 1 should also be o.k., because the ModelicaStandardTables.lib/.a/.dll would be the same as in MSL 3.2.1 (with minor improvements), so practically no change, but there would be a new library, ModelicaIO.lib/.a/.dll that is only used in new models not present in MSL 3.2.1. |
Comment by beutlich on 28 Feb 2016 12:14 UTC
This would only work out if the tool-specific implementation of the ModelicaUtilities functions (ModelicaMessage etc.) are separated from the tool-independent modules of ModelicaExternalC. For the dilemma with the libraries I see two other workarounds:
Option 4:
In both cases ModelicaMatIO and zlib are provided twice. |
Comment by otter on 28 Feb 2016 12:18 UTC |
Comment by beutlich on 28 Feb 2016 12:44 UTC |
Comment by sjoelund.se on 28 Feb 2016 13:43 UTC
The disadvantage of 3 and 4 is that if you build a static version of the library, you can no longer link against two of the libraries at the same time (because of duplicate symbols). |
Comment by otter on 28 Feb 2016 14:15 UTC
The only (tiny) issue is the naming of the library in option 2 (at least, I do not see other drawbacks). Otherwise, one can argue that all IO of matrices and interpolation in matrices read from file are in one library. Just because the name "ModelicaStandardTables" does not fit perfectly for all the functions in such a library seems to be not a big drawback. Option 3 and 4 give the potential of just other (very serious) drawbacks, if by design the same functions are present twice in different object libraries. |
Comment by sjoelund.se on 29 Feb 2016 06:47 UTC |
Comment by beutlich on 29 Feb 2016 07:40 UTC |
Comment by otter on 29 Feb 2016 08:56 UTC
|
Comment by sjoelund.se on 29 Feb 2016 09:01 UTC |
Comment by otter on 29 Feb 2016 09:26 UTC The ModelicaStandardTables object library (.lib, .dll, .a, .so, depending on tool) has been split into the libraries ModelicaStandardTables, ModelicaMatIO, zlib and the new object library ModelicaIO has been added. |
Comment by beutlich on 29 Feb 2016 13:18 UTC |
Comment by sjoelund.se on 29 Feb 2016 13:22 UTC |
Comment by beutlich on 29 Feb 2016 13:24 UTC |
Comment by sjoelund.se on 29 Feb 2016 13:26 UTC |
Comment by beutlich on 29 Feb 2016 13:32 UTC if INCLUDEZLIB
libModelicaMatIO_la_LIBADD = libzlib.la
endif since only ModelicaMatIO depends on zlib. |
Comment by sjoelund.se on 29 Feb 2016 13:34 UTC |
Comment by beutlich on 29 Feb 2016 13:39 UTC
Sorry I do not get it? I thought we speak about a modularization issue here. Can you show us the binary objects and dependencies that OM generates! |
Comment by sjoelund.se on 29 Feb 2016 13:52 UTC |
Comment by beutlich on 29 Feb 2016 13:54 UTC ModelicaStandardTables depends on ModelicaMatIO. It does not directly depend on zlib (aka dependency chain). |
Comment by sjoelund.se on 29 Feb 2016 14:38 UTC |
Comment by beutlich on 29 Feb 2016 14:47 UTC |
Comment by sjoelund.se on 29 Feb 2016 14:51 UTC |
Comment by beutlich on 29 Feb 2016 15:28 UTC Thank for you valuable contribution. |
Modified by sjoelund.se on 29 Feb 2016 15:32 UTC |
Changelog modified by sjoelund.se on 29 Feb 2016 15:32 UTC |
…o the splitting of the object libraries git-svn-id: https://svn.modelica.org/projects/Modelica/trunk@9092 7ce873d0-865f-4ce7-a662-4bb36ea78beb
git-svn-id: https://svn.modelica.org/projects/Modelica/trunk@9093 7ce873d0-865f-4ce7-a662-4bb36ea78beb
git-svn-id: https://svn.modelica.org/projects/Modelica/trunk@9094 7ce873d0-865f-4ce7-a662-4bb36ea78beb
…elicaStandardTables (of MSL v3.2.1) in the readme git-svn-id: https://svn.modelica.org/projects/Modelica/trunk@9098 7ce873d0-865f-4ce7-a662-4bb36ea78beb
Reported by sjoelund.se on 27 Feb 2016 20:31 UTC
The new modularized ModelicaStandardTables breaks compatibility with MSL 3.2.1, which is particularly bad since MSL aims to be backwards compatible and the external C sources are backwards compatible at least back to MSL 2.x (and I think earlier). It would be very annoying if we need to start shipping multiple versions of ModelicaExternalC to support old MSL versions.
Migrated-From: https://trac.modelica.org/Modelica/ticket/1928
The text was updated successfully, but these errors were encountered: