[R] Re: [Rd] F90

From: Göran Broström <gb_at_stat.umu.se>
Date: Sun 27 Mar 2005 - 15:38:14 EST

On Sun, Mar 27, 2005 at 03:26:39AM +0200, Gorjanc Gregor wrote:
> Hello!
>
> Has anyone successfully compiled F90 sources in R-package? I found the
> same question on r-devel list from 2002 and I wonder if there is any
> progress. I heard that g95 and gfortran can be usable.
>
> And one more thing. I have a program written in F90 and lets suppose that
> compiler is not a problem. I've read manual 'Writing R Extensions' and
> successfully loaded one F77 subroutine in R for test and I had no problem.
> However, what is the strategy if one has a whole program i.e. main program
> + subroutines and wants to call it from R?

Well, you have essentially two options:

  1. Rewrite your main program as an R function, from which you call the subroutines (thru the .Fortran interface).
  2. Rewrite your main program as a Fortran subroutine, write an R wrapper, that calls your new subroutine (thru the .Fortran interface).

Choose whatever is simplest.

Göran

>
> Thanks in advance!
>
> --
> Lep pozdrav / With regards,
> Gregor Gorjanc
>
> ------------------------------------------------------------------------
> University of Ljubljana
> Biotechnical Faculty URI: http://www.bfro.uni-lj.si/MR/ggorjan
> Zootechnical Department email: gregor.gorjanc <at> bfro.uni-lj.si
> Groblje 3 tel: +386 (0)1 72 17 861
> SI-1230 Domzale fax: +386 (0)1 72 17 888
> Slovenia
>
> ______________________________________________
> R-devel@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel

-- 
 Göran Broström                    tel: +46 90 786 5223
 Department of Statistics          fax: +46 90 786 6614
 Umeå University                   http://www.stat.umu.se/egna/gb/
 SE-90187 Umeå, Sweden             e-mail: gb@stat.umu.se

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Received on Sun Mar 27 15:50:00 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:30:56 EST