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

Errors Compiling on OS X Yosemite #23

Closed wlgardner closed 9 years ago

wlgardner commented 9 years ago

Hi Guys,

Happy Holidays to you!

I have the latest Command line tools, HPC gfortran, and a licensed version of REFPROP 9.1 source code. When i tried to compile librefprop my initial problem was with this error -> clang: error: unknown argument: '-mpreferred-stack-boundary=8'. I'm not sure what affect that would have with or without it. So, i commented it out for the time being. After, the next attempt I now get the following 'warning/error'

clang: warning: argument unused during compilation: '-fbounds-check' fortran/UTILITY.c:8:10: fatal error: 'fcrt.h' file not found

include

I've checked my system thoroughly and cannot find this file. Any ideas, insight, education would be helpful.

Regards

William

jowr commented 9 years ago

Hi, thanks for the post. Honestly, I have no idea what is going on. Your setup seems to be pretty close to one of my remote servers and I had no issues at all. Also my system does not have a file called fcrt.h anywhere, but is not used either. I wonder where your file fortran/UTILITY.c comes from. I only have a fortran/UTILITY.FORand there are no C-files at all. Here is the output of my ls -lh fortran

-rwxr-xr-x  1 jowr  staff    33K 24 Nov 16:44 COMMONS.FOR
-rwxr-xr-x  1 jowr  staff    33K 25 Nov 19:52 COMMONS.f
-rwxr-xr-x  1 jowr  staff    33K 25 Nov 19:52 COMMONS.f.du
-rwxr-xr-x  1 jowr  staff   8.0K 24 Nov 16:44 COMTRN.FOR
-rwxr-xr-x  1 jowr  staff   8.0K 25 Nov 19:52 COMTRN.f
-rwxr-xr-x  1 jowr  staff   8.0K 25 Nov 19:52 COMTRN.f.du
-rwxr-xr-x  1 jowr  staff    41K 24 Nov 16:44 CORE_ANC.FOR
-rwxr-xr-x  1 jowr  staff    41K 25 Nov 19:52 CORE_ANC.f.du
-rw-r--r--  1 jowr  staff    36K 25 Nov 19:52 CORE_ANC.o
-rwxr-xr-x  1 jowr  staff    40K 24 Nov 16:44 CORE_BWR.FOR
-rwxr-xr-x  1 jowr  staff    40K 25 Nov 19:52 CORE_BWR.f.du
-rw-r--r--  1 jowr  staff    24K 25 Nov 19:52 CORE_BWR.o
-rwxr-xr-x  1 jowr  staff    29K 24 Nov 16:44 CORE_CPP.FOR
-rwxr-xr-x  1 jowr  staff    29K 25 Nov 19:52 CORE_CPP.f.du
-rw-r--r--  1 jowr  staff    17K 25 Nov 19:52 CORE_CPP.o
-rwxr-xr-x  1 jowr  staff   9.3K 24 Nov 16:44 CORE_DE.FOR
-rwxr-xr-x  1 jowr  staff   9.3K 25 Nov 19:52 CORE_DE.f.du
-rw-r--r--  1 jowr  staff    13K 25 Nov 19:52 CORE_DE.o
-rwxr-xr-x  1 jowr  staff    21K 24 Nov 16:44 CORE_ECS.FOR
-rwxr-xr-x  1 jowr  staff    21K 25 Nov 19:52 CORE_ECS.f.du
-rw-r--r--  1 jowr  staff    17K 25 Nov 19:52 CORE_ECS.o
-rwxr-xr-x  1 jowr  staff    44K 24 Nov 16:44 CORE_FEQ.FOR
-rwxr-xr-x  1 jowr  staff    44K 25 Nov 19:52 CORE_FEQ.f.du
-rw-r--r--  1 jowr  staff    23K 25 Nov 19:52 CORE_FEQ.o
-rwxr-xr-x  1 jowr  staff    25K 24 Nov 16:44 CORE_MLT.FOR
-rwxr-xr-x  1 jowr  staff    25K 25 Nov 19:52 CORE_MLT.f.du
-rw-r--r--  1 jowr  staff    25K 25 Nov 19:52 CORE_MLT.o
-rwxr-xr-x  1 jowr  staff    17K 24 Nov 16:44 CORE_PH0.FOR
-rwxr-xr-x  1 jowr  staff    17K 25 Nov 19:52 CORE_PH0.f.du
-rw-r--r--  1 jowr  staff    17K 25 Nov 19:53 CORE_PH0.o
-rwxr-xr-x  1 jowr  staff    35K 24 Nov 16:44 CORE_PR.FOR
-rwxr-xr-x  1 jowr  staff    34K 25 Nov 19:53 CORE_PR.f.du
-rw-r--r--  1 jowr  staff    25K 25 Nov 19:53 CORE_PR.o
-rwxr-xr-x  1 jowr  staff    16K 24 Nov 16:44 CORE_QUI.FOR
-rwxr-xr-x  1 jowr  staff    16K 25 Nov 19:53 CORE_QUI.f.du
-rw-r--r--  1 jowr  staff    13K 25 Nov 19:53 CORE_QUI.o
-rwxr-xr-x  1 jowr  staff    20K 24 Nov 16:44 CORE_STN.FOR
-rwxr-xr-x  1 jowr  staff    20K 25 Nov 19:53 CORE_STN.f.du
-rw-r--r--  1 jowr  staff    20K 25 Nov 19:53 CORE_STN.o
-rwxr-xr-x  1 jowr  staff   136K 24 Nov 16:44 FLASH2.FOR
-rwxr-xr-x  1 jowr  staff   136K 25 Nov 19:53 FLASH2.f.du
-rw-r--r--  1 jowr  staff    88K 25 Nov 19:53 FLASH2.o
-rwxr-xr-x  1 jowr  staff   113K 24 Nov 16:44 FLSH_SUB.FOR
-rwxr-xr-x  1 jowr  staff   113K 25 Nov 19:53 FLSH_SUB.f.du
-rw-r--r--  1 jowr  staff    62K 25 Nov 19:53 FLSH_SUB.o
-rwxr-xr-x  1 jowr  staff    16K 24 Nov 16:44 IDEALGAS.FOR
-rwxr-xr-x  1 jowr  staff    16K 25 Nov 19:53 IDEALGAS.f.du
-rw-r--r--  1 jowr  staff   8.3K 25 Nov 19:53 IDEALGAS.o
-rwxr-xr-x  1 jowr  staff   110K 24 Nov 16:44 MANUAL.TXT
-rwxr-xr-x  1 jowr  staff    34K 24 Nov 16:44 MIX_AGA8.FOR
-rwxr-xr-x  1 jowr  staff    34K 25 Nov 19:53 MIX_AGA8.f.du
-rw-r--r--  1 jowr  staff    45K 25 Nov 19:53 MIX_AGA8.o
-rwxr-xr-x  1 jowr  staff    81K 24 Nov 16:44 MIX_HMX.FOR
-rwxr-xr-x  1 jowr  staff    81K 25 Nov 19:53 MIX_HMX.f.du
-rw-r--r--  1 jowr  staff    62K 25 Nov 19:53 MIX_HMX.o
-rwxr-xr-x  1 jowr  staff    57K 24 Nov 16:44 PASS_FTN.FOR
-rwxr-xr-x  1 jowr  staff   129K 24 Nov 16:44 PROP_SUB.FOR
-rwxr-xr-x  1 jowr  staff   129K 25 Nov 19:53 PROP_SUB.f.du
-rw-r--r--  1 jowr  staff   102K 25 Nov 19:53 PROP_SUB.o
-rwxr-xr-x  1 jowr  staff   8.6K 24 Nov 16:44 REALGAS.FOR
-rwxr-xr-x  1 jowr  staff   8.6K 25 Nov 19:53 REALGAS.f.du
-rw-r--r--  1 jowr  staff   7.7K 25 Nov 19:53 REALGAS.o
-rwxr-xr-x  1 jowr  staff   213K 24 Nov 16:44 SAT_SUB.FOR
-rwxr-xr-x  1 jowr  staff   213K 25 Nov 19:53 SAT_SUB.f.du
-rw-r--r--  1 jowr  staff   187K 25 Nov 19:53 SAT_SUB.o
-rwxr-xr-x  1 jowr  staff   108K 24 Nov 16:44 SETUP.FOR
-rwxr-xr-x  1 jowr  staff   108K 25 Nov 19:52 SETUP.f.du
-rw-r--r--  1 jowr  staff    73K 25 Nov 19:52 SETUP.o
-rwxr-xr-x  1 jowr  staff    38K 24 Nov 16:44 SETUP2.FOR
-rwxr-xr-x  1 jowr  staff    38K 25 Nov 19:53 SETUP2.f.du
-rw-r--r--  1 jowr  staff    29K 25 Nov 19:53 SETUP2.o
-rwxr-xr-x  1 jowr  staff    43K 24 Nov 16:44 TRNSP.FOR
-rwxr-xr-x  1 jowr  staff    43K 25 Nov 19:53 TRNSP.f.du
-rw-r--r--  1 jowr  staff    32K 25 Nov 19:53 TRNSP.o
-rwxr-xr-x  1 jowr  staff   109K 24 Nov 16:44 TRNS_ECS.FOR
-rwxr-xr-x  1 jowr  staff   109K 25 Nov 19:53 TRNS_ECS.f.du
-rw-r--r--  1 jowr  staff    49K 25 Nov 19:53 TRNS_ECS.o
-rwxr-xr-x  1 jowr  staff   102K 24 Nov 16:44 TRNS_TCX.FOR
-rwxr-xr-x  1 jowr  staff   102K 25 Nov 19:53 TRNS_TCX.f.du
-rw-r--r--  1 jowr  staff    67K 25 Nov 19:53 TRNS_TCX.o
-rwxr-xr-x  1 jowr  staff    91K 24 Nov 16:44 TRNS_VIS.FOR
-rwxr-xr-x  1 jowr  staff    91K 25 Nov 19:53 TRNS_VIS.f.du
-rw-r--r--  1 jowr  staff    67K 25 Nov 19:53 TRNS_VIS.o
-rwxr-xr-x  1 jowr  staff    83K 24 Nov 16:44 UTILITY.FOR
-rwxr-xr-x  1 jowr  staff    83K 25 Nov 19:53 UTILITY.f.du
-rw-r--r--  1 jowr  staff    72K 25 Nov 19:53 UTILITY.o

The directory only contains the backups of the original Fortran files *.f.du, the modified Fortran sources *.FOR and the compiled object files *.o. As you can see, there are no C-files at all...

wlgardner commented 9 years ago

Yeah, I'm getting all the same files. But for some reason it hangs up on Utility.FOR. I'm at a loss. Is your system using clang when compiling for the Mac?

I just tried to compile once more. And the same results. Here is the list...

-rwx------ 1 williamgardner staff 33K Apr 6 2013 COMMONS.FOR -rwx------ 1 williamgardner staff 33K Jan 2 18:11 COMMONS.f -rwx------ 1 williamgardner staff 33K Jan 2 18:11 COMMONS.f.du -rwx------ 1 williamgardner staff 8.0K Apr 6 2013 COMTRN.FOR -rwx------ 1 williamgardner staff 8.0K Jan 2 18:11 COMTRN.f -rwx------ 1 williamgardner staff 8.0K Jan 2 18:11 COMTRN.f.du -rwx------ 1 williamgardner staff 41K Apr 6 2013 CORE_ANC.FOR -rwx------ 1 williamgardner staff 41K Jan 2 18:11 CORE_ANC.f.du -rw-r--r-- 1 williamgardner staff 36K Jan 2 18:11 CORE_ANC.o -rwx------ 1 williamgardner staff 40K Apr 6 2013 CORE_BWR.FOR -rwx------ 1 williamgardner staff 40K Jan 2 18:11 CORE_BWR.f.du -rw-r--r-- 1 williamgardner staff 24K Jan 2 18:11 CORE_BWR.o -rwx------ 1 williamgardner staff 29K Apr 6 2013 CORE_CPP.FOR -rwx------ 1 williamgardner staff 29K Jan 2 18:11 CORE_CPP.f.du -rw-r--r-- 1 williamgardner staff 17K Jan 2 18:11 CORE_CPP.o -rwx------ 1 williamgardner staff 9.3K Apr 6 2013 CORE_DE.FOR -rwx------ 1 williamgardner staff 9.3K Jan 2 18:11 CORE_DE.f.du -rw-r--r-- 1 williamgardner staff 13K Jan 2 18:11 CORE_DE.o -rwx------ 1 williamgardner staff 21K Apr 6 2013 CORE_ECS.FOR -rwx------ 1 williamgardner staff 21K Jan 2 18:11 CORE_ECS.f.du -rw-r--r-- 1 williamgardner staff 16K Jan 2 18:11 CORE_ECS.o -rwx------ 1 williamgardner staff 44K Apr 6 2013 CORE_FEQ.FOR -rwx------ 1 williamgardner staff 44K Jan 2 18:11 CORE_FEQ.f.du -rw-r--r-- 1 williamgardner staff 23K Jan 2 18:11 CORE_FEQ.o -rwx------ 1 williamgardner staff 25K Apr 6 2013 CORE_MLT.FOR -rwx------ 1 williamgardner staff 25K Jan 2 18:11 CORE_MLT.f.du -rw-r--r-- 1 williamgardner staff 25K Jan 2 18:11 CORE_MLT.o -rwx------ 1 williamgardner staff 17K Apr 6 2013 CORE_PH0.FOR -rwx------ 1 williamgardner staff 17K Jan 2 18:11 CORE_PH0.f.du -rw-r--r-- 1 williamgardner staff 17K Jan 2 18:11 CORE_PH0.o -rwx------ 1 williamgardner staff 35K Apr 6 2013 CORE_PR.FOR -rwx------ 1 williamgardner staff 34K Jan 2 18:11 CORE_PR.f.du -rw-r--r-- 1 williamgardner staff 25K Jan 2 18:11 CORE_PR.o -rwx------ 1 williamgardner staff 16K Apr 6 2013 CORE_QUI.FOR -rwx------ 1 williamgardner staff 16K Jan 2 18:11 CORE_QUI.f.du -rw-r--r-- 1 williamgardner staff 13K Jan 2 18:11 CORE_QUI.o -rwx------ 1 williamgardner staff 20K Apr 6 2013 CORE_STN.FOR -rwx------ 1 williamgardner staff 20K Jan 2 18:11 CORE_STN.f.du -rw-r--r-- 1 williamgardner staff 20K Jan 2 18:11 CORE_STN.o -rwx------ 1 williamgardner staff 136K Apr 6 2013 FLASH2.FOR -rwx------ 1 williamgardner staff 136K Jan 2 18:11 FLASH2.f.du -rw-r--r-- 1 williamgardner staff 88K Jan 2 18:11 FLASH2.o -rwx------ 1 williamgardner staff 113K Apr 6 2013 FLSH_SUB.FOR -rwx------ 1 williamgardner staff 113K Jan 2 18:11 FLSH_SUB.f.du -rw-r--r-- 1 williamgardner staff 62K Jan 2 18:11 FLSH_SUB.o -rwx------ 1 williamgardner staff 16K Apr 6 2013 IDEALGAS.FOR -rwx------ 1 williamgardner staff 16K Jan 2 18:11 IDEALGAS.f.du -rw-r--r-- 1 williamgardner staff 8.3K Jan 2 18:11 IDEALGAS.o -rwx------ 1 williamgardner staff 110K Apr 6 2013 MANUAL.TXT -rwx------ 1 williamgardner staff 34K Apr 6 2013 MIX_AGA8.FOR -rwx------ 1 williamgardner staff 34K Jan 2 18:11 MIX_AGA8.f.du -rw-r--r-- 1 williamgardner staff 45K Jan 2 18:11 MIX_AGA8.o -rwx------ 1 williamgardner staff 81K Apr 6 2013 MIX_HMX.FOR -rwx------ 1 williamgardner staff 81K Jan 2 18:11 MIX_HMX.f.du -rw-r--r-- 1 williamgardner staff 62K Jan 2 18:11 MIX_HMX.o -rwx------ 1 williamgardner staff 57K Apr 6 2013 PASS_FTN.FOR -rwx------ 1 williamgardner staff 129K Apr 6 2013 PROP_SUB.FOR -rwx------ 1 williamgardner staff 129K Jan 2 18:11 PROP_SUB.f.du -rw-r--r-- 1 williamgardner staff 102K Jan 2 18:12 PROP_SUB.o -rwx------ 1 williamgardner staff 8.6K Apr 6 2013 REALGAS.FOR -rwx------ 1 williamgardner staff 8.6K Jan 2 18:12 REALGAS.f.du -rw-r--r-- 1 williamgardner staff 7.7K Jan 2 18:12 REALGAS.o -rwx------ 1 williamgardner staff 213K Apr 6 2013 SAT_SUB.FOR -rwx------ 1 williamgardner staff 213K Jan 2 18:12 SAT_SUB.f.du -rw-r--r-- 1 williamgardner staff 186K Jan 2 18:12 SAT_SUB.o -rwx------ 1 williamgardner staff 108K Apr 6 2013 SETUP.FOR -rwx------ 1 williamgardner staff 108K Jan 2 18:11 SETUP.f.du -rw-r--r-- 1 williamgardner staff 73K Jan 2 18:11 SETUP.o -rwx------ 1 williamgardner staff 38K Apr 6 2013 SETUP2.FOR -rwx------ 1 williamgardner staff 38K Jan 2 18:12 SETUP2.f.du -rw-r--r-- 1 williamgardner staff 29K Jan 2 18:12 SETUP2.o -rwx------ 1 williamgardner staff 43K Apr 6 2013 TRNSP.FOR -rwx------ 1 williamgardner staff 43K Jan 2 18:12 TRNSP.f.du -rw-r--r-- 1 williamgardner staff 32K Jan 2 18:12 TRNSP.o -rwx------ 1 williamgardner staff 109K Apr 6 2013 TRNS_ECS.FOR -rwx------ 1 williamgardner staff 109K Jan 2 18:12 TRNS_ECS.f.du -rw-r--r-- 1 williamgardner staff 49K Jan 2 18:12 TRNS_ECS.o -rwx------ 1 williamgardner staff 102K Apr 6 2013 TRNS_TCX.FOR -rwx------ 1 williamgardner staff 102K Jan 2 18:12 TRNS_TCX.f.du -rw-r--r-- 1 williamgardner staff 68K Jan 2 18:12 TRNS_TCX.o -rwx------ 1 williamgardner staff 91K Apr 6 2013 TRNS_VIS.FOR -rwx------ 1 williamgardner staff 91K Jan 2 18:12 TRNS_VIS.f.du -rw-r--r-- 1 williamgardner staff 67K Jan 2 18:12 TRNS_VIS.o -rwx------ 1 williamgardner staff 83K Apr 6 2013 UTILITY.FOR -rwx------ 1 williamgardner staff 2.3K May 7 2014 UTILITY.c

No other C files are present only Utility...

jowr commented 9 years ago

What is that c-file? Where does it come from? Could you just delete it and try again?

wlgardner commented 9 years ago

That my friend is a very good question. I just deleted the C file. Ran 'make' and got the .du, .o files. However, it hung up on:

ld: warning: ignoring file /usr/local/lib/libgfortran.dylib, missing required architecture x86_64 in file /usr/local/lib/libgfortran.dylib (2 slices) rm fortran/UTILITY.f

So, I'm going to try and re-install HPC fortran once more. And go from there. I'd be very interested in knowing where the c file came from as well.

Also, the '-mpreferred-stack-boundary=8' is it really necessary for 64 bit system? Excuse my ignorance, i'm not a fluent compiler guru. :)

Regards

William

wlgardner commented 9 years ago

Update: Re-installed HPC compiler tools.

Williams-MacBook-Pro-2:librefprop williamgardner$ ./bin/ex_mix_for 300.0000 1740.5894 14.4550 0.9628 300.0000 1735.1589 14.2345 0.9603

Maybe an issue with the pre-compiled binary? I dunno. The c file is a mystery. Thanks for your help, i apologize for the inconvenience.

In the mean time, I will leave the '-mpreferred-stack-boundary=8' commented out.

Regards

William

jowr commented 9 years ago

Thank you for the feedback. I have to admit that I do not know if -mpreferred-stack-boundary=8 is needed or not. If it broke things for you, we might just remove it in the next version.

wlgardner commented 9 years ago

No Problem. Thanks for your help. Clang didn't like it. To my knowledge reading up on the clang compiler flags because of other library issues...in the future a lot of over rides, etc...will be removed. So just food for thought. BTW, thank you for this library. Your efforts are greatly appreciated.

If you're up for another challenge, here is an interesting link regarding Fortran and iOS.

http://apple.stackexchange.com/questions/40471/is-there-a-fortran-compiler-emulator-for-ios

Have a great weekend and thanks for you time.

Regards

William