modelica-3rdparty / ExternalMedia

The ExternalMedia library provides a framework for interfacing external codes computing fluid properties to Modelica.Media-compatible component models.
53 stars 36 forks source link

ExternalMedia with OpenModelica: dlls not found #70

Closed maho7000 closed 1 year ago

maho7000 commented 1 year ago

Hello, I started using OpenModelica and wanted to set-up a cycle simulation with CO2 as working medium. Therefore, I downloaded ExternalMedia v3.3.1 and loaded the package.mo. However, I get the following error when I test e.g. CO2Coolprop:

[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: C:/sw/OpenModelica1.19.2-64bit/bin/ExternalMediaLib.dll D:/Users/ikemhofe/Documents/Modelica/ExternalMedia 3.3.1/Resources/Library/mingw64/ExternalMediaLib.dll D:/Users/ikemhofe/Documents/Modelica/ExternalMedia 3.3.1/Resources/Library/win64/ExternalMediaLib.dll D:/Users/ikemhofe/Documents/Modelica/ExternalMedia 3.3.1/Resources/Library/ExternalMediaLib.dll C:/sw/OpenModelica1.19.2-64bit/bin/libExternalMediaLib.dll D:/Users/ikemhofe/Documents/Modelica/ExternalMedia 3.3.1/Resources/Library/mingw64/libExternalMediaLib.dll D:/Users/ikemhofe/Documents/Modelica/ExternalMedia 3.3.1/Resources/Library/win64/libExternalMediaLib.dll D:/Users/ikemhofe/Documents/Modelica/ExternalMedia 3.3.1/Resources/Library/libExternalMediaLib.dll C:/sw/OpenModelica1.19.2-64bit/bin/ffi/ExternalMediaLib.dll C:/sw/OpenModelica1.19.2-64bit/bin/ffi/libExternalMediaLib.dll

I checked the folders and found only .lib files. Therefore, my question is: where are the dll-files? Compiling ExternalMedia myself as described in the manual did not help either, since this gave me the same .lib file.

When I try to simulate ExternalMedia.Test.CoolProp.CO2.TestStatesSupercritical OpenModelica just crashes.

Can you please help me?

Best regards, Markus

denis-jidovtseff-jc commented 1 year ago

Hello I have a curious bug also with openmodelica. External function ‘TwoPhaseMedium_setState_pT_C_impl‘ could not be found in any of the given shared libraries: C:/ProgramData/openmodelica/bin/ExternalMediaLib.dll C:/Users/denis.jidovtseff@johncockerill.com/Downloads/ExternalMedia_v3.3.1-2/ExternalMedia 3.3.1/Resources/Library/mingw64/ExternalMediaLib.dll C:/Users/denis.jidovtseff@johncockerill.com/Downloads/ExternalMedia_v3.3.1-2/ExternalMedia 3.3.1/Resources/Library/win64/ExternalMediaLib.dll C:/Users/denis.jidovtseff@johncockerill.com/Downloads/ExternalMedia_v3.3.1-2/ExternalMedia 3.3.1/Resources/Library/ExternalMediaLib.dll C:/ProgramData/openmodelica/bin/libExternalMediaLib.dll C:/Users/denis.jidovtseff@johncockerill.com/Downloads/ExternalMedia_v3.3.1-2/ExternalMedia 3.3.1/Resources/Library/mingw64/libExternalMediaLib.dll C:/Users/denis.jidovtseff@johncockerill.com/Downloads/ExternalMedia_v3.3.1-2/ExternalMedia 3.3.1/Resources/Library/win64/libExternalMediaLib.dll C:/Users/denis.jidovtseff@johncockerill.com/Downloads/ExternalMedia_v3.3.1-2/ExternalMedia 3.3.1/Resources/Library/libExternalMediaLib.dll C:/ProgramData/openmodelica/bin/ffi/ExternalMediaLib.dll C:/ProgramData/openmodelica/bin/ffi/libExternalMediaLib.dll with the externalMedia V3.3.1 converted to modelica version 4.0.0

It seems to happen when the option "evaluate all parameters" is checked

casella commented 1 year ago

@maho7000 please try with the latest 3.3.2 version of the library. It's going to be released soon, in the meantime you can use the binaries you can get here.