Here are some explaination on how to install glpk and CVXOPT (on MAC). Using option ‘glpk’ in solvers.lp method of CVXOPT speeds up cvxopt by a factor of 2 or 10 according to Stephane Caron’s webpage

a) Install glpk via brew :

brew install glpk

b) The GLPK interface is not enabled by default. You need to edit the of CVXOPT. In my case, I have this file in the following folder

Google\ Drive/package_python/cvxopt-1.1.7/

First thing, set variable BUILD_GLPK to 1:


Then indicate the path to libglpk

GLPK_LIB_DIR = ‘/usr/local/Cellar/glpk/4.52/lib’

Then indicate the path to glpk.h

GLPK_INC_DIR = ‘/usr/local/Cellar/glpk/4.52/include’

c) Go to the CVXOPT’s ‘’ folder and run

python install

d) Enjoy CVXOPT with glpk :

sol = solvers.lp(c, G, h, A, b, solver = ‘glpk’)