jowr / librefprop.so

Create a shared library from the Fortran sources provided by Refprop from NIST. This project provides an alternative to the refprop.dll that comes with the software. Please use the official instructions if possible

Home Page:https://github.com/usnistgov/REFPROP-cmake

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

El Cap librefprop issues

murenrb opened this issue · comments

Hey all,
I just made the mistake of updating the El Cap to find refprop no longer functional in my python codes. I was using librefprop on yosemite and it was working great.

When I try to run the code that used to work I get this error
"Good news: It is possible to use REFPROP on your system! However, the library could not be loaded. Please make sure that REFPROP is available on your system.
Neither found in current location nor found in system PATH.
If you already obtained a copy of REFPROP from http://www.nist.gov/srd/,
add location of REFPROP to the PATH environment variable or your library path.
In case you do not use Windows, have a look at https://github.com/jowr/librefprop.so
to find instructions on how to compile your own version of the REFPROP library."

At first I thought it was that I needed to re-install java. I did that.

Next I reinstalled gfortran and command line tools.

Finally I tried to reinstall librefprop and ran into this error when I get to the sudo make install step

*** No rule to make target fortran/PASS_FTN.FOR', needed bysrc/PASS_FTN_ALT.f'. Stop.

I am not sure whats up, but I am really regretting updating... any advice would be helpful.

This looks like you are using an old version of REFPROP. Are you sure that you are running REFPROP 9.11?

It looks like I am running version 9.1
screen shot 2015-11-11 at 10 34 55 am

Should I update to version 9.12? It looks like I can using this file:
http://www.boulder.nist.gov/div838/theory/refprop/912/REFPROP.HTM

I would just go ahead and try it, but I am concerned about breaking it further. Everything worked great before I updated operating systems, so I am a little surprised that the issue would be my refprop version.

Go, give it a try, but I am also surprised the you have problems. I will also ask a colleague who has a Mac to help me...

OK, no problems on El Capitan with REFPROP 9.12. Go ahead and upgrade.

I have updated to 9.12! I can run Refprop in my windows partition and it seems to be working great.

However, I still get the same errors when I try to call REFPROP in my python code:
"Good news: It is possible to use REFPROP on your system! However, the library could not be loaded. Please make sure that REFPROP is available on your system.
Neither found in current location nor found in system PATH.
If you already obtained a copy of REFPROP from http://www.nist.gov/srd/,
add location of REFPROP to the PATH environment variable or your library path.
In case you do not use Windows, have a look at https://github.com/jowr/librefprop.so
to find instructions on how to compile your own version of the REFPROP library."

And then when I try to sudo make install:
*** No rule to make target fortran/PASS_FTN.FOR', needed bysrc/PASS_FTN_ALT.f'. Stop.

Thoughts? Did your colleague have to re-install command line tools and fortran when they updated to El Cap?

Could you please double check that the permissions are OK and that you are using the latest version of this repository?

Can you compile the Fortran tests? That should be the first thing to check: https://github.com/jowr/librefprop.so#testing-the-installation

Ok, I think this must be the issue as I can't run the fortran test. I did some looking around and it seems like my gfortran which was 4.9 might have been out of date. I found this stackoverflow issue that seemed similar.

http://stackoverflow.com/questions/32977363/gfortran-doesnt-work-after-upgrading-to-el-capitan

So I updated to 5.2. I now get this error when running the fortran test (which is different than the error I got the first go around with version 4.9, that error was the same as the error in the stack overflow post):
Russells-MacBook-Pro:librefprop.so-master russellmuren$ make fortest
gfortran -O3 -ffast-math -fPIC -g -o ./src/ex_mix.o -c ./src/ex_mix.for
gfortran -g -o ./bin/ex_mix_for ./src/ex_mix.o -lrefprop -lgfortran
ld: can't open output file for writing './bin/ex_mix_for.ld_X0jYfA', errno=13 for architecture x86_64
collect2: error: ld returned 1 exit status
make: *** [bin/ex_mix_for] Error 1

Because it is saying it can't open the output file does this mean there is a permissions problem? I have no idea how to fix that.

I tried installing the most current librefprop and get the following output:
Russells-MacBook-Pro:librefprop.so-master russellmuren$ sudo make install
Password:
make: *** No rule to make target fortran/PASS_FTN.FOR', needed bysrc/PASS_FTN_ALT.f'. Stop.
Russells-MacBook-Pro:librefprop.so-master russellmuren$

I feel like we are getting really close. But I am way over my head here.

Do you have the missing file in the directory? It asks for fortran/PASS_FTN.FOR, which might not be there hence the error.

Ok, a good amount of progress has been made here.

  1. Yes, there were missing files. I apparently did a bad job copy and pasting from the refprop directory. I redid that and now the the current librefprop version is installed and the fortest test works great. So, it would appear that librefprop is working with refprop in perfect concert!
  2. I still get the same error when trying to run the python script however.
  3. Could the issue be in how coolprop is running? I tried uninstalling and reinstalling cooolprop, but that did not help the issue.

So, in conclusion, I was sure that fixing gfortran would fix the issue. But it would appear to have not. Any other ideas?

A couple of ideas:
a) Maybe it is linking to the wrong library. Do you get something like me:

Ians-Mac-mini:~ ian$ cd /opt/refprop
Ians-Mac-mini:refprop ian$ otool -L librefprop.dylib 
librefprop.dylib:
    /home/ian/lib/librefprop.9.1.dylib (compatibility version 9.1.0, current version 9.1.0)
    /usr/local/lib/gcc/5/libquadmath.0.dylib (compatibility version 1.0.0, current version 1.0.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1213.0.0)

b) Maybe you have a 32-bit library and a 64-bit python? AKA architecture problems

Ians-Mac-mini:refprop ian$ python --version
Python 2.7.10 :: Anaconda 2.3.0 (x86_64)
Ians-Mac-mini:refprop ian$ file librefprop.dylib 
librefprop.dylib: Mach-O 64-bit dynamically linked shared library x86_64

Also, is /opt/refprop in your system path? We use default search paths on all platforms.

This should not be an issue, the installer symlinks to /usr/local/lib, which is in the $PATH.

Should we continue the discussion at CoolProp/CoolProp#872 ? The Fortran test is working, which tells me that this is not a librefprop problem any longer.