-
Notifications
You must be signed in to change notification settings - Fork 298
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
Allow selection of static or dynamic linking of simulation executable in OMEdit #7534
Comments
@casella we can do this via:
The second one doesn't need to be set for each model. |
I think a command-line flag would be preferable. However, there is no static linking on Linux/MacOS, so it might be a bit weird that it does nothing... |
The second one has advantage in the case of #7525. Think of a user who always want to use static linking. For such user first option will be annoying to set for each model every time. |
We only do it for Windows. I can also make it in OMEdit to only show controls when is running on Windows. |
But if you want to hide the flag from Edit: Then again, we have the --target flag which does nothing on Linux either |
I don't think it is a problem if some flags don't have any effect on some OSs. Maybe we should issue a warning if an option which is not available on the local OS is selected. The command line flag has the advantage that it can be set in a vendor-specific annotation, similarly to other ones affecting compilation like "-O0". |
As the comments in #7594 point out, there are some users (e.g. at EDF) that use the generated .exe outside OMEdit, possibly on a different computer. For portability, statically linked simulation executables are of course a lot better. @felixmarsollier2 is still using 1.16.5 because of that, as with the case of ABB we should avoid at all cost having users stuck to old OMC versions because of this kind of issues. It would be really bad if he could not use 1.18.0, nor the forthcoming 1.19.0-dev nightly builds. I would recommend to implement the command-line feature in 1.18.0. This is a special feature that is only useful in a small number of cases, so having to set it in each and every model is not a big deal - one would just set it as default in Tools|Options, and get that automatically in all models. @adeas31, @adrpo, can we fit this in 1.18.0? This issue is actually a regression for people like @felix-marsollier2 |
- add a new argument to Compile.bat linkType - fix the code in omc when calling Compile.bat - fix the code in OMEdit when calling Compile.bat new dialog needed, maybe a checkbox or dropdown with dynamic|static
@felix-marsollier2, please try the new nightly build, you should now be able to get a statically linked .exe simulation file and use it anywhere. |
Hi Everyone, I tried with the version v1.18.0-dev-386-g13ce53237a, it seems that the flag do not generate error but the exe is still no longer portable. There are messages regarding missing DLL. Maybe I did something wrong during my process. |
Is it for some specific Modelica model? Which dll is missing? |
Can you please post the missing DLL error in its entirety? Maybe something was forgotten in the static linking process. |
I will check it again, maybe I missed something. |
Before that, to select static linking, I went to Tools -> Options -> Simulation then I added in the Additional Translation Flags: --linkType=static
What is strange is that I used the dassl solver where here, the error messages seem like refering to unused solvers |
Moreover when I run again the exe from the temporary folder, the same messages of missings dll appear. |
All solvers are linked to the simulation executable. You can select solver as a command-line argument. |
That is not how you use it from OMEdit. |
That has worked well. Thanks again |
@adeas31, for the record, why isn't --linkType=static enough to get rid of all DLL dependencies? |
It should be enough if |
OK, so the |
Yes, if you then call simulate or buildModel. |
Description
In 1.17.0, we introduced dynamic linking of simulation executables under Windows, to reduce the overall time spent from clicking the Simulate button to getting the simulation results. This time was substantially reduced, but some users are reporting DLL hell issue, see e.g. #7525
Although keeping dynamic linking as default makes sense for most users, we should ad an option in OMEdit to allow getting back to static linking, if one wants to have a standalone .exe file for some reason.
The text was updated successfully, but these errors were encountered: