[R] Re: packaging a package addon
Ross Boylan
ross at biostat.ucsf.edu
Thu Oct 30 04:13:11 CET 2003
I have some mixed results to report. I went ahead and built a package
with the dependency, my changed files, and a few headers. I left the
headers in the same directory as the C files.
My first attempt passed R CMD check, though there were no examples to
exercise the code. When I tried to run it, it couldn't find the C
routine. I had neglected to provide a .First.lib for my new library.
When I corrected that, R cmd check failed with
* checking generic/method consistency ... WARNING
Error in .loadPackageQuietly(package, lib.loc) :
Error in library(package, lib.loc = lib.loc, character.only = TRUE,
verbose = FALSE) :
.First.lib failed
Execution halted
* checking for assignment functions with final arg not named 'value' ...
WARNING
Error in .loadPackageQuietly(package, lib.loc) :
Error in library(package, lib.loc = lib.loc, character.only = TRUE,
verbose = FALSE) :
.First.lib failed
Execution halted
* checking Rd files ... OK
* checking for undocumented objects ... ERROR
Error in .loadPackageQuietly(package, lib.loc) :
Hoping this was only a problem for check because it didn't know how to
load dependencies, I tried running the resulting code in a regular R
session. My first discovery was that dependent libraries need to be
loaded by hand. After I did that, when I ran my code I got
> library("survival")
> library("survivalrds", lib.loc="/home/ross/src/survivalrds.Rcheck/")
Error in dyn.load(x, as.logical(local), as.logical(now)) :
unable to load shared library
"/home/ross/src/survivalrds.Rcheck/survivalrds/libs/survivalrds.so":
/home/ross/src/survivalrds.Rcheck/survivalrds/libs/survivalrds.so:
undefined symbol: cholesky2
Error in library("survivalrds", lib.loc =
"/home/ross/src/survivalrds.Rcheck/") :
.First.lib failed
cholesky2 is one of the entry points in survival referenced by
survivalrds. I tried adding an "external" to the declaration of
cholesky2 (I think it's redundant) and redoing everything; it didn't
help.
In short, I'm having some dynamic linkage problems. Any suggestions?
(I'm on a linux system with the gcc 3.3 toolchain, but obviously it
would be better to solve this portably).
--
Ross Boylan wk: (415) 502-4031
530 Parnassus Avenue (Library) rm 115-4 ross at biostat.ucsf.edu
Dept of Epidemiology and Biostatistics fax: (415) 476-9856
University of California, San Francisco
San Francisco, CA 94143-0840 hm: (415) 550-1062
More information about the R-help
mailing list