R-beta: installing new packages in window95 version of R
Thomas Lumley
thomas at biostat.washington.edu
Mon Nov 17 17:34:10 CET 1997
On Sun, 16 Nov 1997, Kung-Sik Chan wrote:
> I have tried to install the leaps package in the window95 version of R.
> I used Microsoft Fortran powerstation to generate
> the .dll file of the fortran programs in the src dorectory
> of the leaps package and put it under the lib directory of RSept. Then
> I stored the leaps.R under the library directory of RSept, with two
> additional commands in leaps.R (the .R extension was dropped):
> library.dynam("leaps.dll")^M
> provide(leaps)^M
> When I invoked the leaps library, the R functions in the file
> can be printed out. However, when I ran the function, say, leaps(...),
> I got the error message something like the fortran function "makeqr" is not
> in the load table.
As Robert said, the most likely problem is with marking functions for
export. The FORTRAN version of leaps does not use any internal R functions
(the C function may use pow_ii -- I can't remember), so that won't be a
problem. You can use is.loaded() to see if a C/Fortran function is in the
load table, which is simpler than trying to call the function.
If you find out how to mark functions for export from a DLL and it still
doesn't work then another possibility is that Powerstation uses different
name mangling from what R expects (eg an underscore before or after the
function name). The symbol.F() function will tell you what R thinks the
name should be, and if you build a small, simple DLL and look at it with a
text editor you will find what the DLL thinks the function name is.
Probably there's a better solution than using a text editor but I'm not up
on Windows programming.
Thomas Lumley
------------------------------------------------------+-----
Biostatistics : "Never attribute to malice what :
Uni of Washington : can be adequately explained by :
Box 357232 : incompetence" - Hanlon's Razor :
Seattle WA 98195-7232 : :
------------------------------------------------------------
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=---
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