[R] Calling Fortran routines
MartynB at nag.co.uk
Thu Apr 3 12:14:55 CEST 2003
I am having problems calling a fortran routine from within R. When the
routine is called, R exits with an application error:
"The instruction at 0x004a8b7d referenced memory at 0x200000015. The memory
could not be written".
The R code used to call the routine is:
The Fortran routine itself, is just a dummy routine, created to try and find
out why a more complex routine was causing R to crash, and consists of:
!DEC$ ATTRIBUTES DLLEXPORT :: GTEST_
!DEC$ ATTRIBUTES ALIAS:'GTEST_' :: GTEST_
Where the !DEC commands are needed in Visual Fortran to create the DLL (I
think !, these were copied from an example file on the compaq web page).
The strange thing about this is that if I remove variable E from the
subroutine definition and recreate the DLL everything works as expected. The
routine causes R to crash only when it has more than 4 variables.
Any help would be appreciated.
PS: I am using R version 1.6.2, under windows 2000 (professional), and the
Fortran code is compiled into a Windows 32bit DLL using Compaq Visual
Fortran Professional, edition 6.1.0
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
More information about the R-help