[Rd] Fortran DLLs and R

From: <jferrari_at_umces.edu>
Date: Wed, 24 Mar 2010 13:29:56 -0400 (EDT)


Hi All,

I'm writing R code that would benefit from doing certain tasks using compiled blocks of code, specifically Fortran subroutines of my own
(already written, debugged in both Fortran77 and Fortran90).

I am currently working on a Windows machine using Lahey and/or MinGW(g77) compilers.

It is possible to dynamically load Fortran DLLs into R as evidenced from the several documents I've found on-line giving details on how to do this
(specifically for Windows). However, following the examples in these
documents... none of them successfully deliver a DLL that can be called from R (and I'm talking for simple test Fortran subroutines that add 2+2).

Either the directions for creating the DLL (for a specific compiler) do not work (no DLL created), or a DLL is created and exists but will not be loaded/recognized by R (result of is.loaded = FALSE).

Can anyone give me a quick/dirty step by step on how to create a DLL
(using g77 compiler, specifically MinGW for Windows) so that it will work
in R, on a Windows machine (as well as any tips on anything that has to be done to, or in, R to get it to work), or if there's a definitive easy to read paper/book describing the process?

Any advice/input would be greatly appreciated.

Thank you!

Joe Ferrari

Joseph Ferrari
Faculty Research Assistant
UMCES Appalachian Laboratory
301 Braddock Road
Frostburg, MD 21532



R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Wed 24 Mar 2010 - 17:33:24 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 25 Mar 2010 - 01:21:17 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.

list of date sections of archive