在R上安装TDA包时出错

时间:2022-12-07 12:44:13

I'm trying install TDA package on R

我试着在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

and I got this error

我得到了这个误差

./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

Here's my sessionInfo

这是我的sessionInfo

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

The installation on my windows 7 was without any error

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

What should I do to fix this problem??

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

2 个解决方案

#1


1  

This worked for me on Fedora 23:

这在Fedora 23上对我很有效:

sudo yum install gmp-devel mpfr-devel

sudo yum安装gmp-devel mpfr-devel

#2


1  

I got around this issue on Ubuntu 16.04 with:

我在Ubuntu 16.04上绕过了这个问题:

sudo apt install libgmp3-dev libmpfr-dev

#1


1  

This worked for me on Fedora 23:

这在Fedora 23上对我很有效:

sudo yum install gmp-devel mpfr-devel

sudo yum安装gmp-devel mpfr-devel

#2


1  

I got around this issue on Ubuntu 16.04 with:

我在Ubuntu 16.04上绕过了这个问题:

sudo apt install libgmp3-dev libmpfr-dev