[R] dyn.load error with C file
Prof Brian Ripley
ripley at stats.ox.ac.uk
Thu Oct 9 18:17:23 CEST 2003
On Thu, 9 Oct 2003, Jason Sinnwell wrote:
> Re-sending this from 10/7. Please help! I'm really clueless how to fix this:
Your code calls the C entry point errmsg, and that is not in the R binary.
So find out what library it is in and link against it. NB: it does not
show up on our Solaris 8 system at a quick look.
I think the error message is pretty explicit, so maybe you need to take
local advice about your C code.
>
> 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
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
>
>
--
Brian D. Ripley, ripley at 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 272866 (PA)
Oxford OX1 3TG, UK Fax: +44 1865 272595
More information about the R-help
mailing list