77

I am installing a library, and got this error message:

xxxx@ubuntu$ make
(cd num; make all)
make[1]: Entering directory `/home/xxxx/num'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/xxxx/num'
(cd itv; make all)
make[1]: Entering directory `/home/xxxx/itv'
gcc -Wcast-qual -Wswitch -Werror-implicit-function-declaration -Wall -Wextra -Wundef -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wno-unused -std=c99 -U__STRICT_ANSI__ -O3 -DNDEBUG -I../num -I../apron -I/usr/include -I/usr/include -DNUM_MPQ -c -o itvMPQ.o itv.c
In file included from itv.h:9:0,
             from itv.c:5:
../num/num.h:15:17: fatal error: gmp.h: No such file or directory
compilation terminated.
make[1]: *** [itvMPQ.o] Error 1
make[1]: Leaving directory `/home/xxxx/itv'
make: *** [c] Error 2

So the problem is that it can not find gmp.h, does anyone know where this file is located, and how to make it found by the installer? By the way, at the moment my Makefile points mainly to /usr and /usr/local...

Edit1: After installing libgmp3-dev as suggested, the current error message is ../num/num.h:16:18: fatal error: mpfr.h: No such file or directory, does anyone know which package it is about?

Edit2: I have installed MPFR by following this page, and that did help, now the error message is gmp_caml.c:17:33: fatal error: caml/camlidlruntime.h: No such file or directory, could anyone help?

Edit3: I have done apt-file search camlidlruntime, and it returns camlidl: /usr/lib/ocaml/caml/camlidlruntime.h, but there is no camlidlruntime.h in my folder /usr/lib/ocaml/caml/, how could I check if I have installed dev package of MPFR? and which package it is exactly about?

SoftTimur
  • 5,630
  • 38
  • 140
  • 292

7 Answers7

117

you need to install libgmp3-dev

depends on your linux

yum install  libgmp3-dev

apt-get install  libgmp3-dev
Vivek Goel
  • 22,942
  • 29
  • 114
  • 186
  • Thanks for your reply... that did help... now error is `../num/num.h:16:18: fatal error: mpfr.h: No such file or directory`, so do you know which package it is about? – SoftTimur Sep 08 '11 at 16:49
  • 2
    please make sure you have all required libs. you need to install GNU MPFR according to error . – Vivek Goel Sep 08 '11 at 16:51
  • Sure... do you have any idea about the last question i added? – SoftTimur Sep 08 '11 at 17:30
  • install dev package of MPFR . you can use yum or apt-get to find correct package name. – Vivek Goel Sep 08 '11 at 17:33
  • to compile you will need dev package. user apt search if it shows dev then it is dev package otherwise not – Vivek Goel Sep 08 '11 at 18:05
  • I have done `apt-file search camlidlruntime`, but it does not show which package is about... – SoftTimur Sep 08 '11 at 18:11
  • 1
    if you put some time on googling using file name you will find package name for your file. – Vivek Goel Sep 08 '11 at 18:14
  • i tried yum install libgmp3-dev but i have the message "You need to be root to perform this command".I am trying this from root but i am not sure if i have permission to do this..Any idea? – Dchris Jun 14 '13 at 14:43
  • @VivekGoel I got the message "dchris04 is not in the sudoers file. This incident will be reported. " where dchris04 is my username.Also,i am not sure if i have password as a root user because i work on my university labs' computers. – Dchris Jun 15 '13 at 12:11
  • @Dchris then there are two choice ask lab admin to install it or manually compile and build it. – Vivek Goel Jun 15 '13 at 18:11
  • 4
    In Centos 6.5 it is : sudo yum install gmp gmp-devel gmp-status . Just search for the gmp in yum . – Nishant Dec 09 '13 at 10:04
  • 1
    @thedayturns Thanks for testifying. I added this as an answer. – Nishant Mar 22 '16 at 03:47
21

On OS X (if you're using Homebrew), do this:

brew install gmp
mpontillo
  • 13,559
  • 7
  • 62
  • 90
13

In Centos 6.5 it is sudo yum install gmp gmp-devel gmp-status.

ProTip: Just search for the gmp in yum and also check out yum provides command.

Nishant
  • 20,354
  • 18
  • 69
  • 101
  • 1
    should read sudo yum install gmp gmp-devel gmp-static not gmp-status worked for me after this and was able to compile on Centos 7, thanks! – Peter Edwards Mar 13 '19 at 14:41
6

For me this worked:-

apt-get install  libgmp3-dev   (Might vary in linux distro; this is for Ubuntu)
pip3 install gmpy --user
slfan
  • 8,950
  • 115
  • 65
  • 78
  • Yup, this was the missing one for me on Debian. I had installed libgmp-dev, and it had not helped... – Ecuador Nov 06 '21 at 09:55
3

Because it can happen that you need this library in 32 bit format for any particular reason (like it was for me)

You will need to run (on an Ubuntu/Debian) :

apt-get install  libgmp3-dev:i386

the suffix :i386 behind any library will install the 32 bits version of it.

mtk
  • 13,221
  • 16
  • 72
  • 112
Valentin Montmirail
  • 2,594
  • 1
  • 25
  • 53
3

I did a lot of research and finally I could compile hue with the following environment variables:

    export CPFLAGS="-I/usr/local/include/gmp.h -I/usr/local/opt/openssl/include"
    export CFLAGS="-I/usr/local/include/gmp.h"
    export CXXFLAGS="-I/usr/local/include/gmp.h"
    export LDFLAGS="-L/usr/local/lib -L/usr/local/opt/openssl/lib"

    export PKG_CONFIG_PATH="/usr/local/opt/openssl/lib/pkgconfig"
Joachim
  • 31
  • 1
1

This may sound kind of dumb: whenever I got an error , I just did : sudo apt-get install lib<name_of_library_not_found>-dev and it somehow solved the problem. Don't Know how, something to do with developer libraries or something