例如,在尝试将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怎么做呢?
简要地:
这一切都在编写R Extension中。
总之,它不即 R不帮助你。见下文。
可以声明CRAN(和BioConductor)程序包的依赖关系。
对于一切只能近似通过SystemRequirements
在DESCRIPTION
这不是一个解决或解决的问题,一切都取决于跨所有操作系统
所以也没有其他语言。
可以得到的是“垂直”堆栈中的程序包管理器-说brew
或apt
。很好,但这在CRAN源代码级别也无效。
因此,正如您所显示的,所有可以做的就是调用一种可执行文件,configure
以测试是否存在资源,如果没有,则中止并清除错误。
对于您显示的软件包,此处的测试代码在configure
此处。
也有一个不错的Windows版本。