Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Found no calls to: 'R_registerRoutines', 'R_useDynamicSymbols' unresolved

Tags:

r

rcpp

I've been strangling with an unresolved 'R_registerRoutines', 'R_useDynamicSymbols' note from R CMD check. I have read the relevant Section in the 'Writing R Extensions' and also checked various other posts online but the problem persists.

Summary of what I have done:

  1. I created the init.c file put in the src/ directory with the following content given in [1] below. This was done using tools::package_native_routine_registration_skeleton(".", "src/init.c", character_only = FALSE) (because with the default character_only = TRUE was not working).
  2. I checked if the same names appear in RcppExports.cpp in src/ and RcppExports.R in R/ given in [2] below.
  3. I have added useDynLib(JMbayes, .registration = TRUE) in the NAMESPACE.

Hence, any pointers would be welcome!

[1] init.c

[2] RcppExports.cpp

like image 501
Dimitris Rizopoulos Avatar asked Sep 15 '25 10:09

Dimitris Rizopoulos


1 Answers

Promoting my comment to an answer.

The reason for the error is due to an interaction between RStudio and devtools on a Windows machine. Thus, what you are encountering is a false positive on the Registration of Native Entry points. If you submit your package to be checked on either r-hub.io or winbuilder you should receive the appropriately response.

Furthermore, the Registration of Native Entry points provided by tools:: package_native_routine_registration_skeleton() is now done automatically in Rcpp as of 0.12.12. Thus, there is no need to supply your own src/init.c. However, to engage this autocreation behavior, you must delete the src/init.c file and re-run Rcpp::compileAttributes(). This will lead to RcppExports.cpp being generated with the native registration registered at the end of the file.

like image 144
coatless Avatar answered Sep 16 '25 23:09

coatless



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!