在安装R软件包时,R如何检查系统外部依赖性?

rma*_*gno 3 r

例如,在尝试将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怎么做呢?

Dir*_*tel 6

简要地:

  1. 这一切都在编写R Extension中
  2. 总之,它不 R不帮助你。见下文。
  3. 可以声明CRAN(和BioConductor)程序包的依赖关系。
  4. 对于一切只能近似通过SystemRequirementsDESCRIPTION
  5. 这不是一个解决或解决的问题,一切都取决于所有操作系统
  6. 所以也没有其他语言。
  7. 可以得到的是“垂直”堆栈中的程序包管理器-说brewapt。很好,但这在CRAN源代码级别无效
  8. 因此,正如您所显示的,所有可以做的就是调用一种可执行文件,configure测试是否存在资源,如果没有,则中止并清除错误。
  9. 对于您显示的软件包,此处的测试代码在configure此处
  10. 也有一个不错的Windows版本