Where to find "gmp.h"?

CMakefile

C Problem Overview


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?

C Solutions


Solution 1 - C

you need to install libgmp3-dev

depends on your linux

yum install  libgmp3-dev

apt-get install  libgmp3-dev

Solution 2 - C

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

brew install gmp

Solution 3 - C

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.

Solution 4 - C

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.

Solution 5 - C

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"

Solution 6 - C

For me this worked:-

apt-get install  libgmp3-dev   (Might vary in linux distro; this is for Ubuntu)
pip3 install gmpy --user

Solution 7 - C

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

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionSoftTimurView Question on Stackoverflow
Solution 1 - CVivek GoelView Answer on Stackoverflow
Solution 2 - CmpontilloView Answer on Stackoverflow
Solution 3 - CNishantView Answer on Stackoverflow
Solution 4 - CValentin MontmirailView Answer on Stackoverflow
Solution 5 - CJoachimView Answer on Stackoverflow
Solution 6 - Cuser10633032View Answer on Stackoverflow
Solution 7 - CJIGOD UNIVERSALView Answer on Stackoverflow