Skip to content
Back to formatted view

Raw Message

Message-ID: <Pine.LNX.4.44.0306181732170.989-100000@gannet.stats>
Date: 2003-06-18T16:37:05Z
From: Brian Ripley
Subject: dyn.load()  function problem help!
In-Reply-To: <Pine.A41.4.44.0306180902440.52254-100000@homer33.u.washington.edu>

On Wed, 18 Jun 2003, Thomas Lumley wrote:

> On Wed, 18 Jun 2003, Mu Yunming wrote:
> 
> > >
> > My source code is writen in fortran 90 and i complied the source code using
> > command f90. How do you think I should complie my source file and build the
> > shared library?
> >
> 
> You probably need to figure this out: R doesn't explicitly support F90 on
> any platform.
> 
> Two things are needed
> 1/  You have to be able to create a DLL that is properly linked to all the
> libraries it needs.  Your compiler documentation should tell you how to do
> this.

That's the main step.  Something like

f90 -G -o aaa.so aaa.f

might well do it (that's the Solaris syntax, BTW).

> 2/ The functions you call from R need to use the same calling conventions
> as the compilers used to compiler R.  Duncan Murdoch has information at
>  http://www.stats.uwo.ca/faculty/murdoch/software/compilingDLLs/
> that describes how to do this for various compilers. Even if your's isn't
> on the list this might still be helpful

That's for Windows: he did say `Unix', unspecified.

-- 
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 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595