Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error when installing TDA package on R

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??

like image 571
Chu Avatar asked Jan 24 '26 17:01

Chu


1 Answers

I got around this issue on Ubuntu 16.04 with:

sudo apt install libgmp3-dev libmpfr-dev
like image 140
adamconkey Avatar answered Jan 26 '26 08:01

adamconkey



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!