[R] Re: [Rd] F90

Göran Broström gb at stat.umu.se
Sun Mar 27 07:38:14 CEST 2005


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 at 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 at stat.umu.se




More information about the R-help mailing list