The message is somewhat arcane. I looked around also in other packages and I found that the useDynLib(packagename)
in the NAMESPACE file was replaced by useDynLib(packagename, .registration = TRUE)
.
In addition, I added a .c
file, named registerDynamicSymbol
in the src/
directory with the following code:
// RegisteringDynamic Symbols
#include <R.h>
#include <Rinternals.h>
#include <R_ext/Rdynload.h>
void R_init_markovchain(DllInfo* info) {
R_registerRoutines(info, NULL, NULL, NULL, NULL);
R_useDynamicSymbols(info, TRUE);
}
I took this suggestion from GitHub Rcpp. The canonical reference is in Writing R Extensions
Also R Devel Mailinglist provided supplementary infos.
UPDATE
The most direct straightforward approach is:
- use the current R Development Version (that will eventually become 3.4)
- Run the
tools::package_native_routine_registration_skeleton(".")
and copy and paste the full output in a packagename_init.c
file to be put in src/
- update
NAMESPACE
, verifying that useDynLib(packagename, .registration = TRUE)
- If necessary, replace the
exportPattern
with export( list of object to be exported )
UPDATE 18th July
As noted by @Symbolix using the most recent version of R and RStudio's devtools the point 2. (init.c files) appears handled by either devtools (using RStudio check digit) or tools packages.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…