object 'Cdqrls' not found when building R packages using devtools -
i got error title shows
error: object 'cdqrls' not found
i use devtools
building r packages, , 1 function in current package, used
.call(cdqrls, x[, id1, drop=false] * w, w * z, epsilon)
and includes lm.c
file in src
folder, includes:
... sexp cdqrls(sexp x, sexp y, sexp tol) { sexp ans, ansnames; sexp qr, coefficients, residuals, effects, pivot, qraux; int n, ny = 0, p, rank, nprotect = 4, pivoted = 0; double rtol = asreal(tol), *work; ...
directly copied r source files. when used load_all()
in devtools
, compiles shared objects in src/ (i checked works well) new files: lm.o
, mypkgname.so
. however, wiki of devtools
, found that
load_all ignores package namespace
if working properly, think running functions, able update namespace
file contain usedynlib(mypkgname, cdqrls)
. correct? think in way error may disappear... suggestions appreciated!
update
according @mnel , this post, seems using @usedynlib
should work. however, function used .call()
not documented, , there several functions used .call
not wanna document them they're not used end-users. thus, shall put @usedynlib
?
the answer use @usedynlib pkgname routine1 routine2
using roxygen2, once running document()
function in devtools
namespace file contain usedynlib(pkgname,routine1,routine2)
, work perfectly.
Comments
Post a Comment