简体   繁体   English

R CMD使用CUDA * .cu文件检查警告

[英]R CMD check warning with CUDA *.cu files

I'm building a tiny R package that uses Rcpp and CUDA. 我正在构建一个使用Rcpp和CUDA的小型R包 It's a learning exercise to help me build a bigger package to submit to Bioconductor. 这是一项学习练习,可帮助我构建更大的包装以提交给Bioconductor。 The package installs and runs just fine on the Linux machine I describe in this post . 该软件包可以在我在本文中描述的Linux机器上正常安装和运行。 However, when I run R CMD check on the tarball, I get a warning. 但是,当我在压缩包上运行R CMD check时,会收到警告。

$ R CMD check rcppcuda_0.0.tar.gz 
* using log directory ‘/home/landau/rcppcuda.Rcheck’
* using R version 3.2.0 (2015-04-16)
* using platform: x86_64-unknown-linux-gnu (64-bit)
* using session charset: UTF-8
* checking for file ‘rcppcuda/DESCRIPTION’ ... OK
* checking extension type ... Package
* this is package ‘rcppcuda’ version ‘0.0’
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... WARNING
Subdirectory ‘src’ contains:
  someCUDAcode.cu
These are unlikely file names for src files.
* checking if there is a namespace ... OK
* checking for executable files ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking whether package ‘rcppcuda’ can be installed ... OK
* checking installed package size ... OK
* checking package directory ... OK
* checking DESCRIPTION meta-information ... OK
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking R files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... OK
* checking whether the package can be loaded with stated dependencies ... OK
* checking whether the package can be unloaded cleanly ... OK
* checking whether the namespace can be loaded with stated dependencies ... OK
* checking whether the namespace can be unloaded cleanly ... OK
* checking loading without being on the library search path ... OK
* checking dependencies in R code ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... OK
* checking Rd files ... OK
* checking Rd metadata ... OK
* checking Rd cross-references ... OK
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... OK
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking line endings in C/C++/Fortran sources/headers ... OK
* checking line endings in Makefiles ... OK
* checking compilation flags in Makevars ... OK
* checking for GNU extensions in Makefiles ... OK
* checking for portable use of $(BLAS_LIBS) and $(LAPACK_LIBS) ... OK
* checking compiled code ... OK
* checking examples ... NONE
* checking PDF version of manual ... OK
* DONE

Status: 1 WARNING
See
  ‘/home/landau/rcppcuda.Rcheck/00check.log’
for details.

$

This warning, also present in the bigger package I'm building, prevents me from submitting to Bioconductor. 此警告(也出现在我正在构建的较大包装中)使我无法提交给Bioconductor。 Warnings in R CMD check automatically disqualify me. R CMD check警告会自动使我失去资格。 Sadly, nvcc requires a .cu extension on each CUDA file, so I can't rename *.cu to *.c or *.cpp . 可悲的是, nvcc在每个CUDA文件上都需要一个.cu扩展名,因此我无法将*.cu重命名为*.c*.cpp Does anyone know how to tell R that *.cu files are legitimate source files? 有谁知道如何告诉R *.cu文件是合法的源文件?

While the default behaviour of nvcc is to automatically deduce language from filename extension (so that CUDA code is expected to be contained in a .cu extension file), this is not a fixed requirement. 虽然nvcc的默认行为是从文件扩展名自动推断语言(以便CUDA代码应包含在.cu扩展名文件中),但这不是固定要求。 nvcc supports the -x flag to manually set language for a given compilation unit, so you could use pass -x cu to a source file containing CUDA code with a .cpp extension and the compilation will work correctly. nvcc支持使用-x标志来手动设置给定编译单元的语言,因此您可以将-x cu传递给包含扩展名为.cpp CUDA代码的源文件,并且编译将正常工作。

Whether this is advisable from a maintainability perspective is a decision you will have to make. 从可维护性的角度来看这是否明智,这是您必须做出的决定。 But it should solve your immediate problem. 但这应该可以解决您眼前的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM