Skip to content

Fortran interface

3 messages · Cheolyong Park, Brian Ripley, Duncan Murdoch

#
Hello!

I have some difficulty in interfacing with Fortran.

I made the dll file of fortran subroutine named "avg" and its symbol
name is "_avg at 12".
I successfully loaded the dll file via dyn.load ( is.loaded("_avg at 12").)
was TRUE).
The problem is that nether .Fortran("_avg at 12", ... ) nor .Fortran("avg",
...) could call the subroutine avg.
My understanding is that the first argument of .Fortran is the
subroutine name not the symbol name.
Is there any way to use the symbol name directly in .Fortran function?

Please give me a clue!

Cheolyong Park.
#
This is Windows (unstated)!

It will not work anyway: the symbol is "_avg", and symbol.For does that
mapping for you.  However, the @12 is a linker instruction saying this is 
stdcall and not cdecl.

The recommended compiler etc does not do this.  Please either use it or at 
least read the documentation (in readme.packages).  We do not support
stdcall, nor do we offer support for other compiler systems.  But you 
should be able to produce cdecl linking from a Fortran Windows compiler.
On Tue, 15 Apr 2003, Cheolyong Park wrote:

            

  
    
#
On Tue, 15 Apr 2003 10:07:59 +0100 (BST), you wrote:

            
We don't support other compiler systems, but I'm putting together a
collection of user-submitted instructions about them.  It's in the
early stages, but you might find something useful there.  If not,
please submit instructions for your compiler once you work them out.

The current URL is
<http://www.stats.uwo.ca/faculty/murdoch/software/compilingDLLs>

Duncan Murdoch