[R] Underscores and Fortran code

Duncan Murdoch
Fri, 12 Oct 2001 14:06:08 -0000

On Thu, 11 Oct 2001 16:48:12 -0400, you wrote in message
<15302.1420.571215.515265 at minke.stat.ufl.edu>:

>Any suggestions are welcome.  Am I missing anything?

A 5th suggestion:  you can change the R code.  In the Windows version
1.3.1, I get these results:

Just like you, an error with the real name:

 > .Fortran("dog_dog", as.double(x), as.double(y), as.double(z))
 Error in .Fortran("dog_dog", as.double(x), as.double(y),
as.double(z)) :
         C/Fortran function name not in load table

But add an extra underscore to the call and things are fine:

 > .Fortran("dog_dog_", as.double(x), as.double(y), as.double(z))
 [[1]]
 [1] 2

 [[2]]
 [1] 3

 [[3]]
 [1] 5

It seems like a fairly easy workaround to just append an extra
underscore to names when the compiler is doing this funny name
mangling.

Duncan Murdoch