cvxpy: Failure using SCS solver

I installed cvxpy via pip but when I try to use it I get the following error:

----------------------------------------------------------------------------
        SCS v1.1.7 - Splitting Conic Solver
        (c) Brendan O'Donoghue, Stanford University, 2012-2015
----------------------------------------------------------------------------
Lin-sys: sparse-direct, nnz in A = 65496833
eps = 1.00e-03, alpha = 1.50, max_iters = 2500, normalize = 1, scale = 1.00
Variables n = 43056376, constraints m = 44160356
Cones:  primal zero / dual free vars: 21524924
        linear vars: 662388
        soc vars: 662388, soc blks: 220796
        sd vars: 21310656, sd blks: 1
FATAL: Cannot solve SDPs with > 2x2 matrices without linked blas+lapack libraries
Edit scs.mk to point to blas+lapack libray locations
*** Error in `python': free(): invalid pointer: 0x00000000077c3620 ***
Aborted (core dumped)

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Reactions: 4
  • Comments: 22 (1 by maintainers)

Most upvoted comments

I encountered the same issue in Ubuntu 16.04 with Python 3, even with libblas.so/liblapack.so installed.

The silly mistake there is scs or cvxpy is installed via pip before blas/lapack been installed. So the unlinked scs wheel is cached.

So after blas/lapack installed, pip install -I scs will still get the wheel from the pip cache folder. Disable the pip cache will solve the issue by pip install --no-cache-dir -I scs, since it will build scs from source to link with blas/lapack.

Wish it will help any of you who may encounter the same issue.

pip install numpy --upgrade

For anyone who gets here from Google with the same issue on Travis as https://github.com/cvxgrp/cvxpy/issues/244#issuecomment-193470798 you can work around this problem by adding the following to your .travis.yml:

before_install:
    - sudo apt-get install libblas-dev liblapack-dev  # Needed for pip install cvxpy or pip install scs

Same problem here. Installed cvxpy on Anaconda Anaconda 2.3.0. Then installed gccp via pip, but it gave “RuntimeError: module compiled against API version 0xb but this version of numpy is 0xa”. Then installed gccp from source and I’m having this problem. Any tips?

@SteveDiamond I’m seeing this failure as well, with the cvxgrp SCS packages:

root@0d4f88423a95:~# conda list | grep cvxgrp
cvxcanon                  0.1.0                    py27_0    cvxgrp
cvxpy                     0.4.8                    py27_0    cvxgrp
ecos                      2.0.4                    py27_0    cvxgrp
multiprocess              0.70.4                   py27_0    cvxgrp
scs                       1.2.6                    py27_0    cvxgrp
root@0d4f88423a95:~# dpkg -l | grep lapack
ii  liblapack3                             3.5.0-2ubuntu1                   amd64        Library of linear algebra routines 3 - shared version
root@0d4f88423a95:~# dpkg -l | grep blas
ii  cuda-cublas-7-5                        7.5-18                           amd64        CUBLAS native runtime libraries
ii  cuda-cublas-dev-7-5                    7.5-18                           amd64        CUBLAS native dev links, headers
ii  libblas-dev                            1.2.20110419-7                   amd64        Basic Linear Algebra Subroutines 3, static library
ii  libblas3                               1.2.20110419-7                   amd64        Basic Linear Algebra Reference implementations, shared library

The specific error is:

----------------------------------------------------------------------------
	SCS v1.2.6 - Splitting Conic Solver
	(c) Brendan O'Donoghue, Stanford University, 2012-2016
----------------------------------------------------------------------------
Lin-sys: sparse-indirect, nnz in A = 17734846, CG tol ~ 1/iter^(2.00)
eps = 1.00e-03, alpha = 1.50, max_iters = 2500, normalize = 1, scale = 1.00
Variables n = 9651600, constraints m = 10832400
Cones:	primal zero / dual free vars: 4234050
	linear vars: 2952000
	sd vars: 3646350, sd blks: 1
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
Setup time: 4.44e-01s
Failure:could not initialize work

and the SCS libraries seem to be linked correctly:

root@0d4f88423a95:~/anaconda2/lib/python2.7/site-packages# ldd *scs*so
_scs_direct.so:
        linux-vdso.so.1 =>  (0x00007ffc79cd5000)
        librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f0c0c0ea000)
        libmkl_intel_lp64.so => /root/anaconda2/lib/python2.7/site-packages/./../../libmkl_intel_lp64.so (0x00007f0c0b6c7000)
        libmkl_intel_thread.so => /root/anaconda2/lib/python2.7/site-packages/./../../libmkl_intel_thread.so (0x00007f0c09c62000)
        libmkl_core.so => /root/anaconda2/lib/python2.7/site-packages/./../../libmkl_core.so (0x00007f0c0816a000)
        libiomp5.so => /root/anaconda2/lib/python2.7/site-packages/./../../libiomp5.so (0x00007f0c07dbf000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f0c07ba1000)
        libpython2.7.so.1.0 => /root/anaconda2/lib/python2.7/site-packages/./../../libpython2.7.so.1.0 (0x00007f0c077a5000)
        libgomp.so.1 => /root/anaconda2/lib/python2.7/site-packages/./../../libgomp.so.1 (0x00007f0c07595000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f0c071d0000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f0c06fcb000)
        libgcc_s.so.1 => /root/anaconda2/lib/python2.7/site-packages/./../.././libgcc_s.so.1 (0x00007f0c06db5000)
        /lib64/ld-linux-x86-64.so.2 (0x000055c0c5208000)
        libutil.so.1 => /lib/x86_64-linux-gnu/libutil.so.1 (0x00007f0c06bb2000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f0c068ab000)
_scs_indirect.so:
        linux-vdso.so.1 =>  (0x00007ffd567b2000)
        librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f59fee2d000)
        libmkl_intel_lp64.so => /root/anaconda2/lib/python2.7/site-packages/./../../libmkl_intel_lp64.so (0x00007f59fe40a000)
        libmkl_intel_thread.so => /root/anaconda2/lib/python2.7/site-packages/./../../libmkl_intel_thread.so (0x00007f59fc9a5000)
        libmkl_core.so => /root/anaconda2/lib/python2.7/site-packages/./../../libmkl_core.so (0x00007f59faead000)
        libiomp5.so => /root/anaconda2/lib/python2.7/site-packages/./../../libiomp5.so (0x00007f59fab02000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f59fa8e4000)
        libpython2.7.so.1.0 => /root/anaconda2/lib/python2.7/site-packages/./../../libpython2.7.so.1.0 (0x00007f59fa4e8000)
        libgomp.so.1 => /root/anaconda2/lib/python2.7/site-packages/./../../libgomp.so.1 (0x00007f59fa2d8000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f59f9f13000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f59f9d0e000)
        libgcc_s.so.1 => /root/anaconda2/lib/python2.7/site-packages/./../.././libgcc_s.so.1 (0x00007f59f9af8000)
        /lib64/ld-linux-x86-64.so.2 (0x000055e040118000)
        libutil.so.1 => /lib/x86_64-linux-gnu/libutil.so.1 (0x00007f59f98f5000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f59f95ee000)

When you install SCS, it has to link against BLAS/LAPACK. Otherwise it can’t solve SDPs. You should look into the SCS installation instructions. The Anaconda packages for Mac and Linux take care of the linking, but in Windows you have to take care of it yourself.

On Mon, Jan 9, 2017 at 2:08 PM Alex Rubinsteyn notifications@github.com wrote:

Any progress on this?

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/cvxgrp/cvxpy/issues/244#issuecomment-271423178, or mute the thread https://github.com/notifications/unsubscribe-auth/AAfyIKW1X4C9YAFUSkpLmiJ9lxV49cHyks5rQq_JgaJpZM4GbPtz .