【问题标题】:Error when installing TDA package on R在 R 上安装 TDA 包时出错
【发布时间】:2016-12-02 09:31:54
【问题描述】:

我正在尝试在 R 上安装 TDA 包

> install.packages("TDA")
Installing package into ‘/home/more/R/x86_64-redhat-linux-gnu-library/3.3’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/src/contrib/TDA_1.5.tar.gz'
Content type 'unknown' length 2006514 bytes (1.9 MB)
==================================================
downloaded 1.9 MB

我收到了这个错误

./gmpxx.h:41:17: fatal error: gmp.h: No such file or directory
 #include <gmp.h>
           ^
compilation terminated.
make: *** [diag.o] Error 1
ERROR: compilation failed for package ‘TDA’
* removing ‘/home/more/R/x86_64-redhat-linux-gnu-library/3.3/TDA’
Warning in install.packages :
  installation of package ‘TDA’ had non-zero exit status

这是我的会话信息

R version 3.3.0 (2016-05-03)
platform: x86_64-redhat-linux-gnu (64-bit)
Running under: CentOS Linux 7 (Core)

在我的 windows 7 上安装没有任何错误

我应该怎么做才能解决这个问题??

【问题讨论】:

  • 是否安装了gmpsudo yum install gmp
  • 是的,它已安装。 gmp-6.0.0-12.e17_1.x86_64 已安装且最新版本
  • gmp-devel 呢?
  • 刚刚安装。现在安装过程又出现了一个错误。 #include ^ 编译终止。
  • OK,安装完mpfr-devel就可以安装了。非常感谢!!

标签: r compiler-errors package installation


【解决方案1】:

我在 Ubuntu 16.04 上解决了这个问题:

sudo apt install libgmp3-dev libmpfr-dev

【讨论】:

    【解决方案2】:

    这在 Fedora 23 上对我有用:

    sudo yum install gmp-devel mpfr-devel

    【讨论】:

    • 几分钟前刚刚完成。安装完 mpfr-devel 就可以安装了。谢谢你的回答!!
    猜你喜欢
    • 2018-01-20
    • 2019-06-17
    • 1970-01-01
    • 2022-09-30
    • 1970-01-01
    • 2012-09-04
    • 1970-01-01
    相关资源
    最近更新 更多