无法获得有关用于x64的.o文件的信息:关于使用Rcpp进行R程序包检查的注意事项

问题描述

我正在使用Windows,并且刚刚更新为R 4.0.3(从RStudio1.3.959)并运行了R检查我的一个使用{{1}的软件包}和Rcpp,我得到以下注释:

RcppArmadillo

当我在> checking compiled code ... NOTE Note: information on .o files for i386 is not available Note: information on .o files for x64 is not available File 'C:/Users/NIR_Workstation/Documents/GitHub/prospectr.Rcheck/prospectr/libs/i386/prospectr.dll': Found 'abort',possibly from 'abort' (C),'runtime' (Fortran) Found 'exit',possibly from 'exit' (C),'stop' (Fortran) Found 'printf',possibly from 'printf' (C) File 'C:/Users/NIR_Workstation/Documents/GitHub/prospectr.Rcheck/prospectr/libs/x64/prospectr.dll': Found 'abort',possibly from 'printf' (C) 下运行检查时,不会输出此NOTE。 我试图找出包装中发生了什么,但没有成功。

我也尝试过此操作(使用R 4.0.2):

R 4.0.3

,我得到与包的输出相同的NOTE类型。同样,对于Rcpp::Rcpp.package.skeleton("aTest",example_code = TRUE) rcmdcheck::rcmdcheck(error_on = "warning",check_dir = "check") ,不会输出该注释。

关于此注释的任何想法吗?或至少对我可以尝试找出正在发生的事情的任何建议?

谢谢。


更新的问题

我想在更新问题之前进行其他测试。

这里是:

我在其他几台Windows计算机上重新安装了R 4.0.2 以及R 4.0.3rtoolsRStudio软件包 运行下面的示例(不存在预编译的对象)。我设法使用devtools来重现使用reprex()创建的另一个模板包得到的NOTE:

Rcpp.package.skeleton()

reprex package(v0.3.0)于2020-10-18创建

mdir <- "./my_dir"
dir.create(mdir)
setwd("./my_dir")
Rcpp::Rcpp.package.skeleton("anotherTest",example_code = TRUE)
#> Creating directories ...
#> Creating DESCRIPTION ...
#> Creating NAMESPACE ...
#> Creating Read-and-delete-me ...
#> Saving functions and data ...
#> Making help files ...
#> Done.
#> Further steps are described in './anotherTest/Read-and-delete-me'.
#> 
#> Adding Rcpp settings
#>  >> added Imports: Rcpp
#>  >> added LinkingTo: Rcpp
#>  >> added useDynLib directive to NAMESPACE
#>  >> added importFrom(Rcpp,evalCpp) directive to NAMESPACE
#>  >> added example src file using Rcpp attributes
#>  >> added Rd file for rcpp_hello_world
#>  >> compiled Rcpp attributes
devtools::check("./anotherTest")
#> -- Building ----------------------------------------------------- anotherTest --
#> Setting env vars:
#> * CFLAGS    : -Wall -pedantic
#> * CXXFLAGS  : -Wall -pedantic
#> * CXX11FLAGS: -Wall -pedantic
#> --------------------------------------------------------------------------------
#>          checking for file 'C:\Users\raml\AppData\Local\Temp\RtmpqMz20b\reprex4cd8438440a2\my_dir\anotherTest/DESCRIPTION' ...  v  checking for file 'C:\Users\raml\AppData\Local\Temp\RtmpqMz20b\reprex4cd8438440a2\my_dir\anotherTest/DESCRIPTION' (612ms)
#>       -  preparing 'anotherTest':
#>      checking DESCRIPTION Meta-information ...     checking DESCRIPTION Meta-information ...   v  checking DESCRIPTION Meta-information
#> -  cleaning src
#>       -  checking for LF line-endings in source and make files and shell scripts
#>       -  checking for empty or unneeded directories
#>       -  building 'anotherTest_1.0.tar.gz'
#>      
#> -- Checking ----------------------------------------------------- anotherTest --
#> Setting env vars:
#> * _R_CHECK_CRAN_INCOMING_REMOTE_: FALSE
#> * _R_CHECK_CRAN_INCOMING_       : FALSE
#> * _R_CHECK_FORCE_SUGGESTS_      : FALSE
#> * NOT_CRAN                      : true
#> -- R CMD check -----------------------------------------------------------------
#>       -  using log directory 'C:/Users/raml/AppData/Local/Temp/RtmpCM99SH/anotherTest.Rcheck' (453ms)
#> -  using R version 4.0.3 (2020-10-10)
#> -  using platform: x86_64-w64-mingw32 (64-bit)
#>   -  using session charset: ISO8859-1
#>       -  using options '--no-manual --as-cran'
#>      checking for file 'anotherTest/DESCRIPTION' ...     checking for file 'anotherTest/DESCRIPTION' ...   v  checking for file 'anotherTest/DESCRIPTION'
#> -  checking extension type ... Package
#> -  this is package 'anotherTest' version '1.0'
#>      checking package namespace information ...     checking package namespace information ...   v  checking package namespace information
#>    checking package dependencies ...     checking package dependencies ...   v  checking package dependencies (1.4s)
#>    checking if this is a source package ...  v  checking if this is a source package
#>   v  checking if there is a namespace
#>          checking for executable files ...     checking for executable files ...   v  checking for executable files (9.7s)
#>      checking for hidden files and directories ...  v  checking for hidden files and directories
#>      checking for portable file names ...     checking for portable file names ...   v  checking for portable file names
#>   v  checking serialization versions
#>      checking whether package 'anotherTest' can be installed ...     checking whether package 'anotherTest' can be installed ...   v  checking whether package 'anotherTest' can be installed (29.5s)
#>    checking installed package size ...     checking installed package size ...   v  checking installed package size
#>       v  checking package directory
#>      checking for future file timestamps ...     checking for future file timestamps ...   v  checking for future file timestamps
#>    checking DESCRIPTION Meta-information ...     checking DESCRIPTION Meta-information ...   v  checking DESCRIPTION Meta-information (689ms)
#> v  checking top-level files
#>   v  checking for left-over files
#> v  checking index information
#>    checking package subdirectories ...     checking package subdirectories ...   v  checking package subdirectories
#>    checking R files for non-ASCII characters ...     checking R files for non-ASCII characters ...   v  checking R files for non-ASCII characters
#>    checking R files for Syntax errors ...     checking R files for Syntax errors ...   v  checking R files for Syntax errors
#> -  loading checks for arch 'i386'
#>    checking whether the package can be loaded ...     checking whether the package can be loaded ...      ** checking whether the package can be loaded ... OK
#>    checking whether the package can be loaded with stated dependencies ...     checking whether the package can be loaded with stated dependencies ...      ** checking whether the package can be loaded with stated dependencies ... OK
#>      checking whether the package can be unloaded cleanly ...     checking whether the package can be unloaded cleanly ...      ** checking whether the package can be unloaded cleanly ... OK
#>    checking whether the namespace can be loaded with stated dependencies ...     checking whether the namespace can be loaded with stated dependencies ...      ** checking whether the namespace can be loaded with stated dependencies ... OK
#>    checking whether the namespace can be unloaded cleanly ...     checking whether the namespace can be unloaded cleanly ...      ** checking whether the namespace can be unloaded cleanly ... OK
#>      checking loading without being on the library search path ...     checking loading without being on the library search path ...      ** checking loading without being on the library search path ... OK
#> -  loading checks for arch 'x64'
#>    checking whether the package can be loaded ...     checking whether the package can be loaded ...      ** checking whether the package can be loaded ... OK
#>    checking whether the package can be loaded with stated dependencies ...     checking whether the package can be loaded with stated dependencies ...      ** checking whether the package can be loaded with stated dependencies ... OK
#>    checking whether the package can be unloaded cleanly ...     checking whether the package can be unloaded cleanly ...      ** checking whether the package can be unloaded cleanly ... OK
#>    checking whether the namespace can be loaded with stated dependencies ...     checking whether the namespace can be loaded with stated dependencies ...      ** checking whether the namespace can be loaded with stated dependencies ... OK
#>    checking whether the namespace can be unloaded cleanly ...     checking whether the namespace can be unloaded cleanly ...      ** checking whether the namespace can be unloaded cleanly ... OK
#>    checking loading without being on the library search path ...     checking loading without being on the library search path ...      ** checking loading without being on the library search path ... OK
#>    checking dependencies in R code ...     checking dependencies in R code ...   v  checking dependencies in R code (475ms)
#>    checking S3 generic/method consistency ...     checking S3 generic/method consistency ...   v  checking S3 generic/method consistency (959ms)
#>    checking replacement functions ...     checking replacement functions ...   v  checking replacement functions (568ms)
#>    checking foreign function calls ...     checking foreign function calls ...   v  checking foreign function calls (575ms)
#>    checking R code for possible problems ...     checking R code for possible problems ...   v  checking R code for possible problems (4s)
#>    checking Rd files ...     checking Rd files ...   v  checking Rd files (375ms)
#>    checking Rd Metadata ...     checking Rd Metadata ...   v  checking Rd Metadata
#>    checking Rd line widths ...     checking Rd line widths ...   v  checking Rd line widths
#>    checking Rd cross-references ...     checking Rd cross-references ...   v  checking Rd cross-references (364ms)
#>    checking for missing documentation entries ...     checking for missing documentation entries ...   v  checking for missing documentation entries (562ms)
#>    checking for code/documentation mismatches ...     checking for code/documentation mismatches ...   v  checking for code/documentation mismatches (1.8s)
#>    checking Rd \usage sections ...     checking Rd \usage sections ...   v  checking Rd \usage sections (1.3s)
#>    checking Rd contents ...     checking Rd contents ...   v  checking Rd contents
#>    checking for unstated dependencies in examples ...     checking for unstated dependencies in examples ...   v  checking for unstated dependencies in examples
#>    checking line endings in C/C++/Fortran sources/headers ...  v  checking line endings in C/C++/Fortran sources/headers
#>          checking pragmas in C/C++ headers and code ...     checking pragmas in C/C++ headers and code ...   v  checking pragmas in C/C++ headers and code
#> v  checking compilation flags used
#>    checking compiled code ...     checking compiled code ...   N  checking compiled code (27.9s)
#>    Note: information on .o files for i386 is not available
#>    Note: information on .o files for x64 is not available
#>    File 'C:/Users/raml/AppData/Local/Temp/RtmpCM99SH/anotherTest.Rcheck/anotherTest/libs/i386/anotherTest.dll':
#>      Found 'abort','runtime' (Fortran)
#>      Found 'exit','stop' (Fortran)
#>      Found 'printf',possibly from 'printf' (C)
#>    File 'C:/Users/raml/AppData/Local/Temp/RtmpCM99SH/anotherTest.Rcheck/anotherTest/libs/x64/anotherTest.dll':
#>      Found 'abort',possibly from 'printf' (C)
#>      
#>    Compiled code should not call entry points which might terminate R nor
#>    write to stdout/stderr instead of to the console,nor use Fortran I/O
#>    nor system RNGs. The detected symbols are linked into the code but
#>    might come from libraries and not actually be called.
#>    
#>    See 'Writing portable packages' in the 'Writing R Extensions' manual.
#>    checking examples ...  -  checking examples (360ms)
#>      running examples for arch 'i386' ...     running examples for arch 'i386' ...      ** running examples for arch 'i386' ... OK
#>      running examples for arch      running examples for arch 'x64' ...     running examples for arch 'x64' ...      ** running examples for arch 'x64' ... OK
#>       v  checking for non-standard things in the check directory
#> v  checking for detritus in the temp directory
#>      
#>    See
#>      'C:/Users/raml/AppData/Local/Temp/RtmpCM99SH/anotherTest.Rcheck/00check.log'
#>    for details.
#>    
#>      
#> 
#> -- R CMD check results ------------------------------------ anotherTest 1.0 ----
#> Duration: 1m 31.9s
#> 
#> > checking compiled code ... NOTE
#>   Note: information on .o files for i386 is not available
#>   Note: information on .o files for x64 is not available
#>   File 'C:/Users/raml/AppData/Local/Temp/RtmpCM99SH/anotherTest.Rcheck/anotherTest/libs/i386/anotherTest.dll':
#>     Found 'abort','runtime' (Fortran)
#>     Found 'exit','stop' (Fortran)
#>     Found 'printf',possibly from 'printf' (C)
#>   File 'C:/Users/raml/AppData/Local/Temp/RtmpCM99SH/anotherTest.Rcheck/anotherTest/libs/x64/anotherTest.dll':
#>     Found 'abort',possibly from 'printf' (C)
#>   
#>   Compiled code should not call entry points which might terminate R nor
#>   write to stdout/stderr instead of to the console,nor use Fortran I/O
#>   nor system RNGs. The detected symbols are linked into the code but
#>   might come from libraries and not actually be called.
#>   
#>   See 'Writing portable packages' in the 'Writing R Extensions' manual.
#> 
#> 0 errors v | 0 warnings v | 1 note x

除了上述测试外,我还用以下代码运行了相同的代码

  • devtools::session_info() #> - Session info --------------------------------------------------------------- #> setting value #> version R version 4.0.3 (2020-10-10) #> os Windows 7 x64 SP 1 #> system x86_64,mingw32 #> ui RTerm #> language (EN) #> collate German_Switzerland.1252 #> ctype German_Switzerland.1252 #> tz Europe/Berlin #> date 2020-10-18 #> #> - Packages ------------------------------------------------------------------- #> package * version date lib source #> assertthat 0.2.1 2019-03-21 [1] CRAN (R 4.0.3) #> backports 1.1.10 2020-09-15 [1] CRAN (R 4.0.3) #> callr 3.5.1 2020-10-13 [1] CRAN (R 4.0.3) #> cli 2.1.0 2020-10-12 [1] CRAN (R 4.0.3) #> Crayon 1.3.4 2017-09-16 [1] CRAN (R 4.0.3) #> desc 1.2.0 2018-05-01 [1] CRAN (R 4.0.3) #> devtools 2.3.2 2020-09-18 [1] CRAN (R 4.0.3) #> digest 0.6.26 2020-10-17 [1] CRAN (R 4.0.3) #> ellipsis 0.3.1 2020-05-15 [1] CRAN (R 4.0.3) #> evaluate 0.14 2019-05-28 [1] CRAN (R 4.0.3) #> fansi 0.4.1 2020-01-08 [1] CRAN (R 4.0.3) #> fs 1.5.0 2020-07-31 [1] CRAN (R 4.0.3) #> glue 1.4.2 2020-08-27 [1] CRAN (R 4.0.3) #> highr 0.8 2019-03-20 [1] CRAN (R 4.0.3) #> htmltools 0.5.0 2020-06-16 [1] CRAN (R 4.0.3) #> knitr 1.30 2020-09-22 [1] CRAN (R 4.0.3) #> magrittr 1.5 2014-11-22 [1] CRAN (R 4.0.3) #> memoise 1.1.0 2017-04-21 [1] CRAN (R 4.0.3) #> pkgbuild 1.1.0 2020-07-13 [1] CRAN (R 4.0.3) #> pkgload 1.1.0 2020-05-29 [1] CRAN (R 4.0.3) #> prettyunits 1.1.1 2020-01-24 [1] CRAN (R 4.0.3) #> processx 3.4.4 2020-09-03 [1] CRAN (R 4.0.3) #> ps 1.4.0 2020-10-07 [1] CRAN (R 4.0.3) #> R6 2.4.1 2019-11-12 [1] CRAN (R 4.0.3) #> rcmdcheck 1.3.3 2019-05-07 [1] CRAN (R 4.0.3) #> Rcpp 1.0.5 2020-07-06 [1] CRAN (R 4.0.3) #> remotes 2.2.0 2020-07-21 [1] CRAN (R 4.0.3) #> rlang 0.4.8 2020-10-08 [1] CRAN (R 4.0.3) #> rmarkdown 2.4 2020-09-30 [1] CRAN (R 4.0.3) #> rprojroot 1.3-2 2018-01-03 [1] CRAN (R 4.0.3) #> rstudioapi 0.11 2020-02-07 [1] CRAN (R 4.0.3) #> sessioninfo 1.1.1 2018-11-05 [1] CRAN (R 4.0.3) #> stringi 1.5.3 2020-09-09 [1] CRAN (R 4.0.3) #> stringr 1.4.0 2019-02-10 [1] CRAN (R 4.0.3) #> testthat 2.3.2 2020-03-02 [1] CRAN (R 4.0.3) #> usethis 1.6.3 2020-09-17 [1] CRAN (R 4.0.3) #> withr 2.3.0 2020-09-22 [1] CRAN (R 4.0.3) #> xfun 0.18 2020-09-29 [1] CRAN (R 4.0.3) #> xopen 1.0.0 2018-09-17 [1] CRAN (R 4.0.3) #> yaml 2.2.1 2020-02-01 [1] CRAN (R 4.0.3) #> #> [1] C:/Program Files/R/R-4.0.3/library R 4.0.3

  • rtools35R 4.0.2

  • 在Linux(rtools40)中
  • R 4.0.3

对于这三个测试,检查均顺利通过。

总而言之,只有x86_64-pc-linux-gnu (64-bit)R 4.0.3出现问题。这样对吗 假设问题来自rtools40?如果是这样,对 CRAN检查/提交?

谢谢

解决方法

在过去的几个月中,我有同样的问题。几个月前,我注意到Windows的R-devel出现了相同的问题(中止的误报等)。

此问题并非特定于Rcpp。对于仅包含Fortran或仅包含C或仅包含C ++的软件包,我可以重现NOTE。我在Windows命令提示符下使用Rtools40和PATH中的R 4.0.3运行R CMD。目前,该注释出现在Bioconductor 3.12中,用于检查数百个软件包,看似是否包含任何Fortran,C或C ++源代码的软件包。如前所述,“注”仅在Windows,R 4.0.3或更高版本以及Rtools40中出现。对于Linux或Mac下的相同软件包或R的较早版本,不会显示NOTE。

我两天前向CRAN提交了一个程序包,即使我在同一程序包上执行R CMD检查时看到了NOTE,CRAN也没有将NOTE视为问题。因此,我认为这不会导致您提交CRAN的问题。