例如,在尝试安装R软件包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如何做到?
答案 0 :(得分:6)
简而言之:
SystemRequirements
中的DESCRIPTION
brew
或apt
。很好,但这在CRAN源代码级别上也不起作用。configure
的可执行文件进行 test ,如果没有,则中止并清除明显的错误。configure
is here。