例如,在尝试将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=...'
Run Code Online (Sandbox Code Playgroud)
R检测到我没有安装libcurl。此外部部门处于什么级别。指定?我知道外部依赖项可以在DESCRIPTION文件中指出,并且curl的pkgDESCRIPTION文件确实包含:
SystemRequirements: libcurl: libcurl-devel (rpm) or libcurl4-openssl-dev (deb).
Run Code Online (Sandbox Code Playgroud)
但是那条线是什么允许R检测缺失的依赖关系并打印该错误?不能吧 怎么可能 那么,R怎么做呢?
简要地:
SystemRequirements在DESCRIPTIONbrew或apt。很好,但这在CRAN源代码级别也无效。configure以测试是否存在资源,如果没有,则中止并清除错误。configure此处。