[R] The old Fortran underscore problem

Prof Brian Ripley ripley at stats.ox.ac.uk
Wed Jun 6 18:39:47 CEST 2001


On Wed, 6 Jun 2001, Frank E Harrell Jr wrote:

> I have dealt with this on so many platforms in
> the past that I should know the answer by now.
> I looked in V&R S Programming, R manuals and FAQ
> and still can't find the answer.

It's in Writing R Extensions, and the answer is the same as in S,
`S Programming' page 138.

> In the Hmisc library I used the R scripts to build
> the package, which creates Hmisc.so.  I have
> library.dynam('Hmisc', ...) in the .First.lib.
> When doing library(Hmisc) I get
>   Error in dyn.load .... undefined symbol rank_
> Note that I do not call dyn.load myself.
> The Hmisc library has a Fortran module named
> rcorr.f which issues CALL rank(....).
>
> rank is an entry point in a C source file ranksort.c,
> declared using "void rank(. .. .)".
> All source files seemed to compile fine.
> How do I call the C rank entry from Fortran using
> Hmisc.so?

You need void F77_SUB(rank)(...)

> A second problem is that in the Design library I
> have Fortran code such as
>
>   CALL dqrsl1(.....)
>
> When doing library(Design) I get an unknown symbol
> dqrsl1_.  I know that R base has LINPACK routines such
> as dqrsl1.

Not that one.  It has dqrsl only. See src/include/R_ext/Linpack.h

-- 
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