Hi, I'm using R 7.0 under Linux as a programming interface to Fortran (g77 v0.5.24). Basically, what I want to do is to call a fortran subroutine of mine which performs MCMC computations. Apparently I'm getting into memory management problems.
To track the problem I wrote the following small Fortran subroutine (saved as test.f) : subroutine test(n,p) implicit none integer n,p,i,j real x(n,p) do i=1,n do j=1,p x(i,j) = 0 enddo enddo end I compiled it by : g77 -c test.f then I called it from R with : n <- 10000 p <- 1000 system("R CMD SHLIB ~/test.o") dyn.load("~/test.so") out.res<- .Fortran("test", as.integer(n), as.integer(p) ) causing R breakdown with the following message : Segmentation fault I don't understand why this subroutine causes segmentartion fault as its execution requires much less memory than what is existing on my machine (RAM 512 Mo RAM + swap 512 Mo ). More generally, it seems that memory limitations are stronger when calling fortran code from R than when executing the same Fortran subroutine from a bash command line. Gilles ______________________________________________ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html