【问题标题】:pass configure arguments to install packages in R传递配置参数以在 R 中安装包
【发布时间】:2016-09-14 05:01:00
【问题描述】:

我正在尝试从 CRAN 存储库的 R 中安装一个软件包。我必须在 configure 阶段传递一个标志,但我无法在install.packages 中弄清楚如何做到这一点:

> install.packages("Rmpfr")

..........
checking mpfr.h usability... no
checking mpfr.h presence... no
checking for mpfr.h... no
configure: error: Header file mpfr.h not found;
**maybe use --with-mpfr-include=INCLUDE_PATH**

(注意:我在自定义位置安装了 MPFR,因为我不是 root)。

但是如何将带有参数的特定标志传递给Rinstall.package 命令? .eg " --with-mpfr-include=/path/to/mpfr/include "

基于install.packages 手册页,我已经尝试过:

install.packages("Rmpfr" , INSTALL_opts = "--with-mpfr-include=/path/to/mpfr/include")

install.packages("Rmpfr" , configure.args = "--with-mpfr-include=/path/to/mpfr/include")

install.packages("Rmpfr" , configure.vars = "--with-mpfr-include=/path/to/mpfr/include")

但它们都没有工作,出现同样的错误。

【问题讨论】:

  • “他们都没有工作”,你的意思是所有人都给出了完全相同的错误信息?我猜configure.args = 语法应该是正确的。您是否确认指定路径中存在头文件?
  • 是的,它们都给出了相同的错误信息。是的,头文件 mpfr.h 确实在提供的路径中。

标签: r install.packages


【解决方案1】:

我自己偶然发现了这个问题,试图将udunits2 安装为ggforce 的依赖项。 R devel 邮件列表中的This answer 在我的情况下有效:我需要将命名字符向量传递给configure.args,由包名称 键入。这应该适用于您的情况,然后:

install.packages("Rmpfr",
  configure.args = c(Rmpfr = "--with-mpfr-include=/path/to/mpfr/include"))

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-09-22
    • 2021-05-05
    • 1970-01-01
    • 1970-01-01
    • 2013-04-24
    • 1970-01-01
    • 2015-01-13
    相关资源
    最近更新 更多