[S] dynamic libraries on SGI

Steve Friedman (friedman@gis.umn.edu)
Mon, 09 Nov 1998 14:38:15 -0600


Splus folks:

Once again I need some help. I am trying to use Barry Rowlingson's
Splancs library. He originally wrote this for a Sun and it uses
dyn.load2. He is unfamilar with SGI enviroments, hence the note to
s-news. I am working on an SGI with Splus version 3.3 Release 1 for
IRIX 5.1.

I have modified two files, substituting dyn.load.shared for dyn.load2
(which is not part of
the SGI platform). Following compilation, I launch Splus to try the
functions in this library.

The following steps are taken:

> Splus
>library(splancs, first=T)
> x <- rnorm(200)
> y <- rnorm(200)

> khat(x,y)

Error in call to dyn.load.shared(): Argument syslibs= not matched
Dumped
>

As far as I tell the problem exists in the call to the unix system
library for
the math library via the function mathlib.dynam which sets several Splus
variables
required for the application. Can someone tell me how to get Splus to
recognize a system level library? We have checked to be certain that
the /usr/lib is included in the path definition on our system (this is
where
libm.a is located.

Greatful for the help
Steve Friedman
Dept. Forest Resources
University of Minnesota
St. Paul, MN
----------------------------------------------------------------------------------------

mathlib.dynam <- function(section, file)
{
# This file is modified. dyn.load2 was changed to dyn.load.shared (skf
11/10/98)
# version of library.dynam that uses dyn.load2 to include the
# unix math library libm.a
name <- paste(section, ".", file, sep = "")
if(exists(name, frame = 0))
return()
if(!exist("lib.loc", frame = 0))
assign("lib.loc", unix("echo $home/library"), frame = 0)
dyn.load.shared(paste(lib.loc, "/", section, "/", file, sep = ""),
syslibs = "-lm")
assign(name, 1, frame = 0)
}

library.dynam
function(section, file)
{
# this is not bullet proof, but this function is deprecated.
# assumes file is in an attached database whose name ends with
# section /.Data (could be ambiguous) and that section/.Data/../file
# will access the file (symbolic links could screw up the ..) (modified
skf 11/10/98)
# changed dyn.load2 to dyn.load.shared
idr <- max(grep(paste("\\/", section, "\\/.Data$" , sep = ""),
search()
))
if(is.na(idr))
stop(paste("library section", section, "not attached"))
path <- path(search()[idr], "..", file, sep = "/")
if(exists(path, where = 0))
return()
dyn.load.shared(path)
assign(path, 1, where = 0)
}

-----------------------------------------------------------------------
This message was distributed by s-news@wubios.wustl.edu. To unsubscribe
send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
message: unsubscribe s-news