CoolProp 6.4 dll's not working in R

63 views
Skip to first unread message

Dean Standiford

unread,
Jun 30, 2020, 9:27:27 AM6/30/20
to coolprop-users
Hello,

I've been using the R-wrapper from version 6.3.1 for sometime now and decided to try version 6.4. Unfortunately, I keep getting the error, " LoadLibrary failure:  %1 is not a valid Win32 application." when I try to load any of the new dll's. After the first one failed, I tried all of the different 64bit and 32bit dll's associated with version 6.4 with no luck. I can go back to the version 6.3.1 dll using the same code with no problem.

Has anyone else experienced this problem or have any solutions?

Thanks for any assistance.

Dean

Ian Bell

unread,
Jul 11, 2020, 8:01:12 PM7/11/20
to coolpro...@googlegroups.com
What DLL are you trying to use (specifically, a URL to where you got it would be helpful).  The R wrapper does not use the "normal" DLL, rather it uses an autogenerated DLL, which unhelpfully has the same name as the "normal" dll.

--
You received this message because you are subscribed to the Google Groups "coolprop-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to coolprop-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/coolprop-users/01d4f242-c666-4b5d-9580-48e55cb3b78eo%40googlegroups.com.

Dean Standiford

unread,
Jul 13, 2020, 1:49:07 AM7/13/20
to coolpro...@googlegroups.com

Ian Bell

unread,
Jul 16, 2020, 8:42:20 PM7/16/20
to coolpro...@googlegroups.com
Looks like the DLL has runtime dependency on other MINGW libraries that are not on your PATH. Ugh.  Have you tried to build the DLL yourself?  That might be the best solution I'm afraid, since R on windows is built with MINGW, and getting all the bits to play nicely together is a real pain. 

image.png



On Mon, Jul 13, 2020 at 1:49 AM Dean Standiford <dsta...@gmail.com> wrote:

On Sun, Jul 12, 2020 at 2:01 AM Ian Bell <ian.h...@gmail.com> wrote:
What DLL are you trying to use (specifically, a URL to where you got it would be helpful).  The R wrapper does not use the "normal" DLL, rather it uses an autogenerated DLL, which unhelpfully has the same name as the "normal" dll.

On Tue, Jun 30, 2020 at 9:27 AM Dean Standiford <dsta...@gmail.com> wrote:
Hello,

I've been using the R-wrapper from version 6.3.1 for sometime now and decided to try version 6.4. Unfortunately, I keep getting the error, " LoadLibrary failure:  %1 is not a valid Win32 application." when I try to load any of the new dll's. After the first one failed, I tried all of the different 64bit and 32bit dll's associated with version 6.4 with no luck. I can go back to the version 6.3.1 dll using the same code with no problem.

Has anyone else experienced this problem or have any solutions?

Thanks for any assistance.

Dean

--
You received this message because you are subscribed to the Google Groups "coolprop-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to coolprop-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/coolprop-users/01d4f242-c666-4b5d-9580-48e55cb3b78eo%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "coolprop-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to coolprop-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/coolprop-users/CAJQnXJeL_rOshcfV7GGm3Lsi8KaZh5RT_ustcYAqr9_WnbLSuw%40mail.gmail.com.

--
You received this message because you are subscribed to the Google Groups "coolprop-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to coolprop-user...@googlegroups.com.

pavel....@gmail.com

unread,
Jan 4, 2021, 8:14:28 AM1/4/21
to coolprop-users
I am sorry to reopening this issue, however I am having same problem. I am unable to use latest version of Coolprop in R because it can not be loaded  - LoadLibrary failure:  %1 is not a valid Win32 application.
I am unable to compile my own coolprop since the compiler and other mingw etc is extremely difficult to make work under corporate ruled computer.
Would you  please advise which are the libraries  necessary to run coolprop under win 10 64b? Assuming these are
libgcc_s_seh-1.dll and libstdc++-6.dll. However where can I get those, please? In my unzipped  TDM-GCC-64 are not presented.

and / or

Would you please somehow compile the coolprop.dll for R with these depencies statically linked into it?
It will save a lot of minds, I would say...
 
Thanks
Pavel

Ian Bell

unread,
Jan 5, 2021, 10:22:19 PM1/5/21
to coolpro...@googlegroups.com
Afraid I can't help with this one now.  Can you build the DLL on a less locked down machine and deliver to your other machine the necessary files?

pavel....@gmail.com

unread,
Jan 11, 2021, 8:14:25 AM1/11/21
to coolprop-users
I am not proficient  in c programming so setting whole environment in my home computer is quite pain for me.

I believe I resolved issues with cmake and now I am dealing with some missing SWIG something (which is not mentioned in your guide) .

Just wonder, Coolprop version 6.3.0 works under latest R fine. Why don't you keep same .dll generating process? This must be an issue for all W10 users with latest R.

Or would you please advise what other party .dll are needed? And where are they available? Since the TDM-GCC-64 suite does not contain those I may try to find them and upload to my computer instead of compiling my own dll.

Ian Bell

unread,
Jan 11, 2021, 5:18:06 PM1/11/21
to coolpro...@googlegroups.com
Because compiler toolchains (and developer machines) change, so we must constantly adapt...  Anything that uses MINGW on windows is very problematic to support. Octave on windows used to come with its own compilers, but alas, no more.

CoolProp is a 100% volunteer project, so if you want something, you will have to either do some work on your side to figure it out, or kindly ask the list, or put up some support here: https://www.bountysource.com/teams/coolprop

pavel....@gmail.com

unread,
Jan 25, 2021, 10:30:54 AM1/25/21
to coolprop-users
Hello Ian,
I am really sorry that me English is not polite enough. I am kindly asking these question in most my posts:

...Would you  please advise which are the libraries  necessary to run coolprop under win 10 64b?...
...would you please advise what other party .dll are needed? And where are they available?...

I believe they are quite kind and polite questions, so I am passionately waiting for an answer. After that I will download them, copy them to some locations,  hoping your build will work. That is my idea.

Also I am sorry that I am not C programmer, I do not have large knowledge what are these mingws, swigs or cmakes do and how they are used in coolprop. I used to work in fortran, pascal, delphi, now I am in R and trying Python, but I am far more advanced in R where my painfully developed Coolprop (actually Refprop  - we paid for licences as a company) based tools are written.  I did guide recommended tool download, I even resolved some unknown issues, but with that I am still far away from final build and I am sticked with 6.3.x version here.

I think, I did some work, which unfortunately not resulted well (yet), I did ask polite question IMHO, and my company did pay for refprop, so kind of support is there as well. 

However I will continue in my effort and I believe one day will finish compilation of latest build successfully.

I do not want to bother anybody or be impolite, so I really apologize for any inconvenient feelings my posts may caused.

Regards
Pavel.

Ian Bell

unread,
Jan 25, 2021, 1:26:49 PM1/25/21
to coolpro...@googlegroups.com
The issue is that anything that uses MINGW is just really, really, really hard to support. And thus there are no easy answers. To know what DLL a library (shared library or executable) depends on, you can use this tool: http://dependencywalker.com/ .  The DLL that it identifies need to be copied into a location that is on your PATH.  But the sticker is that EXACTLY the DLL used to build the library need to be used. Sometimes if a thing (octave for instance) also needs MINGW shared libraries (but different ones), you can find yourself in DLL hell.  This is why building the interface yourself is recommended, and the instructions cover most of the important details.  

The good news is that I tried building the octave module with Octave 5.2, and it went flawlessly (I think the same would be for 6.1 as well). The installation folder of SWIG is already on my PATH variable. These are the commands I ran in a power shell window:

mkdir build
cd build
mkdir octave
cd octave
$env:PATH = 'C:\Octave\Octave-5.2.0\mingw64\bin;'+$env:PATH
cmake ../.. -G "MinGW Makefiles" -DCOOLPROP_OCTAVE_MODULE=ON -DBUILD_TESTING=ON -DCMAKE_CXX_STANDARD=11 -DCMAKE_BUILD_TYPE=Release
cmake --build .

I also needed to install mingw32-make.  I downloaded the EXE installer from https://sourceforge.net/projects/mingw/files/MinGW/Extension/make/mingw32-make-3.80-3/ and a tricky point is to make sure that the installed executable ends up in the same folder as mkoctfile executable.

Please try this on your side and provide a copy-paste of all shell output that you get if it doesn't work.

Reply all
Reply to author
Forward
0 new messages