[R] dyn.load error with C file

Jason Sinnwell Sinnwell.Jason at mayo.edu
Thu Oct 9 16:52:09 CEST 2003


Re-sending this from 10/7.  Please help! I'm really clueless how to fix this:

System: Solaris 7,     Software: R_1.7.1 for unix

> R CMD INSTALL -l /Rdir/library haplo.stats_1.1.0.tar.gz

-works like a charm-- no syntax errors, etc


But problems are when I'm loading the library within R.
 
> library(haplo.stats, lib.loc="/people/biostat3/sinnwell/Rdir/library")
> Error in dyn.load(x, as.logical(local), as.logical(now)) : 
>         unable to load shared library 
> "/people/biostat3/sinnwell/Rdir/library/haplo.stats/libs/haplo.stats.so":
>   ld.so.1: /opt/tools/R/current-version/lib/R/bin/R.bin: fatal: relocation 
> error: file 
> /people/biostat3/sinnwell/Rdir/library/haplo.stats/libs/haplo.stats.so: symbol 
> errmsg: referenced symbol not found
> Error in library(haplo.stats, lib.loc = 
> "/people/biostat3/sinnwell/Rdir/library") : 
>         .First.lib failed

Within my package I have three C files, one of which I believe is causing the 
dynamic library error below.  
When I leave out this one C file when building the package, though remaining 
R-functions depend on it, the library loads beautifully.  We use all Calloc and 
Free for double-compatibility with S, so memory allocation is fine.  Is there 
some issue with C and R that I'm not aware of?


> FYI:  
> We have the whole haplo.stats package working in S, INCLUDING that C-file
> Also, zzz.R for haplo.stats package:
> 
> .First.lib <- function(lib, pkg) {
>    library.dynam("haplo.stats", pkg, lib)
> }

Has anyone dealt with anything similar to this?  I see some similar Fortran 
error messages...
 
Thank you for your help,
 
Jason 
 
-------------------------
Jason P. Sinnwell, M.S.
Mayo Clinic, Rochester
Health Sciences Research
Division of Biostatistics
507.284.3270




More information about the R-help mailing list