Closed mbjones closed 6 years ago
More details in Writing R Extensions.
Generated a skeleton init file and checked it into branch feature-register-methods, but still need to successfully compile and test on multiple platforms:
@mbjones this problem was addressed in commit 47879483432139222e9f03db184741595d8b0bdc. The solution in this commit was a bit different than the one in the feature branch, and involves updating the SWIG input file so that the generated 'redland.c' file includes the necessary source lines. This fix has been tested on R 3.5 for ubuntu, macos, windows.
This hasn't been tested on R 3.4, which I will do.
OK, let's just be sure the SWIG generated version produces everything that comes out of tools::package_native_routine_registration_skeleton(".")
I updated src/redland.c
to include everything that the tools::package_native_routine_registration_skeleton(".")
version does. After considerable searching through SWIG docs and source, it's not apparent how to include
{"isnull", (DL_FUNC) &isnull, 1},
in the block
SWIGINTERN R_CallMethodDef CallEntries[] = {
...
}
by adding directives, etc. to Redland.i
, so I had to manually edit src/redland.c
, which is not ideal, as these changes will be overwritten/omitted the next time a developer runs 'swig.sh' or make all
in the redland-bindings/.R
directory. If anyone knows an alternative approach, please let me know.
Updated in commit 4177381cb8747e002efafaac2009661b7e53beaf
R now checks that native routines are registered (see https://github.com/RcppCore/Rcpp/issues/636#issuecomment-280985661 for an overview). The NOTE we get on the CRAN package page is:
Add a skeleton init method to fix this. To seed this file, run
tools::package_native_routine_registration_skeleton(".")
which will produce the code needed to register the routines.