[英]Can an official CRAN R package depend on Intel MKL and CMake? (and Check ?)
In my R package I have C code that uses Intel MKL (and an open source library for C unit testing ). 我使用CMake来构建 C 代码。 我还有Rcpp接口代码,用于从 R 调用 C 代码。
我想知道CRAN是否会接受这个 package ,因为您必须在系统上安装英特尔 MKL 和 CMake 才能正常工作?
我不太担心单元测试,我总是可以摆脱它,但我绝对需要英特尔 MKL,因为我使用的是特定于 MKL 的线性代数例程,例如稀疏矩阵密集矩阵乘法等。
The reason I need CMake is because currently, that's what I'm using to build a static library from the C code and manipulate the Makevars
file in the package's src
folder, so that I can link the Rcpp interface code against the C library.
我的Makevars
如下所示:
PKG_CPPFLAGS=-I/usr/local/lib/R/site-library/Rcpp/include -I/opt/intel/compilers_and_libraries_2019.4.243/linux/mkl/include -I./C
PKG_LIBS=-L./C/cmake-build-release -lbcd -llog -Wl,--start-group /opt/intel/compilers_and_libraries_2019.4.243/linux/mkl/lib/intel64/libmkl_intel_ilp64.a /opt/intel/compilers_and_libraries_2019.4.243/linux/mkl/lib/intel64/libmkl_sequential.a /opt/intel/compilers_and_libraries_2019.4.243/linux/mkl/lib/intel64/libmkl_core.a -Wl,--end-group -lpthread -lm -ldl
这适用于 Ubuntu,但我担心 OS X,尤其是 Windows。 例如, 这里有人声称 Intel MKL 与minGW
不兼容。
我知道有许多使用 MKL 或 CMake 的 CRAN 包。 但是对于我研究过的那些,MKL 用作可选的 BLAS 库,CMake 用于构建inst
文件夹下的内容,它不依赖于外部库。 我看过编写 R 扩展以及CRAN 提交页面,但找不到答案。 我认为,由于越来越多的人对使用 CMake 和 MKL 和 R 感兴趣,所以有一个 SO 帖子会很好。
看来你是从错误的一端把它绑起来的。
您创建了一个更狭窄、更专业的解决方案(MKL、CMake)。
现在你担心它可能太专业了。 你走在正确的道路上。 首先,CMake被其他包使用,因此您可以将其声明为SystemRequirements:
。 其次,MKL 更强大,但……也真正专业化。
我认为更广泛的 CRAN 上传的一般建议是
一旦你点击了这两个,你就可以进行 CRAN 上传了。 如果这一切看起来很繁琐,只需坚持使用 GitHub 存储库或drat存储库即可。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.