In R, using Ubuntu, try to install a lib depending on GMP C lib, it won't find GMP, but I have GMP installed

Posted on Oct 13, 2022

Question

I want to install the Rmpfr library of R, so I type within R:

install.packages("Rmpfr")

This package requires the GMP C library to be installed, which in Ubuntu can be installed typing on the terminal

sudo apt-get install libgmp-dev

So, after I try to install Rmpfr library in R, I receive an error message containing

configure: error: GNU MP not found, or not 4.1.4 or up, see http://gmplib.org

The problem is, I already have GNU MP installed, and its version is 5.1.2. So, something is wrong with me, maybe.

Any clues? :-) Thanks!

Answer

In my case it was solved by installation of libgmp3-dev

$ sudo apt-get update
$ sudo apt-get install libgmp3-dev