Rcpp::compileAttributes() Error

后端 未结 6 2176
遇见更好的自我
遇见更好的自我 2021-01-02 18:02

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

相关标签:
6条回答
  • 2021-01-02 18:40

    I got mine fixed by recreating the project in RStudio from GitHub in a fresh directory.

    I had the same problem; happened as I was working on a markdown file irrelevant to the package, but then all of sudden package would not build 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) 
    
    0 讨论(0)
  • 2021-01-02 18:40

    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 threw an error about the name, saying only letters and numbers were allowed. Rcpp::compileAttributes and even Rcpp::Rcpp.package.skeleton had not complained about the name. I tried with tools::package_native_routine_registration_skeleton(".", character_only = FALSE) to no avail.

    In any case, after creating a new package named "xxxPackage" all problems were solved.

    0 讨论(0)
  • 2021-01-02 18:41

    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.

    0 讨论(0)
  • 2021-01-02 18:45

    Try deleting RcppExports.cpp and RcppExports.o and then in build options go-to "more" -> "clean and rebuild" This usually does the trick when I have similar problems

    0 讨论(0)
  • 2021-01-02 18:53

    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.

    0 讨论(0)
  • 2021-01-02 18:59

    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.

    0 讨论(0)
提交回复
热议问题