[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

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
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
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
# 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))
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)

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 = ""),
stop(paste("library section", section, "not attached"))
path <- path(search()[idr], "..", file, sep = "/")
if(exists(path, where = 0))
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