lukpank / go-glpk

Go bindings for GLPK (GNU Linear Programming Kit)
GNU General Public License v3.0
36 stars 18 forks source link

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

Open jagrati16 opened 7 years ago

jagrati16 commented 7 years ago

Can't figure out a solution.

lukpank commented 7 years ago

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.

Manish-rai21bit commented 7 years ago

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

seandunn commented 7 years ago

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.