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
https://github.com/usnistgov/REFPROP-cmake
33 stars 8 forks source link

bug report of -fPIC option of gcc in v0.2 for refprop 9.0 #24

Closed ghost closed 9 years ago

ghost commented 9 years ago

I tried to use v0.2 to compile the refprop 9.0 in ubuntu 14.04 server. gcc 4.8.2 and gfotran 4.8.2 were used. The output is the same as Link to a former ISSUE According to the error message, I added the -fPIC option to the compiler by modifying the line of OPTFLAGS in the Makefile as:

OPTFLAGS   =-fPIC -O3 -ffast-math -ffloat-store # optimisation, remove for debugging

And I successfully compiled the files into a .so file, though there were a lot of warnings. This is the test result:

vagrant@vagrant-ubuntu-trusty-64:~/refprop/librefprop.so-0.2/python$ python example.py

   Point       Temperature,    Pressure,      Enthalpy,       Entropy,
                    C             bar           kJ/kg         kJ/kg-K
========================================================================
Point 1              20.000          1.638        105.738          0.612
Point 2              24.117         40.000        118.551          0.633
Point 3             250.000         39.500        912.754          2.558
Point 4             177.568          2.138        791.765          2.649

    Parameter         Value     Unit
=====================================
subcooling              5.000   K
HX pressure drop        0.500   bar
eta pump               50.000   %
eta expander           75.000   %
Pump work              12.813   kJ/kg
added heat            794.203   kJ/kg
expander work        -120.989   kJ/kg
thermal efficiency     13.621   %
power, 50 g/s           5.409   kW
ghost commented 9 years ago

Nice! Thanks for your feedback. I think it even could benefit to some other users and issues: issue #22, for exemple. Good job :-)