Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing & Finding GMP under OSX

Tags:

c++

macos

around a few days I am troubling an issue when installing the SCIP suite. SCIP requests the GMP Library:

src/rational.h:32:10: fatal error: 'gmp.h' file not found
#include "gmp.h"

To this end, I tried to install gmp according to the following two ressources:

  • Installing GMP on MacOS X with Xcode I tried gmp-6.1.0 aswell as gmp-6.0.0a
  • http://macappstore.org/gmp/ I checked the link via brew link gmp

I aswell checked and adjusted the shell paths, but it unfortunately does not work, the same errors occur as described above.

Could some of you recommend me another way to solve my problem?

Kind Regards

like image 852
Value Driver Avatar asked Feb 12 '16 10:02

Value Driver


1 Answers

By the way, the easiest way to install gmp on a Mac is by using homebrew. You go to the homebrew website and copy the one-line installation script and paste it into Terminal. Then you can find any package you want like this:

brew search gmp

and install very simply with

brew install gmp

Anyway, back to your actual question... I suspect you have not set the Header search path correctly in Xcode.

First, you need to find where gmp.h is located, so do this in Terminal:

find /usr /opt -name "gmp.h"

I am guessing here that it is under /usr or /opt, but if you know you installed gmp elsewhere, replace /usr /opt with that place.

Sample Output

/usr/local/Cellar/gmp/include/gmp.h

That will tell you where it is located, then take the containing directory (i.e. the answer above MINUS the "gmp.h" bit at the end) and add it into Xcode Build Settings in the area marked in blue on the diagram. To get to the blue area, click first on the area marked in green, then yellow, then blue.

enter image description here

like image 65
Mark Setchell Avatar answered Oct 02 '22 19:10

Mark Setchell