usnistgov/REFPROP-cmake

Successful Build ARM64 Android

defencedog opened this issue · 1 comments

I have been able to generate .so following this:

git clone --recursive https://github.com/usnistgov/REFPROP-cmake.git

Copy the fortran directory from your REFPROP installation into the root & patch x2 files:
nano /data/data/com.termux/files/home/REFPROP-cmake/fortran/PASS_FTN.FOR the lines with dll_export should be commented out (prefix line with c)
nano /data/data/com.termux/files/home/REFPROP-cmake/fortran/UTILITY.FOR
comment out line 1213
c if (ABS(iprnterr).ge.3) pause

build & make will generate librefprop.so & avoids unrecognized -a option lias

mkdir build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=$PREFIX -DCMAKE_C_COMPILER=clang -DCMAKE_Fortran_COMPILER=gfortran-11 -DDEFSYM_FLAG=--using-defsym && make -j8

onto wrappers...

pip install ctREFPROP
cd ...site-packages/ctREFPROP
mv REFPROP (& its x3 folders case sensitive)
REFPROP 
		Examples
		fluids
		mixtures
cp librefprop.so .

add environment variable nano ~/.bash_profile & add this line

export RPPREFIX=<location>../site-packages/ctREFPROP/REFPROP/

Now following python code outputs 8.01c bad luck for me I don't have the new one but at least someone on Android can benefit from it

import os, numpy as np
from ctREFPROP.ctREFPROP import REFPROPFunctionLibrary
RP = REFPROPFunctionLibrary(os.environ[
RP.SETPATHdll(os.environ['RPPREFIX'])
print(RP.RPVersion())

Additionally the functions supported by .so can be listed & saved to txt file via objdump -T librefprop.so > dll_functionsList.8.01c.txt

dll_functionsList.8.01c.txt

Thanks for this! On modern ARM64 setup with REFPROP 10, none of the mods should be needed, I build on my Mac M1 without any problems.

P.S. You should retain ALL folders (FLUIDS, MIXTURES) as uppercase.