Cannot Install (on Windows 7 with Python 2.7 installed)

503 views
Skip to first unread message

David Samson

unread,
Sep 29, 2015, 9:05:17 PM9/29/15
to CVXOPT
Hi all,

I'm trying to install the package using these instructions for Windows:


I'm running Windows 7 and have Python 2.7 installed as part of the Anaconda distribution.

I'm literally at the final step where I run the build statement (python setup.py build --compiler=mingw32) after having installed MinGW, compiled BLAS and LAPACK, unpacked CVXOPT, made the necessary file movements, altered the "setup.py" file, and made the necessary changes to the "cygwinccompiler.py" file in my Anaconda directory.

Command prompt is giving me this error:

C:\Users\David\Desktop\cvxopt-1.1.8>python setup.py build --compiler=mingw32
running build
running build_py
running build_ext
building 'base' extension
c:\MinGW\bin\gcc.exe -DMS_WIN64 -mdll -O -Wall -IC:\Users\David\Anaconda\include
 -IC:\Users\David\Anaconda\PC -c src/C/base.c -o build\temp.win-amd64-2.7\Releas
e\src\c\base.o
c:\MinGW\bin\gcc.exe -DMS_WIN64 -mdll -O -Wall -IC:\Users\David\Anaconda\include
 -IC:\Users\David\Anaconda\PC -c src/C/dense.c -o build\temp.win-amd64-2.7\Relea
se\src\c\dense.o
c:\MinGW\bin\gcc.exe -DMS_WIN64 -mdll -O -Wall -IC:\Users\David\Anaconda\include
 -IC:\Users\David\Anaconda\PC -c src/C/sparse.c -o build\temp.win-amd64-2.7\Rele
ase\src\c\sparse.o
src/C/sparse.c: In function 'sparse_concat':
src/C/sparse.c:368:30: warning: variable 'blk_ncols' set but not used [-Wunused-
but-set-variable]
         int_t blk_nrows = 0, blk_ncols = 0;
                              ^
writing build\temp.win-amd64-2.7\Release\src\c\base.def
c:\MinGW\bin\gcc.exe -DMS_WIN64 -shared -s build\temp.win-amd64-2.7\Release\src\
c\base.o build\temp.win-amd64-2.7\Release\src\c\dense.o build\temp.win-amd64-2.7
\Release\src\c\sparse.o build\temp.win-amd64-2.7\Release\src\c\base.def -L. -LC:
\Users\David\Anaconda\libs -LC:\Users\David\Anaconda\PCbuild\amd64 -lm -llapack
-lblas -lgfortran -lpython27 -lmsvcr90 -o build\lib.win-amd64-2.7\cvxopt\base.py
d
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: cannot fin
d -llapack
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: cannot fin
d -lblas
collect2.exe: error: ld returned 1 exit status
error: command 'c:\\MinGW\\bin\\gcc.exe' failed with exit status 1

-------------------------------------------------------------------------------------------------------------------------


Any thoughts?

Thanks,
David

Martin

unread,
Sep 30, 2015, 1:07:45 AM9/30/15
to CVXOPT
Did you copy libblas.a and liblapack.a to the src directory and edit the setup script? For some reason the compiler does not add the correct linker flags.

Hantao Cui

unread,
Oct 28, 2015, 10:32:34 AM10/28/15
to CVXOPT
Hi Martin,

There might be a typo on the Installation Instruction. 
As instructed, copy libblas.a and liblapack.a to src directory, then in setup.py set the variable BLAS_LIB_DIR in setup.py to BLAS_LIB_DIR = ‘src’. It's BLAS_LIB_DIR = ‘.’ on the Instruction page.
I've successfully compiled it against Python 3.4 32bit version with the path fixed, using MinGW and MSYS.

Regards,
Hantao

Martin

unread,
Oct 28, 2015, 11:05:57 AM10/28/15
to CVXOPT
You're right, thanks for pointing this out! 

hrishabh upadhyay

unread,
Nov 29, 2015, 11:56:11 AM11/29/15
to CVXOPT
I am also facing the same problem on setup.py  

If anyone can help ?

Martin

unread,
Nov 29, 2015, 12:01:06 PM11/29/15
to CVXOPT
Have you tried editing BLAS_LIB_DIR in setup.py? It should be the directory in which you have the BLAS and LAPACK libraries. 

Ek Esawi

unread,
Dec 1, 2015, 12:45:48 AM12/1/15
to CVXOPT
Hi--

I ran into the same problem a few weeks ago. Keep in mind that i installed cvxopt on windows 7 for python 3.43. The posting i found that helped me greatly and efficiently is included at the end of this message.  Make sure to avoid the mistake i made; that's use the last commons[(e. g. "conda install -c https://conda.binstar.org/omnia cvxopt")] on CMD not on python interpreter..

Best of luck.

EKE

If you are using Windows, an easy solution could be the Anaconda distribution (http://continuum.io/downloads). Select and install the 32 bit version. It will be easier to install the cvxopt package. Search it in the binstar repository (https://binstar.org/search?q=cvxopt). Open a console terminal and install it (e. g. "conda install -c https://conda.binstar.org/omnia cvxopt"). After that, just use it.
Reply all
Reply to author
Forward
0 new messages