[Bioc-devel] Register native routines

Martin Morgan martin.morgan at roswellpark.org
Tue Mar 15 14:09:30 CET 2016


Hi Aaron --

On 03/15/2016 08:40 AM, Aaron Taudt wrote:
> I am trying to register my native routines as recommended by BiocCheck. I
> followed the instructions in "Writing R Extensions" and have implemented
> the following code in "init.cpp". However, the routines are still not
> registered.
>
> #include <Rinternals.h>
> #include <R_ext/Rdynload.h>
> #include "R_interface.h"  // contains univariate_hmm, multivariate_hmm, etc.
>
> static const R_CMethodDef CEntries[]  = {
>      {"univariate_hmm", (DL_FUNC) &univariate_hmm, 24,
> (R_NativePrimitiveArgType[24]) {INTSXP, INTSXP, INTSXP, INTSXP, REALSXP,
> REALSXP, INTSXP, INTSXP, REALSXP, INTSXP, REALSXP, REALSXP, REALSXP,
> REALSXP, INTSXP, REALSXP, REALSXP, REALSXP, REALSXP, LGLSXP, INTSXP,
> INTSXP, INTSXP, INTSXP}},
>      {"multivariate_hmm", (DL_FUNC) &multivariate_hmm, 18,
> (R_NativePrimitiveArgType[18]) {REALSXP, INTSXP, INTSXP, INTSXP, INTSXP,
> INTSXP, INTSXP, REALSXP, INTSXP, REALSXP, REALSXP, REALSXP, REALSXP,
> REALSXP, LGLSXP, INTSXP, INTSXP, INTSXP}},
>      {"univariate_cleanup", (DL_FUNC) &univariate_cleanup, 0, NULL},
>      {"multivariate_cleanup", (DL_FUNC) &multivariate_cleanup, 1,
> (R_NativePrimitiveArgType[1]) {INTSXP}},
>      {NULL, NULL, 0, NULL}
> };
>
> void R_init_AneuFinder(DllInfo *dll)
> {
>      R_registerRoutines(dll, CEntries, NULL, NULL, NULL);
>      R_useDynamicSymbols(dll, FALSE);
> }
>
> My NAMESPACE contains
> useDynLib(AneuFinder, .registration = TRUE)
>
> I don't see what's missing here, because the routines are still not
> registered. I appreciate any help.

How do you know that they are not registered?

This is C code, but init.cpp is compiled by the C++ compiler; do you 
need extern "C" {} around the this code?

When I try to install the most recent version of your package on the 
tracker, my default setting has compiler option -O0 (in 
R.home("etc/Makeconf")) and the nan_expected symbol is missing from the 
shared object

** testing if installed package can be loaded
Bioconductor version 3.3 (BiocInstaller 1.21.3), ?biocLite for help
Error in dyn.load(file, DLLpath = DLLpath, ...) :
   unable to load shared object 
'/home/mtmorgan/R/x86_64-pc-linux-gnu-library/3.3/AneuFinder/libs/AneuFinder.so':
 
/home/mtmorgan/R/x86_64-pc-linux-gnu-library/3.3/AneuFinder/libs/AneuFinder.so: 
undefined symbol: nan_detected
Error: loading failed
Execution halted
ERROR: loading failed


Martin

>
> 	[[alternative HTML version deleted]]
>
> _______________________________________________
> Bioc-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/bioc-devel
>


This email message may contain legally privileged and/or confidential information.  If you are not the intended recipient(s), or the employee or agent responsible for the delivery of this message to the intended recipient(s), you are hereby notified that any disclosure, copying, distribution, or use of this email message is prohibited.  If you have received this message in error, please notify the sender immediately by e-mail and delete this email message from your computer. Thank you.



More information about the Bioc-devel mailing list