[R] Compiling a FORTRAN program under Windows 7

Berend Hasselman bhh at xs4all.nl
Thu May 5 18:43:11 CEST 2011


Mikael Anderson wrote:
> 
> Hi,
> 
> I am trying to compile a FORTRAN program to call from R under Windows 7
> but
> I am having problem in the compiling step. To demonstrate this is the
> program testit.f:
> 
> ------------------------------------------
>       subroutine TESTIT(x,n,m)
>       dimension x(n)
>       do 10 i=1,n
> 10      x(i)=x(i)**m
>       end
> --------------------------------------------
> 
> 

In addition to the previous remarks, you would do yourself a favour by
utilizing the implicit-none option of gfortran. That will force you to
declare every variable (and its type) which will avoid many nasty bugs.
In your case: x is a REAL single precision but with R you will preferably
need double precision.
So I would advise you to use

gfortran -fimplicit-none ......

Berend

--
View this message in context: http://r.789695.n4.nabble.com/Compiling-a-FORTRAN-program-under-Windows-7-tp3498663p3498839.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list