Martin Maechler
1998-Nov-18 18:28 UTC
[jar@oriole.er.usgs.gov: Re: [R] loading fortran with Redhat 5.1]
I can not answer this (message only to me).
Certainly, some of you do..
Martin
-------
Date: Wed, 18 Nov 1998 13:22:47 -0500 (EST)
From: "J. Andy Royle" <jar@oriole.er.usgs.gov>
To: Martin Maechler <maechler@stat.math.ethz.ch>
Subject: Re: [R] loading fortran with Redhat 5.1
In-Reply-To: <199811181812.TAA26068@sophie.ethz.ch>
Hi Martin,
The reason I was confused by this is because I used dyn.load
on varna.o from a Sun Ultra 10 (again compiled by g77 -c varna.f...
not gcc as I stated before....a typo). Observe to following
from my Ultra 10:
/space/jar/ked-> g77 -c varna.f
/space/jar/ked-> R
R : Copyright 1998, The R Development Core Team
Version 0.62.4 (October 24, 1998)
..
..
other startup info deleted
..
..
[Previously saved workspace restored]
> dyn.load("varna.o")
>
Thus, I figured I could do that in Linux. Can you comment?
On Wed, 18 Nov 1998, Martin Maechler wrote:
> >>>>> "J" == J Andy Royle
<jar@oriole.er.usgs.gov> writes:
>
> J> Hello Martin, Thanks for your help. This worked fine.. I
didn't
> J> know about the demo. I seem to recall that I was doing it the
Splus
> J> way when I ran R on my Ultra 10. Is this a new way of loading
> J> fortran code into R?
>
> No!
> The "R SHLIB" abbreviation is somewhat new, but you always had
to
> dyn.load(...shared.library...)
>
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel 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-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Thomas Lumley
1998-Nov-18 18:50 UTC
[jar@oriole.er.usgs.gov: Re: [R] loading fortran with Redhat 5.1]
On Wed, 18 Nov 1998, Martin Maechler wrote:> ------- > Date: Wed, 18 Nov 1998 13:22:47 -0500 (EST) > From: "J. Andy Royle" <jar@oriole.er.usgs.gov> > To: Martin Maechler <maechler@stat.math.ethz.ch> > Subject: Re: [R] loading fortran with Redhat 5.1 > In-Reply-To: <199811181812.TAA26068@sophie.ethz.ch> > > Hi Martin, > > The reason I was confused by this is because I used dyn.load > on varna.o from a Sun Ultra 10 (again compiled by g77 -c varna.f... > not gcc as I stated before....a typo). Observe to following > from my Ultra 10: >Yes, on Solaris 2.6 on an Ultra 10 the dynload demo also works this way. Either gcc -c or cc -c produces an object file that can be dyn.loaded and run correctly. It isn't portable. Most Unices distinguish between the output of cc and the shared object files produced by ld -the.appropriate.flags I don't know if it works when you need to call R functions from the compiled code, either. In any case, R SHLIB is the better solution. -thomas -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-devel 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-devel-request@stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Prof Brian D Ripley
1998-Nov-18 18:56 UTC
[jar@oriole.er.usgs.gov: Re: [R] loading fortran with Redhat 5.1]
On Wed, 18 Nov 1998, Martin Maechler wrote:> I can not answer this (message only to me). > Certainly, some of you do..Fluke, I think. If he had used g77 -c -fpic varna.f then I believe varna.o would be a valid shared library on Solaris. It is likely that varna.f is simple enough not to need any relocation when compiled. This certainly works for a single subprogram in the file, but is definitely not recommended. It is hard to tell if dlopen actually works, as it is used with the `lazy' flag in R. One day one tests something never tried before and it fails.... (Like the first time I actually hit some error-recording code.) Brian> From: "J. Andy Royle" <jar@oriole.er.usgs.gov> > To: Martin Maechler <maechler@stat.math.ethz.ch> > Subject: Re: [R] loading fortran with Redhat 5.1 > In-Reply-To: <199811181812.TAA26068@sophie.ethz.ch> > > Hi Martin, > > The reason I was confused by this is because I used dyn.load > on varna.o from a Sun Ultra 10 (again compiled by g77 -c varna.f... > not gcc as I stated before....a typo). Observe to following > from my Ultra 10: > > > /space/jar/ked-> g77 -c varna.f > /space/jar/ked-> R > > R : Copyright 1998, The R Development Core Team > Version 0.62.4 (October 24, 1998) > .. > .. > other startup info deleted > .. > .. > [Previously saved workspace restored] > > > dyn.load("varna.o") > > > > Thus, I figured I could do that in Linux. Can you comment? > > > On Wed, 18 Nov 1998, Martin Maechler wrote: > > > >>>>> "J" == J Andy Royle <jar@oriole.er.usgs.gov> writes: > > > > J> Hello Martin, Thanks for your help. This worked fine.. I didn't > > J> know about the demo. I seem to recall that I was doing it the Splus > > J> way when I ran R on my Ultra 10. Is this a new way of loading > > J> fortran code into R? > > > > No! > > The "R SHLIB" abbreviation is somewhat new, but you always had to > > dyn.load(...shared.library...) > > > > -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- > r-devel 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-devel-request@stat.math.ethz.ch > _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._ >-- 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 272860 (secr) Oxford OX1 3TG, UK Fax: +44 1865 272595 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-devel 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-devel-request@stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._