Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rcpp::compileAttributes() Error

Tags:

rcpp

I am trying to compile a small package that I've made. This package uses Rcpp and RcppArmadillo. Everything was working well until I updated my mac to Sierra (version 10.12.5). I have now the following error message when building the package from Rstudio (version 1.0.143):

Error in Rcpp::compileAttributes() : 
Evaluation error: no native symbols were extracted.
Calls: source ... withVisible -> eval -> eval -> <Anonymous> -> .Call
Execution halted

Any idea what this is and how it can be fixed?

Thank you very much!

like image 394
user304347 Avatar asked May 24 '17 00:05

user304347


3 Answers

Try

tools::package_native_routine_registration_skeleton(".", character_only = FALSE)

The unintuitive character_only = FALSE is necessary if you are not calling this for the first time.

I copied this answer from kbenoit at https://github.com/kbenoit/quanteda/issues/846. This worked for me when I had a similar problem.

like image 121
Rory Nolan Avatar answered Nov 09 '22 03:11

Rory Nolan


I have the same error after renaming the package.

After removing the compiled object files under src/ such as xxx.o and xxx.so, it works again.

like image 6
wush978 Avatar answered Nov 09 '22 05:11

wush978


In my case this happens when there is a problem with the NAMESPACE file, or when NAMESPACE is missing. There is a catch-22. Roxygen2 wont overwrite your NAMESPACE file, but if you delete it and run roxygen to generate the NAMESPACE file, compileAttributes is called, but hangs because the NAMESPACE file is missing.

like image 4
THK Avatar answered Nov 09 '22 05:11

THK