-
Notifications
You must be signed in to change notification settings - Fork 36
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
OpenModelica cannot handle package constants coming from external functions in static libraries #54
Comments
Please use the latest code. I think I fixed this already in 3.4.0 and in the 4.0.0 branch…
On 21 Feb 2022, at 22.57, Francesco Casella ***@***.***> wrote:
Run ExternalMedia.Test.TestMedium.TestConstants with the latest nightly build of OpenModelica. The following error is generated:
[1] 20:08:32 Translation Error
[ExternalMedia.Media.BaseClasses.ExternalTwoPhaseMedium: 192:15-196:29]: External function ‘TwoPhaseMedium_getCriticalTemperature_C_impl‘ could not be found in any of the given shared libraries:
C:/Program Files/OpenModelica1.19.0-dev-64bit/lib//omc/ExternalMediaLib.dll
D:/Lavoro/Modelica/ExternalMedia 3.3.1/Resources/Library/win64/ExternalMediaLib.dll
D:/Lavoro/Modelica/ExternalMedia 3.3.1/Resources/Library/ExternalMediaLib.dll
The reason for that is that the OpenModelica front-end tries to constant-evaluate the package constant Medium.externalFluidConstants.criticalTemperature at compile time during flattening. This constant is bound to the external function Medium.getCriticalTemperature(), which calls an external function to get the value from the external solver.
Recent improvements to version 1.19.0-dev of OpenModelica make it possible for the front-end to call such external functions, provided that they are available in dynamically linked/shared libraries. This will be addressed in #50<#50>.
—
Reply to this email directly, view it on GitHub<#54>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AAF34OKNJ36LFCVQ7GTEXSDU4KYLFANCNFSM5O7VUDEQ>.
Triage notifications on the go with GitHub Mobile for iOS<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
Wait - do you want to make the static library work with OM? Why did you change your mind? I thought we were pushing to get the shared lib running.
On 21 Feb 2022, at 23.33, Jorrit Wronski ***@***.***> wrote:
Please use the latest code. I think I fixed this already in 3.4.0 and in the 4.0.0 branch…
On 21 Feb 2022, at 22.57, Francesco Casella ***@***.***> wrote:
Run ExternalMedia.Test.TestMedium.TestConstants with the latest nightly build of OpenModelica. The following error is generated:
[1] 20:08:32 Translation Error
[ExternalMedia.Media.BaseClasses.ExternalTwoPhaseMedium: 192:15-196:29]: External function ‘TwoPhaseMedium_getCriticalTemperature_C_impl‘ could not be found in any of the given shared libraries:
C:/Program Files/OpenModelica1.19.0-dev-64bit/lib//omc/ExternalMediaLib.dll
D:/Lavoro/Modelica/ExternalMedia 3.3.1/Resources/Library/win64/ExternalMediaLib.dll
D:/Lavoro/Modelica/ExternalMedia 3.3.1/Resources/Library/ExternalMediaLib.dll
The reason for that is that the OpenModelica front-end tries to constant-evaluate the package constant Medium.externalFluidConstants.criticalTemperature at compile time during flattening. This constant is bound to the external function Medium.getCriticalTemperature(), which calls an external function to get the value from the external solver.
Recent improvements to version 1.19.0-dev of OpenModelica make it possible for the front-end to call such external functions, provided that they are available in dynamically linked/shared libraries. This will be addressed in #50<#50>.
—
Reply to this email directly, view it on GitHub<#54>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AAF34OKNJ36LFCVQ7GTEXSDU4KYLFANCNFSM5O7VUDEQ>.
Triage notifications on the go with GitHub Mobile for iOS<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
Will do. |
No, I don't care about that, since shared libraries are required to get the package constants working out of the box. I would also switch to shared libraries only for Dymola as well, so we can reduce the amount of binaries to generate, basically just one for each operating system. Why are you asking that?
|
I suspect because this issue's title talks about static libraries. In any case, using the snapshot from #42 (comment) and OM v1.19.0-dev-613-gd6e04c0efc, I can compile and run However, compiling the WaterComparison model (#42), I get the exact same error (with a couple more paths mentioned). At the paths mentioned those dlls don't exist. |
Aha, now I get it. The issue is that OMC cannot handle static libraries. The cure can be either to have OMC handle them, or to avoid them entirely, and of course we want to take the second approach, as planned in #50. |
Yes, @jowr mentioned that the dll's are actually built in the 4.0.0 branch. They won't handle errors correctly, and that's my part to implement.
OK, as far as I can understand, omc is looking inside Would you mind opening a ticket that addresses this specific issue (and only this one!) with clear instructions to reproduce the problem? Please do that directly on OMC's issue tracker https://github.com/OpenModelica/OpenModelica/issues, and then I'll follow it up from there. We need to one ticket for each issue, othersiwe the whole thing becomes a bloody mess... Thanks! |
Sure thing, see OpenModelica/OpenModelica#8595 |
Run
ExternalMedia.Test.TestMedium.TestConstants
with the latest nightly build of OpenModelica. The following error is generated:The reason for that is that the OpenModelica front-end tries to constant-evaluate the package constant Medium.externalFluidConstants.criticalTemperature at compile time during flattening. This constant is bound to the external function Medium.getCriticalTemperature(), which calls an external function to get the value from the external solver.
Recent improvements to version 1.19.0-dev of OpenModelica make it possible for the front-end to call such external functions, provided that they are available in dynamically linked/shared libraries. This will be addressed in #50.
The text was updated successfully, but these errors were encountered: