Skip to content
Prev 18237 / 398513 Next

How to detach binary objects/libraries?

On Mon, 2002-03-25 at 13:46, ripley at stats.ox.ac.uk wrote:
Thank you, Prof. Ripley!

Adding .Last.lib solved the segmentantion fault problem. On the other
hand, it created the following puzzle. Transcript follows:
Loading required package: mva
[1] TRUE
[1] FALSE
[1] FALSE
Error in .C("exp_dist_fast", ...),  : 
	C/Fortran function name not in load table
Error in dyn.unload(x) : dynamic/shared library
"/opt/lib/R/library/X/libs/X.so" was not loaded

X's zzz.R follows:

.First.lib <- function( lib, pkg )
  library.dynam( "X", pkg, lib )

.Last.lib <- function( libpath )
  dyn.unload(
             file.path( libpath,
                       "libs",
                       paste( "X", .Platform$"dynlib.ext", sep = "" )
                       )
             )

Is the solution just to change library.dynam with dyn.load( file.path(
..))?
It's probably quite wrong, but I was hoping that it will work much the
same way as in sourcing the original not-yet-in-a-package R file that
dynamically loads X.so. In Linux it reloads X.so without a problem.
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help 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-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._