[R] documentation is there to be read (was using DLLs with R)

Prof Brian D Ripley ripley at stats.ox.ac.uk
Sat Oct 14 22:44:20 CEST 2000

On Sat, 14 Oct 2000, Thomas Dick wrote:

> i tried to build a dll, that i want to use with R, so I wrote the Fortran Code
> and built the dll with MS Fortran Powerstation. In every subroutine I want to
> export I wrote a statement like this:
>        interface
> !ms$attributes dllexport :: abc
> !ms$attributes alias:'abc' :: abc
>        end interface
> abc is the name of the subroutine i want to export.
> Then i compiled the file using:
>   fl32 /LD test.f
> The Fortran Compiler didn't produce any error or warning and produced a file
> test.dll.
> In R I type
> dyn.load("test.dll")
> R didn't produce any error too, but when I type
> .Fortran("abc")
> R says "function name not in load table".
> Does anyone know what's going wrong or how to solve the problem?

Probably.  In short, it seems you haven't tried reading the documentation.  
So the solution is to either use the preferred compiler or to read the
documentation and figure out how to use yours.

I suggest you start with readme.packages in rw1011sp.zip and the section on
`Using other compilers and languages'.  There is one crucial point you have
overlooked, which is *not* to use .Fortran.  Simple, really, but while you
are practising your reading skills there is a lot more information on this
in the R distribution and even more in Venables & Ripley (2000) `S

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

More information about the R-help mailing list