[英]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.