官网安装教程:http://cvxopt.org/install/index.html
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_FFTW=1 # optional export CVXOPT_BUILD_GLPK=1 # optional export CVXOPT_BUILD_GSL=1 # optional python setup.py install
pypy3安装cvxopt报错
pip_pypy3 install cvxopt
报错:
building 'umfpack' extension
cc -pthread -arch x86_64 -DNDEBUG -O2 -fPIC -I/usr/local/include -I/usr/local/Cellar/pypy3/6.0.0/libexec/include -c src/C/umfpack.c -o build/temp.macosx-10.14-x86_64-3.5/src/C/umfpack.o
src/C/umfpack.c:23:10: fatal error: 'umfpack.h' file not found
#include "umfpack.h"
^~~~~~~~~~~
1 error generated.
error: command 'cc' failed with exit status 1
解决:
参考1: https://github.com/cvxopt/cvxopt/issues/78
wget http://faculty.cse.tamu.edu/davis/SuiteSparse/SuiteSparse-4.5.3.tar.gz tar -xf SuiteSparse-4.5.3.tar.gz export CVXOPT_SUITESPARSE_SRC_DIR=$(pwd)/SuiteSparse
SuiteSparse 是一组C、Fortran 和 MATLAB 函数集用来生成空间稀疏矩阵数据。
http://faculty.cse.tamu.edu/davis/suitesparse.html
参考2:
conda install -c conda-forge glpk=4.60 conda install -c conda-forge cvxopt=1.1.8 CVXOPT_BUILD_GLPK=1 pip install cvxopt