2016-07-28 60 views
3

我想R上錯誤,當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 

安裝TDA包安裝TDA包,我得到這個錯誤

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

這裏是我的sessionInfo

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

安裝在我的Windows 7沒有任何錯誤

我該怎麼做才能解決這個問題?

+0

是'gmp'安裝? 'sudo yum install gmp' – Vedda

+0

是的,它的安裝。 gmp-6.0.0-12.e17_1.x86_64已安裝並且最新版本 – Chu

+0

'gmp-devel'? – Vedda

回答

1

這爲我工作在Fedora 23:

sudo yum install gmp-devel mpfr-devel

+0

剛剛完成這幾分鐘前。安裝mpfr-devel之後,可以完成安裝。感謝你的回答!! – Chu

+0

@Xiadan很高興現在正在工作。 – Vedda

1

我得到了解決此問題在Ubuntu 16.04有:

sudo apt install libgmp3-dev libmpfr-dev