[R] compiling, linking and including multiple FORTRAN subroutines in R

Bill Shipley bill.shipley at usherbrooke.ca
Tue Jul 13 21:40:58 CEST 2010


Although there are a number of documents describing library development, in
which compiling and using C or FORTRAN source code is discussed, such
documents are too detailed and complicated for my limited needs (i.e. I
can't follow them!).   I am looking for a worked example (i.e. the series of
commands etc) that does the following from within a WINDOWS environment:

Given a series (i.e. more than one) of files containing FORTRAN source code
for subroutines
1. how to compile and link these subroutines using the g77 compiler that is
included in the R Tools (one main subroutine will call a series of other
subroutines) to produce a .DLL file
2. how to call this compiled subroutine, linked to the others, from within
an R function so that one can pass the arguments to the subroutine and get
the returned values.

I am familiar with FORTRAN programming and with R but not with the interface
of the two.
Thanks for any help or leads.

Bill Shipley
Bill.Shipley at USherbrooke.ca



More information about the R-help mailing list