Rcpp :: compileAttributes () error
I am trying to compile a small package that I have created. This package uses Rcpp and RcppArmadillo. Everything worked well until I updated my mac to Sierra (version 10.12.5). I got the following error when building a 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 can I fix it?
Many thanks!
source to share
Try
tools::package_native_routine_registration_skeleton(".", character_only = FALSE)
A non-intuitive value is character_only = FALSE
needed unless you are calling it 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.
source to share
In my case this happens when there is a problem with the NAMESPACE file or when the NAMESPACE is missing. There is catch-22. Roxygen2 will not overwrite your NAMESPACE file, but if you delete it and run roxygen to create the NAMESPACE file, compileAttributes is called but hangs because the NAMESPACE file is missing.
source to share
I fixed my problem by recreating the project in RStudio from GitHub in a new directory.
I have the same problem; happened when I was working on a non-package markdown file, but then the sudden package was not compiled with the same error:
> devtools::session_info()
Session info ----------------------------------------------------------------------------------------------------------------------
setting value
version R version 3.5.0 (2018-04-23)
system x86_64, mingw32
ui RStudio (1.1.453)
language (EN)
collate English_United States.1252
tz America/Los_Angeles
date 2018-06-05
Packages --------------------------------------------------------------------------------------------------------------------------
package * version date source
assertthat 0.2.0 2017-04-11 CRAN (R 3.5.0)
base * 3.5.0 2018-04-23 local
bindr 0.1.1 2018-03-13 CRAN (R 3.5.0)
bindrcpp 0.2.2 2018-03-29 CRAN (R 3.5.0)
colorspace 1.3-2 2016-12-14 CRAN (R 3.5.0)
compiler 3.5.0 2018-04-23 local
datasets * 3.5.0 2018-04-23 local
devtools 1.13.5 2018-02-18 CRAN (R 3.5.0)
digest 0.6.15 2018-01-28 CRAN (R 3.5.0)
dplyr 0.7.5 2018-05-19 CRAN (R 3.5.0)
epicR * 0.16.0 2018-06-06 local
ggplot2 2.2.1.9000 2018-05-28 Github (tidyverse/ggplot2@4299917)
ggthemes 3.5.0 2018-05-07 CRAN (R 3.5.0)
glue 1.2.0 2017-10-29 CRAN (R 3.5.0)
graphics * 3.5.0 2018-04-23 local
grDevices * 3.5.0 2018-04-23 local
grid 3.5.0 2018-04-23 local
gtable 0.2.0 2016-02-26 CRAN (R 3.5.0)
lazyeval 0.2.1 2017-10-29 CRAN (R 3.5.0)
magrittr 1.5 2014-11-22 CRAN (R 3.5.0)
memoise 1.1.0 2017-04-21 CRAN (R 3.5.0)
methods * 3.5.0 2018-04-23 local
munsell 0.4.3 2016-02-13 CRAN (R 3.5.0)
pillar 1.2.3 2018-05-25 CRAN (R 3.5.0)
pkgconfig 2.0.1 2017-03-21 CRAN (R 3.5.0)
plyr 1.8.4 2016-06-08 CRAN (R 3.5.0)
purrr 0.2.5 2018-05-29 CRAN (R 3.5.0)
R6 2.2.2 2017-06-17 CRAN (R 3.5.0)
Rcpp 0.12.17 2018-05-18 CRAN (R 3.5.0)
rlang 0.2.1 2018-05-30 CRAN (R 3.5.0)
scales 0.5.0 2017-08-24 CRAN (R 3.5.0)
stats * 3.5.0 2018-04-23 local
tibble 1.4.2 2018-01-22 CRAN (R 3.5.0)
tidyselect 0.2.4 2018-02-26 CRAN (R 3.5.0)
tools 3.5.0 2018-04-23 local
utils * 3.5.0 2018-04-23 local
withr 2.1.2 2018-03-15 CRAN (R 3.5.0)
yaml 2.1.19 2018-05-01 CRAN (R 3.5.0)
source to share
I don't know if this can help, but I had a similar problem because I named the package something like "xxx_package". I don't remember exactly what happened, I think I found out, because when I tried to create a new package with a similar name in Rstudio, it gave an error about the name, saying only letters and numbers are allowed. Rcpp::compileAttributes
and did Rcpp::Rcpp.package.skeleton
n't even complain about the name. I have tried with to tools::package_native_routine_registration_skeleton(".", character_only = FALSE)
no avail.
Anyway, after creating a new package named "xxxPackage" all problems were resolved.
source to share