From simon.urbanek at r-project.org  Mon Sep 12 15:02:14 2005
From: simon.urbanek at r-project.org (Simon Urbanek)
Date: Mon, 12 Sep 2005 09:02:14 -0400
Subject: [Rd] A question on R memory management in .Fortran() calls
	under Windows
In-Reply-To: <3c12769c05091201305a31f10f@mail.gmail.com>
References: <3c12769c0509091004555400f@mail.gmail.com>
	<4321CBB4.3090805@stats.uwo.ca>
	<3c12769c05091201305a31f10f@mail.gmail.com>
Message-ID: <2B95FE9B-2106-4226-A9AE-395C070994BD@r-project.org>

Simone,

On Sep 12, 2005, at 4:30 AM, Simone Giannerini wrote:

> yes, CVF allocates automatic objects on the stack and apparently  
> there is no way of changing it.

Yes, that's bad news.

> By the way, increasing the stack of the fortran process when  
> linking does not solve the problem

In general the stack size is also governed by the system limits so  
you may need to increase those as well, but still, that won't really  
solve your problem.

>> I'd say your only reasonable workarounds are to tell your compiler to
>> use the heap for the local matrix allocation (if that's possible),  
>> or do
>> your allocations in R.
>>
>
> I might follow the second way, in any case, I am considering  
> switching to Linux, I have also  considered changing compiler under  
> Win,  any suggestions on the choice would be welcomed.

As Duncan was mentioning g77 is your friend if you can convert your  
code to f77. If you don't have that option, you're partially on your  
own. GNU Fortran 95 (gfortran) may be an option as it exists both for  
unix and Windows (although not as a part of MinGW), but R currently  
doesn't provide .f90 target so you'll need to add your own small  
Makevars.

Cheers,
Simon



[Rd] A question on R memory management in .Fortran() calls under Windows
Simon Urbanek