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
Binaries in the Modelica Standard Library #1155
Comments
Modified by sjoelund.se on 3 Jun 2013 09:33 UTC |
Modified by fcasella on 4 Jun 2013 08:03 UTC |
Modified by fcasella on 4 Jun 2013 08:04 UTC |
Comment by fcasella on 4 Jun 2013 08:09 UTC As far as I understand, my proposal doesn't need any change or clarification to the language specification, and only uses annotations which were standardized long ago in section 12.9.4. What needs to be decided is an agreed upon policy for external C sources in the Modelica Standard Library. |
Comment by sjoelund.se on 4 Jun 2013 08:57 UTC |
Comment by otter on 5 Jun 2013 13:49 UTC Solution 1:
This helps tool vendors (and interested library developers) to build the binaries. Solution 2: ModelicaExternalC In the Table blocks only use library annotation ModelicaStandardTables. Solution 3: |
Comment by mtiller on 5 Jun 2013 14:05 UTC |
Comment by sjoelund.se on 5 Jun 2013 14:08 UTC |
Comment by thiele on 5 Jun 2013 15:08 UTC I found that for me CMake (http://www.cmake.org/) works pretty well to maintain the sources for all the platforms. I therefore think that it might be worth to consider its use also for the MSL. The external code setup used in Modelica_DeviceDrivers can be found at https://github.com/modelica/Modelica_DeviceDrivers/tree/master/Resources. In order to make it convenient to users I keep binaries for all the platforms specified in |
Comment by sjoelund.se on 7 Jun 2013 05:41 UTC Since this is supposed to be possible to run as the user (not tool developer), it is good if it can configure everything without needing (a specific version of) cmake installed. |
Comment by thiele on 7 Jun 2013 08:06 UTC Regarding the need for users to install cmake to do the build, I also think that autotools are not installed by default in some (many?) linux distributions (at least I think it is not the case for Ubuntu, but I might be wrong), not to speak from other third-party libraries (or linux xxx-dev packages) that may be needed to do the build. Nice thing of cmake for my taste is the possibility to choose between various project build generators, but only need to maintain one set of build files. Also the use of cmake for supporting cross-compiling tool chains is not bad (nice if non-standard platforms, e.g., real-time simulation platforms, should be targeted). I mean, it's a matter of taste how external C-code should be maintained and at the end the people who take responsibility to do that for the MSL need to find a mode that they think works best for them (and at the moment I'm of course not part of that group, but I think you are). |
Comment by sjoelund.se on 7 Jun 2013 08:27 UTC autotools on the other hand do not need to be installed on the client machine. You run the generation script and get a configure script + a Makefile. It is even portable to targets that autotools themselves do not run on. As for cross-compilation using autotools... Let's say I want to compile for 32-bit Windows MinGW using my 64-bit Ubuntu as the host:
|
Comment by sjoelund.se on 7 Jun 2013 08:50 UTC
I will clarify this a little. autotools can generate everything that is needed for compilation, so you can ship this. This does, however, grow the project size from ~3kB to ~2MB. As such, one would usually keep the smaller project in subversion and only ship the generated, more portable, project in the release zip. |
Comment by beutlich on 7 Jun 2013 12:43 UTC
It is finally done. |
Comment by thiele on 7 Jun 2013 17:47 UTC |
Comment by sjoelund.se on 7 Jun 2013 17:52 UTC |
Comment by msielemann on 10 Jun 2013 09:19 UTC In order to avoid establishing the foundations now based on the wrong solution, I recommend the following reading: http://www.ornl.gov/~8vt/TrilinosCMakeEvaluation.pdf Possibly, all the good reasons to use CMake for Trilinos do not apply to our problems. But for my usage of Trilinos I would hate to step back to Autotools.... |
Comment by dietmarw on 10 Jun 2013 09:26 UTC |
Comment by otter on 18 Jul 2013 12:20 UTC
|
Comment by fcasella on 18 Jul 2013 13:16 UTC
In fact, I understand the idea is that tool vendors provide these scripts to help MSL developers and advanced users to build the binaries on their own from the latest (or possibly modified) version of the source code. |
Reported by fcasella on 3 Jun 2013 09:13 UTC
The Modelica Standard Library depends on external C and FORTRAN code for its operation.
Some functionality has a well-defined Modelica interface, but its implementation in terms of source code needs to be tool-specific. It is agreed that this functionality is confined to the
ModelicaServices
library, that defines the interface towards the MSL and other libraries. Each tool vendor is then responsible for providing an implementation which works with its tool.Other functionality is provided by external C code contained in
Modelica/C-sources/
. In this case, the source code is not tool-specific, bu the very same C source code should be compiled in different tools and also on different OS platforms.The current situation is that released versions of the MSL only contain the C sources and tool vendors are responsible for compiling and linking these sources with each new tool release. During development of the MSL, the development version of the library on the SVN trunk contains the Dymola-Windows compiled
version of new libraries (ModelicaStandardTables at the moment), which are then meant to be removed from the release version of MSL, which will instead refer to the libraries built-in by the tool vendors, and only contain the source code.
This situation is not optimal for several reasons:
specific revision of the MSL and get it to work out of the box
on their Modelica tool, because it lacks the binaries. This is
particularly weird for a library that claims to be "standard".
with updated binaries (in-between official releases),
whenever the C-sources are changed on the trunk. This can
happen many times during development and testing.
modified in order to strip it from the binaries and change some
include files, and this could potentially cause problems.
MSL trunk contains binaries only for one specific tool and
one specific OS, which is unfair towards users of other tools
and other OSs.
We need to find a long-term sustainable solution that solves this problem also for future similar cases, while allowing to continue the development and testing of MSL 3.2.1 without causing inconveniences.
This is my proposal. It is formulated for the addition of the new tables implementation, but it remains valid, mutatis mutandis, for any future addition to the MSL that requires adding external C code.
ModelicaStandardTables, making sure that its exported functions
have different names than the ones of the old tables
implementation, so the very same tool can support MSL < 3.2.1
and MSL >= 3.2.1 at the same time without ambiguities and
symbol conflicts at link time.
Modelica/Resources/Library
(not underToolXY/bin/lib
!), which will be referenced byLibraryDirectory annotations in the Modelica functions.
each OS they support, that can be executed by a single command
typed at the OS prompt without any special software installed
except the Modelica tool itself (e.g., .bat files for Windows,
makefiles for Linux). These scripts will be stored under
Modelica/Resources/BuildLibraries with appropriate names,
e.g. BuildLibrary_Toolname_xxbit), together with a howto.txt
file with instructions.
how required libraries such as zlib may or may not be already
present in the tool installation and on which C compiler the
tool uses.
builds), each tool vendor runs the appropriate makefile, then
removes all the unneeded stuff from Modelica/Resources to avoid
wasting bandwidth and disk space.
modelica.org or checkout any revision from SVN, run the
appropriate script with and get an up-to-date, fully functional
version of MSL work out of the box. The script only needs to be
run at checkout and whenever the sources are updated.
To my understanding, this proposal solves all the problems listed above. Furthermore, it allows to test models with the very latest version of the C sources, without waiting for tool vendors to provide the updated binaries, and without tweaking the tool installation, which might not be allowed by the OS settings.
Yes, there will be tool-specific code on the MSL trunk (the scripts to build the binaries from sources), but this is not meant to provide unfair advantage for a tool over another one, but rather to ease the development effort of the MA community.
My proposal is that this development model is also adopted for any future addition to the MSL besides the new tables, as well as for the new Table maintenance. We cannot get rid of ModelicaInternalC for backwards compatibility, but we can at least stop adding new code to it.
Tool developers are recommended not to patch the C sources locally on their tools, but rather to contribute to the development of more general and robust versions of the code on the SVN trunk, in the same spirit the rest of the MSL is developed. It might also be useful for other libraries that depend on external C code, such as ExternalMedia.
My recommendation is that this process is tried out immediately on MSL 3.2.1, since it fits the main requirement of this release of being fully standard and tool-neutral.
Migrated-From: https://trac.modelica.org/Modelica/ticket/1155
The text was updated successfully, but these errors were encountered: