Skip to content
Back to formatted view

Raw Message

Message-ID: <1304613791035-3498839.post@n4.nabble.com>
Date: 2011-05-05T16:43:11Z
From: Berend Hasselman
Subject: Compiling a FORTRAN program under Windows 7
In-Reply-To: <BANLkTikgf0zG4gO9ERhyxnYstR4ad-d7Zg@mail.gmail.com>

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.