cvxgrp / qcqp

A CVXPY extension for handling nonconvex QCQP via Suggest-and-Improve framework
https://stanford.edu/~boyd/papers/qcqp.html
MIT License
107 stars 25 forks source link

linked blas+lapack libraries issue #12

Open fordicus opened 5 years ago

fordicus commented 5 years ago

I was trying to run [ boolean_least_squares.py ]

and I encounter the error message,

FATAL: Cannot solve SDPs with > 2x2 matrices without linked blas+lapack libraries Install blas+lapack and re-compile SCS with blas+lapack libray locations ERROR: initCone failure Failure:could not initialize work

While I am working on [ Windows 10 x64 ], [ Python 3.5.5 ], [ conda 4.5.11 ], and having the conda-packages as below (selective),

blas 1.0 mkl lapack 3.6.1 h8933c1f_2 conda-forge cvxpy 0.4.11 cvxpy 0.4.2 py_0 cvxgrp cvxpy 0.4.2

I successfully ran the first example which appears in [ 5.3 Sample usage ], a small BQP without lifting. and only encountered this issue when I, then, was trying to run [ boolean_least_squares.py ].

Could I get some advice please? Because it doesn't seem to be just installing blas, and lapack, independently using anaconda.

Thanks.

fordicus commented 5 years ago

I don't know much about SCS, but it seems this is serving as internal solver at some point, which relies on blas+lapack. Then, as an alternative solution, is there a way that I can rather change it to some other solver? Otherwise it feels more convenient for me to learn how to just make (blas+lapack) work properly.

12

fordicus commented 5 years ago

Here is what I have just tried. Is there a guideline to do this step-by-step on Windows10? I can reinstall whatever necessary from scratch. Thanks.

//----------------------------------------------------------------------------------------- { 01. [install] pip install ./"numpy-1.15.4+mkl-cp35-cp35m-win_amd64.whl"

{   >> conda list

    [if multiple versions of numpy]
        conda uninstall numpy_bla_bla,
        pip uninstall numpy_bla_bla.
}

https://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy

"Unofficial Windows Binaries for Python Extension Packages" offers,
.whl files so that you can choose specific versions pre-compiled.

    cp35 means python 3.5, 
    win_amd64 means x64.

{   [test install] with .py

    import numpy
    print(numpy.version.version)
    numpy.show_config()
}

} { 02. [install] pip install ./"cvxpy-0.4.10-py3-none-any.whl"

https://pypi.org/project/cvxpy/0.4.10/#files

[why lower-version] because
(!) qcqp 0.8.3 has requirement cvxpy<1.0, but you'll have cvxpy 1.0.12 which is incompatible.

{   [if missing] Visual C++ 14.0 Build Tools,

    [install] Microsoft Visual C++ Build Tools C++ 14.0
        https://visualstudio.microsoft.com/ko/visual-cpp-build-tools/?rr=https%3A%2F%2Fgithub.com%2Fbenfred%2Fimplicit%2Fissues%2F76
}
{   [if missing] rc.dll after installing VC++ 14.0 Build Tools,

    [copy] executables manually, set path manually.
           finding correct paths is on your own.
        https://stackoverflow.com/questions/14372706/visual-studio-cant-build-due-to-rc-exe?newreg=f00ac10c2a4448ceb438f258e5c229a4
}

} { 03. [install] QCQP-Extension for CVXPY, and then, DCCP-Extension for CVXPY.

python setup.py install

https://github.com/cvxgrp/qcqp
https://github.com/cvxgrp/dccp

{   [test install] with .py

    import cvxpy
    print(cvxpy.__version__)
}

} { 04. [install] conda install -c cvxgrp scs

But still seems failed in the first place.
When trying running "boolean_least_squares.py",

**FATAL: Cannot solve SDPs with > 2x2 matrices without linked blas+lapack libraries
Install blas+lapack and re-compile SCS with blas+lapack libray locations
ERROR: initCone failure**
Failure:could not initialize work
Traceback (most recent call last):
  File "C:\``workSpace\BcrPlus\QCQP\playGround\2019011501\2019_01_05_001\2019_01_05_001\_02_boolean_least_squares.py", line 19, in <module>
    qcqp.suggest(SDR)
  File "C:\Users\fordicus\Anaconda3\lib\site-packages\qcqp-0.8.3-py3.5.egg\qcqp\qcqp.py", line 391, in suggest
    self.sdr_sol, self.sdr_bound = solve_sdr(self.qcqp_form, *args, **kwargs)
  File "C:\Users\fordicus\Anaconda3\lib\site-packages\qcqp-0.8.3-py3.5.egg\qcqp\qcqp.py", line 92, in solve_sdr
    rel_prob.solve(*args, **kwargs)
  File "C:\Users\fordicus\Anaconda3\lib\site-packages\cvxpy\problems\problem.py", line 209, in solve
    return self._solve(*args, **kwargs)
  File "C:\Users\fordicus\Anaconda3\lib\site-packages\cvxpy\problems\problem.py", line 335, in _solve
    self._update_problem_state(results_dict, sym_data, solver)
  File "C:\Users\fordicus\Anaconda3\lib\site-packages\cvxpy\problems\problem.py", line 447, in _update_problem_state
    "Solver '%s' failed. Try another solver." % solver.name())
cvxpy.error.SolverError: Solver 'SCS' failed. Try another solver.

} { >> conda list

# packages in environment at C:\Users\fordicus\Anaconda3:
#
# Name                    Version                   Build  Channel
_license                  1.1                      py35_1
_nb_ext_conf              0.3.0                    py35_0
alabaster                 0.7.10           py35h3a808de_0
anaconda                  custom           py35h64770cb_0
anaconda-clean            1.0.0                    py35_0
anaconda-client           1.6.14                   py35_0
anaconda-navigator        1.3.1                    py35_0
anaconda-project          0.8.2            py35h06aeb26_0
argcomplete               1.0.0                    py35_1
asn1crypto                0.24.0                   py35_0
astroid                   1.6.3                    py35_0
attrs                     18.1.0                   py35_0
babel                     2.5.3                    py35_0
backcall                  0.1.0                    py35_0
backports                 1.0              py35he88aa47_1
backports.shutil_get_terminal_size 1.0.0            py35h9d89c8b_2
beautifulsoup4            4.6.0            py35h61fcdcc_1
bitarray                  0.8.1            py35hfa6e2cd_1
blas                      1.0                         mkl
bleach                    1.5.0                     <pip>
bleach                    2.1.3                    py35_0
blosc                     1.14.3               he51fdeb_0
boto                      2.48.0           py35ha0bef00_1
bzip2                     1.0.6                hfa6e2cd_5
ca-certificates           2018.03.07                    0
certifi                   2018.8.24                py35_1
cffi                      1.11.5           py35h945400d_0
chardet                   3.0.4            py35h177e1b7_1
chest                     0.2.3                    py35_0
click                     6.7              py35h10df73f_0
cloudpickle               0.5.3                    py35_0
clyent                    1.2.2            py35h3cd9751_1
colorama                  0.3.9            py35h32a752f_0
comtypes                  1.1.4                    py35_0
conda                     4.5.11                   py35_0
conda-build               2.0.2                    py35_0
conda-env                 2.6.0                         1
configobj                 5.0.6                    py35_0
console_shortcut          0.1.1                h6bb2dd7_3
contextlib2               0.5.5            py35h0a97e54_0
cryptography              2.2.2            py35hfa6e2cd_0
curl                      7.60.0               h7602738_0
CVXcanon                  0.1.1                     <pip>
cvxpy                     0.4.10                    <pip>
cvxpy                     0.4.11                    <pip>
cycler                    0.10.0           py35hcc71164_0
cython                    0.28.2           py35hfa6e2cd_0
cytoolz                   0.9.0.1          py35hfa6e2cd_0
dask-core                 0.17.5                   py35_0
dccp                      1.0.0                     <pip>
decorator                 4.3.0                    py35_0
dill                      0.2.5                    py35_0
distributed               1.21.8                   py35_0
docutils                  0.14             py35h8ccb97f_0
ecos                      2.0.7.post1               <pip>
entrypoints               0.2.3            py35hb91ced9_2
enum34                    1.1.6                     <pip>
et_xmlfile                1.0.1            py35h2c13def_0
ez-setup                  0.9                       <pip>
fastcache                 1.0.2            py35hfa6e2cd_2
filelock                  3.0.4                    py35_0
flask                     1.0.2                    py35_1
flask-cors                3.0.4                    py35_0
freetype                  2.8                  h51f8f2c_1
future                    0.17.1                    <pip>
get_terminal_size         1.0.0                h38e98db_0
gevent                    1.3.0            py35hfa6e2cd_0
glob2                     0.6              py35h9eb15d0_0
greenlet                  0.4.13           py35hfa6e2cd_0
hdf5                      1.10.2               hac2f561_1
heapdict                  1.0.0                    py35_2
html5lib                  0.9999999                 <pip>
html5lib                  1.0.1            py35h047fa9f_0
httplib2                  0.11.3                    <pip>
icc_rt                    2017.0.4             h97af966_0
icu                       58.2                 ha66f8fd_1
idna                      2.6              py35h8dcb9ae_1
imagesize                 1.0.0                    py35_0
intel-openmp              2018.0.0                      8
ipykernel                 4.8.2                    py35_0
ipython                   6.4.0                    py35_0
ipython_genutils          0.2.0            py35ha709e79_0
ipywidgets                7.2.1                    py35_0
isort                     4.3.4                    py35_0
itsdangerous              0.24             py35h99d45d4_1
jdcal                     1.4                      py35_0
jedi                      0.12.0                   py35_1
jinja2                    2.10             py35hdf652bb_0
jpeg                      9b                   hb83a4c4_2
jsonschema                2.6.0            py35h27d56d3_0
jupyter                   1.0.0                    py35_4
jupyter-contrib-core      0.3.3                     <pip>
jupyter-contrib-nbextensions 0.3.3                     <pip>
jupyter-highlight-selected-word 0.1.0                     <pip>
jupyter-latex-envs        1.3.8.4                   <pip>
jupyter-nbextensions-configurator 0.2.8                     <pip>
jupyter_client            5.2.3                    py35_0
jupyter_console           5.2.0            py35hf76c22e_1
jupyter_contrib_core      0.3.3                    py35_0    conda-forge
jupyter_core              4.4.0            py35h629ba7f_0
jupyter_nbextensions_configurator 0.2.8                    py35_0    conda-forge
jupyterlab                0.32.1                   py35_0
jupyterlab_launcher       0.10.5                   py35_0
Keras                     2.0.1                     <pip>
kiwisolver                1.0.1            py35hc605aed_0
lapack                    3.6.1                h8933c1f_2    conda-forge
lazy-object-proxy         1.3.1            py35he996729_0
libcurl                   7.60.0               hc4dcbb0_0
libdynd                   0.7.2                         0
libiconv                  1.15                 h1df5818_7
libpng                    1.6.34               h79bbb47_0
libsodium                 1.0.16               h9d3ae62_0
libssh2                   1.8.0                hd619d38_4
libtiff                   4.0.9                hb8ad9f9_1
libxml2                   2.9.8                hadb2253_1
libxslt                   1.1.32               hf6f1972_0
llvmlite                  0.23.1           py35hcacf6c6_0
locket                    0.2.0            py35h0dfcdd0_1
lxml                      4.2.1            py35heafd4d3_0
lxml                      4.1.1                     <pip>
lzo                       2.10                 h6df0209_2
m2w64-gcc-libgfortran     5.3.0                         6
m2w64-gcc-libs            5.3.0                         7
m2w64-gcc-libs-core       5.3.0                         7
m2w64-gmp                 6.1.0                         2
m2w64-libwinpthread-git   5.0.0.4634.697f757               2
Markdown                  2.6.9                     <pip>
markupsafe                1.0              py35hc253e08_1
mccabe                    0.6.1            py35hcf31250_1
menuinst                  1.4.14           py35hfa6e2cd_0
mistune                   0.8.3            py35hfa6e2cd_1
mkl                       2018.0.3                      1    anaconda
mkl-service               1.1.2            py35h051acba_4
mkl_fft                   1.0.6            py35hdbbee80_0
mkl_random                1.0.1            py35h77b88f5_1
more-itertools            4.1.0                    py35_0
mpmath                    1.0.0            py35h253b693_2
msgpack-python            0.5.6            py35he980bc4_0
msys2-conda-epoch         20160418                      1
multipledispatch          0.5.0                    py35_0
multiprocess              0.70.4                   py35_0    cvxgrp
nb_anacondacloud          1.2.0                    py35_0
nb_conda                  2.0.0                    py35_0
nb_conda_kernels          2.0.0                    py35_0
nbconvert                 5.3.1            py35h98d6c46_0
nbformat                  4.4.0            py35h908c9d9_0
nbpresent                 3.0.2                    py35_0
networkx                  2.1                      py35_0
nltk                      3.3.0                    py35_0
nose                      1.3.7            py35h0e9586c_2
notebook                  5.5.0                    py35_0
numpy                     1.15.2           py35ha559c80_0
numpy                     1.15.4+mkl                <pip>
numpy-base                1.15.2           py35h8128ebf_0
olefile                   0.45.1                   py35_0
openblas                  0.2.13                        0    menpo
openpyxl                  2.5.3                    py35_0
openssl                   1.0.2p               hfa6e2cd_0
osqp                      0.5.0                     <pip>
packaging                 17.1                     py35_0
pandoc                    1.19.2.1             hb2460c7_1
pandocfilters             1.4.2            py35h978f723_1
parso                     0.2.0                    py35_0
partd                     0.3.8            py35h894d1e4_0
path.py                   11.0.1                   py35_0
pathlib2                  2.3.2                    py35_0
pep8                      1.7.1                    py35_0
pickleshare               0.7.4            py35h2f9f535_0
pillow                    5.1.0            py35h0738816_0
pip                       18.1                      <pip>
pip                       10.0.1                   py35_0
pip                       10.0.1                    <pip>
pkginfo                   1.4.2                    py35_1
pluggy                    0.6.0            py35h717ee57_0
ply                       3.11                     py35_0
prompt_toolkit            1.0.15           py35h89c7cb4_0
protobuf                  3.4.0                     <pip>
psutil                    5.4.5            py35hfa6e2cd_0
py                        1.5.3                    py35_0
pyasn1                    0.1.9                    py35_0
pycodestyle               2.4.0                    py35_0
pycosat                   0.6.3            py35h456c199_0
pycparser                 2.18             py35h15a15da_1
pycrypto                  2.6.1            py35hfa6e2cd_8
pycurl                    7.43.0.1         py35h74b6da3_0
pyflakes                  1.6.0            py35hb7fdafe_0
pygments                  2.2.0            py35h24c0941_0
pylint                    1.8.4                    py35_0
pyodbc                    4.0.23           py35h6538335_0
pyopenssl                 18.0.0                   py35_0
pyparsing                 2.2.0            py35hcabcaab_1
pyqt                      5.9.2            py35h1aa27d4_0
pysocks                   1.6.8                    py35_0
pytest                    3.5.1                    py35_0
pytest-openfiles          0.3.0                    py35_0
pytest-remotedata         0.2.1                    py35_0
python                    3.5.5                h0c2934d_2
python-automaton          1.3.1                     <pip>
python-dateutil           2.7.3                    py35_0
pytz                      2018.4                   py35_0
pywin32                   223              py35hfa6e2cd_1
pywinpty                  0.5.1                    py35_0
pyyaml                    3.12             py35h4bf9689_1
pyzmq                     17.0.0           py35hfa6e2cd_1
qcqp                      0.8.3                     <pip>
qt                        5.9.5            vc14he4a7d60_0
qtawesome                 0.4.4            py35h639d0ff_0
qtconsole                 4.3.1            py35hc47b0dd_0
qtpy                      1.4.1                    py35_0
requests                  2.18.4           py35h54a615f_1
rope                      0.10.7           py35h5756fe0_0
ruamel_yaml               0.15.35          py35hfa6e2cd_1
scikit-learn              0.19.1                    <pip>
scipy                     1.2.0                     <pip>
scipy                     1.1.0            py35h4f6bf74_1
scs                       2.0.2                     <pip>
scs                       1.2.6                    py35_0    cvxgrp
send2trash                1.5.0                    py35_0
setuptools                39.1.0                   py35_0
setuptools                40.6.3                    <pip>
simplegeneric             0.8.1                    py35_2
singledispatch            3.4.0.3          py35h33f66b4_0
sip                       4.19.8           py35h6538335_0
six                       1.11.0           py35hc1da2df_1
snappy                    1.1.7                h777316e_3
snowballstemmer           1.2.1            py35h4c55bfa_0
sockjs-tornado            1.0.3                    py35_0
sortedcollections         0.6.1                    py35_0
sortedcontainers          1.5.10                   py35_0
sphinx                    1.7.4                    py35_0
sphinxcontrib             1.0              py35h45f5ca3_1
sphinxcontrib-websupport  1.0.1            py35ha3690eb_1
sqlalchemy                1.2.7            py35ha85dd04_0
sqlite                    3.23.1               h35aae40_0
style                     1.1.0                     <pip>
sympy                     1.1.1            py35ha5375ed_0
tabulate                  0.8.2                     <pip>
tblib                     1.3.2            py35hd2cf7e1_0
tensorflow                1.4.0                     <pip>
tensorflow-tensorboard    0.4.0rc2                  <pip>
terminado                 0.8.1                    py35_1
testpath                  0.3.1            py35h06cf69e_0
Theano                    0.9.0rc4                  <pip>
tk                        8.6.7                hcb92d03_3
toolz                     0.9.0                    py35_0
tornado                   5.0.2                    py35_0
traitlets                 4.3.2            py35h09b975b_0
typing                    3.6.4                    py35_0
unicodecsv                0.14.1           py35h0d88516_0
update                    0.0.1                     <pip>
urllib3                   1.22             py35h8cc84eb_0
vc                        14.1                 h21ff451_3    anaconda
vs2015_runtime            15.5.2                        3    anaconda
wcwidth                   0.1.7            py35h6e80d8a_0
webencodings              0.5.1            py35h5d527fb_1
werkzeug                  0.14.1                   py35_0
wheel                     0.31.1                   py35_0
widgetsnbextension        3.2.1                    py35_0
win_inet_pton             1.0.1            py35hbef1270_1
win_unicode_console       0.5              py35h56988b5_0
wincertstore              0.2              py35hfebbdb8_0
winpty                    0.4.3                         4
wrapt                     1.10.11          py35h54666f7_0
xlrd                      1.1.0            py35h22b952b_1
xlsxwriter                1.0.4                    py35_0
xlwings                   0.11.8                   py35_0
xlwt                      1.3.0            py35hd04410a_0
yaml                      0.1.7                hc54c509_2
zeromq                    4.2.5                hc6251cf_0
zict                      0.1.3            py35hf5542e0_0
zlib                      1.2.11               h8395fce_2

}

rmsandu commented 3 years ago

I have the same issue.