【发布时间】: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)。
但是如何将带有参数的特定标志传递给R 的install.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