[R] Loading to R of Fortran DLL

baba@mxr.mesh.ne.jp
Fri, 18 Jan 2002 15:48:10 -0000

Dear R-ers

Could you tell me how to build DLL from Fortran source and use the DLL in R?

Environments:
Windows 98
Fortran compiler : DIGITAL Visual Fortran Optimizing Compiler Version: V5.0
R v1.2.3

EXAMPLE SOURCE : FOO.FOR
-------------------------------------
		SUBROUTINE FOO(I,J)
		INTEGER I,J
		I=0
		J=I+1
		END
-------------------------------------

I compiled FOO.FOR with DLL option.

C:\> DF FOO.FOR /DLL
#####
###
####
FOO.DLL

Then, I could build FOO.DLL and used R as follows.

R> print(dyn.load("FOO.DLL"))
NULL
R>

I could not load FOO.DLL. I am not sure whether FOO.DLL is bad or not.

Could you tell me how to build DLL in Visual Fortran or another fortran compiler
on Windows?
I will appreciate it, if you give me a sample Fortran code and any advice to
build and use DLL.

Best Regards,
Baba