On Tue, 22 Aug 2000, Duncan Murdoch wrote:
> A colleague is using Watcom F77 version 11 in Windows NT, and wants to
> create DLLs callable from R. (He was previously able to do external
> calls from S-PLUS). Does anyone know what magic is necessary so that
> it uses the right calling convention? In a debugger, it appears it's
> using a register-based calling convention, no matter what we ask for,
> but we're probably asking in the wrong way.
If you've set it up for S-PLUS 4.x, the same calls work provided you avoid
characters (but then they don't work well with most Fortran compilers).
Indeed, the same DLLs usually work. You probably need to re-install
the compiler for NT stack-based calls if he used it with S-PLUS 3.x.
> By the way, is the calling convention used by R's .C and .Fortran
> documented in detail somewhere? I know .C uses cdecl, but what does
> .Fortran use?
cdecl (which isn't really true of Watcom C, BTW). It's in
readme.packages
for 1.1.1. You don't want to use .Fortran as I recall it, just .C.
All .Fortran does is to append an underscore and handle character
strings differently (and inappopriately for Watcom Fortran).
BTW, there's a lot more on this for R and S in `S Programming'. I
abandoned
writing this up for R when Watcom's owners abandoned the compiler last
summer.
--
Brian D. Ripley, ripley at stats.ox.ac.uk
Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel: +44 1865 272861 (self)
1 South Parks Road, +44 1865 272860 (secr)
Oxford OX1 3TG, UK Fax: +44 1865 272595
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at
stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._