go-glpk icon indicating copy to clipboard operation
go-glpk copied to clipboard

fatal error: glpk.h: No such file or directory #include <glpk.h>

Open jagrati16 opened this issue 8 years ago • 3 comments

Can't figure out a solution.

jagrati16 avatar Nov 28 '16 07:11 jagrati16

You have to first install GLPK. For example under Debian the package is named libglpk-dev. It may have a different name on your system.

lukpank avatar Dec 02 '16 09:12 lukpank

I'm also getting the same error while installing the glpk for my python. Below is the exact error that I face.

In file included from src/glpk.c:21: src/lp.h:24:10: fatal error: 'glpk.h' file not found #include "glpk.h" ^ 1 error generated. error: command '/usr/bin/clang' failed with exit status 1

Manish-rai21bit avatar Aug 21 '17 10:08 Manish-rai21bit

Manish,

First of all, what you're describing is a problem with an unrelated project to go-glpk. You would probably get more help posting this on the page accompanying your python glpk interface library.

To be more helpful though, Glpk is written in C. Both go-glpk and whichever python library you are referring to are foreign function interfaces to that C code.

In order to use them you have to have the glpk c source code present on your machine and a path set to it so that clang can find it, as suggested by @lukpank.

I'm guessing you might be on a Mac from the clang error message. In which case I would suggest using homebrew to install the glpk dev package which includes the source code.

seandunn avatar Aug 21 '17 11:08 seandunn