[R] Calling Fortran routines

Duncan Murdoch murdoch at stats.uwo.ca
Fri Apr 4 22:33:40 CEST 2003


On Thu, 3 Apr 2003 11:14:55 +0100 , you wrote in message
<A1B373D68745D31180D100A0244BB400019F2FDF at nagmail.nag.co.uk>:


>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

I don't know that compiler at all, but the usual cause of crashes like
this is using incompatible calling conventions.  The usual calling
convention for a DLL in Windows is "stdcall", but R uses "cdecl";
since I didn't see anything mentioned in your source, I think you were
probably using "stdcall".

Hopefully your documentation will tell you how to ask for "cdecl".

Once you find this, could you please email me a short paragraph saying
in detail what to do with your compiler?  I'm putting together a web
page showing what's necessary in various cases.   My current
incomplete draft is visible here: 

 <http://www.stats.uwo.ca/faculty/murdoch/software/compilingDLLs>

Duncan Murdoch



More information about the R-help mailing list