簡単なFortranルーチンを作成しました
subroutine add(x,y)
real(8) :: x,y
y = x + 3
end subroutine
test.f90として保存されます。
私はでコンパイルします
gfortran -shared test.f90 -o test.so
R(同じディレクトリ内)では、
dyn.load('test.so')
しかし、それは私にこのエラーを与えます:
Error in dyn.load("test.so") :
unable to load shared object '/Users/Steven/Documents/PhD/npsR/test.so':
dlopen(/Users/Steven/Documents/PhD/npsR/test.so, 6): Symbol not found: ___addtf3
Referenced from: /usr/local/gfortran/lib/libquadmath.0.dylib
Expected in: /Library/Frameworks/R.framework/Resources/lib/libgcc_s.1.dylib
in /usr/local/gfortran/lib/libquadmath.0.dylib
誰かが理由を知っていますか?私はMacosxLionを使用しており、Rv2.15.0とgfortran4.6.2を使用しています。
ありがとうございました!