Re: [R] R shared object with Fortran archive files

From: Prof Brian Ripley <ripley_at_stats.ox.ac.uk>
Date: Tue 16 May 2006 - 01:48:42 EST

On Mon, 15 May 2006, Theo Bell wrote:

> Hi,
>
> I am trying to create an R shared object using the R CMD SHLIB
> command. I have some .o object files and some .a archive files (for
> which I do not have the source code).
>
> R does not seem to include the code that is in the .a files, as when I
> use nm on the resulting shared library, there are lots of undefined
> symbols and dyn.load complains of undefined symbols. I have checked
> the .a archives and the symbols are defined there.
>
> Basically, I want to know if it is possible to include Fortran .a
> archive files as objects to be included in an R shared library. And if
> so, how?

Well, not as objects but as an archive. Try

export PKG_LIBS=-L/path/to/archive -lmyar.a

or similar.

-- 
Brian D. Ripley,                  ripley@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

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Received on Tue May 16 01:54:27 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Tue 16 May 2006 - 02:10:07 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.