Error when installing TDA package on R

匆匆过客 提交于 2020-01-14 13:41:32

问题


I'm trying install TDA package on R

> 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

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

What should I do to fix this problem??


回答1:


This worked for me on Fedora 23:

sudo yum install gmp-devel mpfr-devel




回答2:


I got around this issue on Ubuntu 16.04 with:

sudo apt install libgmp3-dev libmpfr-dev


来源:https://stackoverflow.com/questions/38628766/error-when-installing-tda-package-on-r

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!