[英]How does R check for system external dependencies when installing an R package?
例如,在嘗試安裝 R package curl
作為usethis
的依賴項時:
* installing *source* package ‘curl’ ...
** package ‘curl’ successfully unpacked and MD5 sums checked
Package libcurl was not found in the pkg-config search path.
Perhaps you should add the directory containing `libcurl.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libcurl' found
Package libcurl was not found in the pkg-config search path.
Perhaps you should add the directory containing `libcurl.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libcurl' found
Using PKG_CFLAGS=
Using PKG_LIBS=-lcurl
------------------------- ANTICONF ERROR ---------------------------
Configuration failed because libcurl was not found. Try installing:
* deb: libcurl4-openssl-dev (Debian, Ubuntu, etc)
* rpm: libcurl-devel (Fedora, CentOS, RHEL)
* csw: libcurl_dev (Solaris)
If libcurl is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a libcurl.pc file. If pkg-config
is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:
R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'
R 檢測到我沒有安裝 libcurl。 這個外部部門在什么級別。 指定的? 我知道可以在DESCRIPTION文件中指示外部依賴項,並且確實curl的pkgDESCRIPTION文件確實包含:
SystemRequirements: libcurl: libcurl-devel (rpm) or libcurl4-openssl-dev (deb).
但是這條線是什么讓 R 檢測到丟失的依賴項並打印該錯誤? 不可能吧? 怎么可能? 那么,R 是怎么做到的呢?
簡要地:
DESCRIPTION
中的SystemRequirements
進行近似brew
或apt
。 這很好,但它在 CRAN 源代碼級別也不起作用。configure
的可執行文件來測試資源是否存在,如果不存在則以明確的錯誤中止。configure
中的測試代碼在此處。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.