Search code examples
macosbuildconfiguregmpglpk

configure: error: gmp.h header not found when building glpk


When trying to build glpk-4.61 on Mac OS X with

./configure --with-gmp

I get the following error message:

checking gmp.h usability... no checking gmp.h presence... no checking for gmp.h... no configure: error: gmp.h header not found

There were no issues installing GMP, and the header file gmp.h is present in /usr/local/include as expected.


Solution

  • config.log told me no more than I already knew, that gcc can't find gmp.h (when trying to preprocess conftest.c). However, one can check which include paths are used by the c preprocessor with cpp -v, and it turned out that Xcode had made a mess of them. The solution was to run xcode-select --install, which added the usual include paths back.