[R] Loading to R of Fortran DLL

Thomas Lumley tlumley at u.washington.edu
Fri Jan 18 17:38:43 CET 2002


On Sat, 19 Jan 2002 baba at mxr.mesh.ne.jp wrote:

> 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
     ^^^^^
  that isn't the problem, but you really should upgrade at least once a
year.


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

>
> 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.

That looks as if you *did* load it. There was no error message, and
dyn.load() is supposed to return NULL (though this could be documented
better).

To check, you can try

   is.loaded(symbol.For("FOO"))

to see if SUBROUTINE FOO is accessible to .Fortran calls.

	-thomas

Thomas Lumley			Asst. Professor, Biostatistics
tlumley at u.washington.edu	University of Washington, Seattle

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list