Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save murphyyhuang/62f1fc67e2a0b02eea762f214f36ca03 to your computer and use it in GitHub Desktop.
Save murphyyhuang/62f1fc67e2a0b02eea762f214f36ca03 to your computer and use it in GitHub Desktop.
Install cvxopt with glpk optimizer on Apple Silicon
# For a later reference
# Seems like not wheel for macOS M1 has been provided: https://github.com/cvxopt/cvxopt/issues/201
# Manually install according to https://cvxopt.org/install/
# Remember to specify the environment variables with the prefix 'CVXOPT_'
brew install gsl fftw suite-sparse glpk
git clone https://github.com/cvxopt/cvxopt.git
cd cvxopt
git checkout `git describe --abbrev=0 --tags`
export CVXOPT_BUILD_GLPK=1
export CVXOPT_GLPK_LIB_DIR=/opt/homebrew/Cellar/glpk/5.0/lib/
export CVXOPT_GLPK_INC_DIR=/opt/homebrew/Cellar/glpk/5.0/include/
python setup.py install
# test:
# in python: from cvxopt import glpk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment