10

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:

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

Roger Lipscombe
  • 89,048
  • 55
  • 235
  • 380
Value Driver
  • 137
  • 1
  • 2
  • 8

2 Answers2

21

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

Mark Setchell
  • 191,897
  • 31
  • 273
  • 432
0

After following the answer from @Mark Setchell I hit lots of Undefined symbols for architecture x86_64: for every gmp API I had inside my C code.

To fix the error, I added a Linker flag inside my xCode project.

enter image description here

rustyMagnet
  • 3,479
  • 1
  • 31
  • 41