Coder Social home page Coder Social logo

Comments (17)

jowr avatar jowr commented on July 24, 2024 1

Hi - please note that OpenModelica is not officially supported as this still is work in progress. Please also check #27 for more information.

Furthermore, we compile a static library and not a shared one. You are not supposed to find a dll.

from externalmedia.

jowr avatar jowr commented on July 24, 2024 1

Please also see https://github.com/modelica-3rdparty/ExternalMedia/milestones for the development roadmap...

from externalmedia.

bilderbuchi avatar bilderbuchi commented on July 24, 2024 1

Good plan! Let me know if I can help with testing.

from externalmedia.

bilderbuchi avatar bilderbuchi commented on July 24, 2024

Furthermore, we compile a static library and not a shared one. You are not supposed to find a dll.

Thanks, yeah. OM also now has an option for "static linking", I played around with that and different compiler choices, but did not get anywhere.

#27 currently has a merge conflict. Can you maybe fix that (nowadays should even work in the web interface), so that intrepid user can pull the merge commit and play around to get that to compile?

from externalmedia.

bilderbuchi avatar bilderbuchi commented on July 24, 2024

This is not surprising, more of an update/re-check: I just tried this with the new 3.3.1 release and OM 1.18.1, and there is essentially the same error message.

Also, I think this issue (and all others labeled OpenModelica) should also be milestoned to 4.0.0, judging from that milestone's description.

[1] 10:27:46 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:
  <snip>/ExternalMedia 3.3.1/Resources/Library/win64/ExternalMediaLib.dll
  <snip>/ExternalMedia 3.3.1/Resources/Library/ExternalMediaLib.dll

[2] 10:27:46 Translation Error
[ExternalMedia.Media.BaseClasses.ExternalTwoPhaseMedium: 204:15-208:29]: External function ‘TwoPhaseMedium_getCriticalMolarVolume_C_impl‘ could not be found in any of the given shared libraries:
  <snip>/ExternalMedia 3.3.1/Resources/Library/win64/ExternalMediaLib.dll
  <snip>/ExternalMedia 3.3.1/Resources/Library/ExternalMediaLib.dll

[3] 10:27:46 Translation Error
[ExternalMedia.Media.BaseClasses.ExternalTwoPhaseMedium: 186:15-190:19]: External function ‘TwoPhaseMedium_getMolarMass_C_impl‘ could not be found in any of the given shared libraries:
  <snip>/ExternalMedia 3.3.1/Resources/Library/win64/ExternalMediaLib.dll
  <snip>/ExternalMedia 3.3.1/Resources/Library/ExternalMediaLib.dll

[4] 10:27:46 Translation Error
[ExternalMedia.Media.BaseClasses.ExternalTwoPhaseMedium: 198:15-202:26]: External function ‘TwoPhaseMedium_getCriticalPressure_C_impl‘ could not be found in any of the given shared libraries:
  <snip>/ExternalMedia 3.3.1/Resources/Library/win64/ExternalMediaLib.dll
  <snip>/ExternalMedia 3.3.1/Resources/Library/ExternalMediaLib.dll

There is also another one, probably unrelated. It has a funky error message, in that that path does not exist on my machine, OM is installed elsewhere. This is just for completeness, it's probably an OM problem

[5] 10:27:46 Translation Error
[C:/OM118/OM64bit/OMCompiler/Compiler/SimCode/SimCodeUtil.mo: 6217:7-6217:46]: Internal error No support of solving not real variables with a non-linear solver. Equation:
$cse6 = ExternalMedia.Test.WaterComparison.testRunnerTwoPhaseWater1.testBasePropertiesImplicit.medium1.Medium.setState_ph(testRunnerTwoPhaseWater1.p_in, testRunnerTwoPhaseWater1.testBasePropertiesImplicit.medium1.baseProperties.h, 0) solve for {testRunnerTwoPhaseWater1.testBasePropertiesImplicit.medium1.baseProperties.h,$cse6.phase,$cse6.cv,$cse6.h,$cse6.d,$cse6.ddhp,$cse6.beta,$cse6.kappa,$cse6.ddph,$cse6.s,$cse6.cp,$cse6.p,$cse6.a,$cse6.lambda,$cse6.eta}

[6] 10:27:46 Translation Error
[C:/OM118/OM64bit/OMCompiler/Compiler/SimCode/SimCodeUtil.mo: 1487:5-1487:77]: Internal error createEquationsForSystems failed

[7] 10:27:46 Translation Error
[C:/OM118/OM64bit/OMCompiler/Compiler/SimCode/SimCodeUtil.mo: 754:5-754:146]: Internal error function createSimCode failed [Transformation from optimised DAE to simulation code structure failed]

from externalmedia.

jowr avatar jowr commented on July 24, 2024

Your code is clearly looking for a shared library and v3.x only has static libraries. Maybe you can try with a snapshot of the v4-dev branch? Here are the binaries from the latest commit: https://ipudk-my.sharepoint.com/:u:/g/personal/jowr_ipu_dk/Ed_pZU-BXSdHvOxSDe1CNqQB3o4CAa_GtjlsawY_RyeBgA?e=OLN6YT

from externalmedia.

bilderbuchi avatar bilderbuchi commented on July 24, 2024

I just did, the paths where OM searches [1] do not align with what's in the binaries.
For example, OM looks for mingw64/ExternalMediaLib.dll, mingw64/libExternalMediaLib.a, mingw64/libExternalMediaLib.lib. What actually exists in the package is mingw64/libExternalMediaLib.dll and mingw64/libExternalMediaLib.dll.a, which is a weird mix between the two.
Also, OM looks for win64/ExternalMediaLib.dll, while we have those files one level deeper, within vs2015/17/19/22 folders.

@casella do you know if this an OM problem or an ExternalMedia problem (e.g. CMake wrangling dll names in a weird way)?

[1]:

Could not find library ExternalMediaLib in either of:
  C:/OpenModelica1.18.1-64bit/lib//omc/ExternalMediaLib.dll
  /usr/lib//ExternalMediaLib.dll
  /lib//ExternalMediaLib.dll
  /usr/lib//ExternalMediaLib.dll
  /lib//ExternalMediaLib.dll
  C:/OpenModelica1.18.1-64bit/lib//omc/ExternalMediaLib.dll
  C:/OpenModelica1.18.1-64bit/lib//ExternalMediaLib.dll
  <snip>/AppData/Roaming/.openmodelica/binaries/ExternalMedia/ExternalMediaLib.dll
  <snip>/ExternalMedia 4.0.0/Resources/Library/mingw64/ExternalMediaLib.dll
  <snip>/ExternalMedia 4.0.0/Resources/Library/win64/ExternalMediaLib.dll
  <snip>/ExternalMedia 4.0.0/Resources/Library/ExternalMediaLib.dll
  C:/OpenModelica1.18.1-64bit/lib//omc/libExternalMediaLib.a
  /usr/lib//libExternalMediaLib.a
  /lib//libExternalMediaLib.a
  /usr/lib//libExternalMediaLib.a
  /lib//libExternalMediaLib.a
  C:/OpenModelica1.18.1-64bit/lib//omc/libExternalMediaLib.a
  C:/OpenModelica1.18.1-64bit/lib//libExternalMediaLib.a
  <snip>/AppData/Roaming/.openmodelica/binaries/ExternalMedia/libExternalMediaLib.a
  <snip>/ExternalMedia 4.0.0/Resources/Library/mingw64/libExternalMediaLib.a
  <snip>/ExternalMedia 4.0.0/Resources/Library/win64/libExternalMediaLib.a
  <snip>/ExternalMedia 4.0.0/Resources/Library/libExternalMediaLib.a
  C:/OpenModelica1.18.1-64bit/lib//omc/libExternalMediaLib.lib
  /usr/lib//libExternalMediaLib.lib
  /lib//libExternalMediaLib.lib
  /usr/lib//libExternalMediaLib.lib
  /lib//libExternalMediaLib.lib
  C:/OpenModelica1.18.1-64bit/lib//omc/libExternalMediaLib.lib
  C:/OpenModelica1.18.1-64bit/lib//libExternalMediaLib.lib
  <snip>/AppData/Roaming/.openmodelica/binaries/ExternalMedia/libExternalMediaLib.lib
  <snip>/ExternalMedia 4.0.0/Resources/Library/mingw64/libExternalMediaLib.lib
  <snip>/ExternalMedia 4.0.0/Resources/Library/win64/libExternalMediaLib.lib
  <snip>/ExternalMedia 4.0.0/Resources/Library/libExternalMediaLib.lib

from externalmedia.

bilderbuchi avatar bilderbuchi commented on July 24, 2024

If I simply strip the libprefix from the dll in the mingw64 folder, that particular message goes away, but I still have the above errors "External function blabla could not be found". Funny though that a quick
nm .\ExternalMediaLib.dll | Select-String TwoPhaseMedium_getCriticalTemperature_C_impl prints
0000000067c51df0 T TwoPhaseMedium_getCriticalTemperature_C_impl
It seems to find something, but I don't know how to interpret that further.

from externalmedia.

bilderbuchi avatar bilderbuchi commented on July 24, 2024

Your code is clearly...

I was confused by this, I don't know what you mean with "your code", all this is the result of running ExternalMedia.Test.WaterComparison.

from externalmedia.

jowr avatar jowr commented on July 24, 2024

from externalmedia.

casella avatar casella commented on July 24, 2024

@bilderbuchi a bit of patience, I'm flooded by stuff to do, I'll take care of this ASAP.

In the past ExternalMedia was also compiled as DLLs, but the handling of ModelicaError was not good, so those DLLs are not very useful. We're planning to fix that in the next releases, but it will take a bit of time to do that properly.

from externalmedia.

bilderbuchi avatar bilderbuchi commented on July 24, 2024

Sure, no worries!

from externalmedia.

casella avatar casella commented on July 24, 2024

@bilderbuchi, I'm not sure, but maybe your problem is related to OpenModelica/OpenModelica#8184 or something similar, that may have been fixed recently.

I would recommend you to try ExternalMedia with the latest nightly build. It will be released as 1.19.0 in a few weeks from now.

from externalmedia.

bilderbuchi avatar bilderbuchi commented on July 24, 2024

I just tried with OpenModelica-v1.19.0-dev-613-gd6e04c0efc-64bit and the ExternalMedia 4 library snapshot Jorrit graciously provided above.
The situation seems unchanged - with the library as-is, I still get Translation Errors, plus the TranslationWarnings reported above -- I think this is because ExternalMedia has a "lib" prefix and OM does not expect that for dlls.

If I strip the lib prefix from the dll in the mingw64 folder, the Translation Warnings go away, but the Translation Errors remain:

[1] 12:28:49 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:/OpenModelica1.19.0-dev-64bit/bin/ExternalMediaLib.dll
  <snip>/Modelica/ExternalMedia 4.0.0/Resources/Library/win64/ExternalMediaLib.dll
  <snip>/Modelica/ExternalMedia 4.0.0/Resources/Library/ExternalMediaLib.dll
  C:/OpenModelica1.19.0-dev-64bit/bin/libExternalMediaLib.dll
  <snip>/Modelica/ExternalMedia 4.0.0/Resources/Library/win64/libExternalMediaLib.dll
  <snip>/Modelica/ExternalMedia 4.0.0/Resources/Library/libExternalMediaLib.dll
  C:/OpenModelica1.19.0-dev-64bit/bin/ffi/ExternalMediaLib.dll
  C:/OpenModelica1.19.0-dev-64bit/bin/ffi/libExternalMediaLib.dll

Note how this apparently searches fewer paths than whatever triggers the Translation Warnings (e.g. does not search in Library/mingw64)!


Today I realised something: based on that error message, I moved the prefix-stripped dll from mingw64 into Library/ExternalMediaLib.dll. Now I'm getting farther -

  • there is output about BICUBIC and TTSE (too long to paste), and
  • I get a warning about a pure function ExternalMedia.Common.CheckCoolPropOptions calling impure print (I think based on the spec that CheckCoolPropOptions needs to be marked impure) and
  • an Internal error No support of solving not real variables with a non-linear solver that stops the translation - I think that one is probably on OM. I only found https://trac.openmodelica.org/OpenModelica/ticket/5699 but that was closed by @casella years ago.

So, foremost, this seems to be a question about dll search paths and names, but I don't know if OM or ExternalMedia behaviour should be changed here. Are the dll locations standardized? It seems to work when using Dymola, correct, @jowr ?

from externalmedia.

casella avatar casella commented on July 24, 2024

@bilderbuchi, I have started testing ExternalMedia with omc, see ticket #56. I'll first try to sort out issues that pop up with TestMedium already, then I'll move on to CoolProp media. I'll also take care of a proper dll implementation ASAP.

from externalmedia.

casella avatar casella commented on July 24, 2024

@bilderbuchi see #56 for an up-to-date assessment of ExternalMedia and OpenModelica.

from externalmedia.

bilderbuchi avatar bilderbuchi commented on July 24, 2024

Thanks!

from externalmedia.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.