scs icon indicating copy to clipboard operation
scs copied to clipboard

Warnings and errors when installing the SuperSCS module in Python

Open alphaville opened this issue 7 years ago • 3 comments

This is an issue I'm experiencing in SuperSCS, but I thought you could help since you've written the Python interface for SCS.

When installing the superscs module using sudo python setup.py install I get a lot of warnings as shown here.

Although on Linux and OSX I only get warnings, on Windows the compilation fails.

Let me paste part of the logs here:

./src\scs.c(2241) : error C2065: 'blasint' : undeclared identifier
../src\scs.c(2241) : error C2146: syntax error : missing ';' before identifier 'nMax'
../src\scs.c(2241) : error C2065: 'nMax' : undeclared identifier
../src\scs.c(2242) : error C2143: syntax error : missing ';' before 'type'
../src\scs.c(2243) : error C2275: 'scs_int' : illegal use of this type as an expression
        c:\projects\scs\include\glbopts.h(85) : see declaration of 'scs_int'
../src\scs.c(2243) : error C2146: syntax error : missing ';' before identifier 'i'
../src\scs.c(2243) : error C2065: 'i' : undeclared identifier
../src\scs.c(2244) : error C2275: 'scs_int' : illegal use of this type as an expression
        c:\projects\scs\include\glbopts.h(85) : see declaration of 'scs_int'
../src\scs.c(2244) : error C2146: syntax error : missing ';' before identifier 'float_size'
../src\scs.c(2244) : error C2065: 'float_size' : undeclared identifier
../src\scs.c(2245) : error C2275: 'scs_int' : illegal use of this type as an expression
        c:\projects\scs\include\glbopts.h(85) : see declaration of 'scs_int'
../src\scs.c(2245) : error C2146: syntax error : missing ';' before identifier 'int_size'
../src\scs.c(2245) : error C2065: 'int_size' : undeclared identifier
../src\scs.c(2246) : error C2275: 'scs_int' : illegal use of this type as an expression
        c:\projects\scs\include\glbopts.h(85) : see declaration of 'scs_int'
../src\scs.c(2246) : error C2146: syntax error : missing ';' before identifier 'l'
../src\scs.c(2246) : error C2065: 'l' : undeclared identifier
../src\scs.c(2246) : warning C4244: '=' : conversion from 'const scs_int' to 'int', possible loss of data
../src\scs.c(2247) : error C2275: 'scs_int' : illegal use of this type as an expression
        c:\projects\scs\include\glbopts.h(85) : see declaration of 'scs_int'
../src\scs.c(2247) : error C2146: syntax error : missing ';' before identifier 'mem'
../src\scs.c(2247) : error C2065: 'mem' : undeclared identifier
../src\scs.c(2247) : warning C4244: '=' : conversion from 'scs_int' to 'int', possible loss of data
../src\scs.c(2249) : error C2065: 'i' : undeclared identifier
../src\scs.c(2249) : error C2065: 'i' : undeclared identifier
../src\scs.c(2249) : error C2065: 'i' : undeclared identifier
../src\scs.c(2250) : error C2065: 'i' : undeclared identifier
../src\scs.c(2250) : error C2065: 'nMax' : undeclared identifier
../src\scs.c(2251) : error C2065: 'nMax' : undeclared identifier
../src\scs.c(2251) : error C2065: 'blasint' : undeclared identifier
../src\scs.c(2251) : error C2146: syntax error : missing ';' before identifier 'k'
../src\scs.c(2251) : error C2065: 'i' : undeclared identifier
../src\scs.c(2255) : error C2065: 'allocated_memory' : undeclared identifier
../src\scs.c(2256) : error C2065: 'float_size' : undeclared identifier
../src\scs.c(2262) : error C2065: 'nMax' : undeclared identifier
../src\scs.c(2263) : error C2065: 'nMax' : undeclared identifier
../src\scs.c(2264) : error C2065: 'nMax' : undeclared identifier
../src\scs.c(2264) : error C2039: 'lwork' : is not a member of 'scs_cone_work'
        c:\projects\scs\include\cones.h(131) : see declaration of 'scs_cone_work'
../src\scs.c(2265) : error C2065: 'l' : undeclared identifier
../src\scs.c(2266) : error C2065: 'int_size' : undeclared identifier
../src\scs.c(2268) : error C2039: 'liwork' : is not a member of 'scs_cone_work'
        c:\projects\scs\include\cones.h(131) : see declaration of 'scs_cone_work'
../src\scs.c(2272) : error C2065: 'allocated_memory' : undeclared identifier
../src\scs.c(2272) : error C2065: 'float_size' : undeclared identifier
../src\scs.c(2272) : error C2065: 'l' : undeclared identifier
../src\scs.c(2274) : error C2065: 'mem' : undeclared identifier
../src\scs.c(2275) : error C2065: 'allocated_memory' : undeclared identifier
../src\scs.c(2275) : error C2065: 'float_size' : undeclared identifier
../src\scs.c(2275) : error C2065: 'l' : undeclared identifier
../src\scs.c(2275) : error C2065: 'mem' : undeclared identifier
../src\scs.c(2278) : error C2065: 'allocated_memory' : undeclared identifier
../src\scs.c(2278) : error C2065: 'float_size' : undeclared identifier
../src\scs.c(2278) : error C2065: 'l' : undeclared identifier
../src\scs.c(2278) : error C2065: 'mem' : undeclared identifier
../src\scs.c(2279) : error C2065: 'l' : undeclared identifier
../src\scs.c(2279) : error C2065: 'mem' : undeclared identifier
../src\scs.c(2279) : error C2065: 'l' : undeclared identifier
../src\scs.c(2279) : error C2065: 'mem' : undeclared identifier
../src\scs.c(2279) : warning C4244: '+=' : conversion from 'scs_int' to 'int', possible loss of data
../src\scs.c(2283) : error C2065: 'allocated_memory' : undeclared identifier
../src\scs.c(2283) : error C2065: 'float_size' : undeclared identifier
../src\scs.c(2283) : warning C4244: '+=' : conversion from 'const scs_int' to 'int', possible loss of data
../src\scs.c(2285) : error C2065: 'allocated_memory' : undeclared identifier

It would be useful if you updated appveyor to run the Python tests so as to reproduce the errors. https://ci.appveyor.com/project/alphaville/scs/build/job/ysjxxdx4ukjabqo3#L244

Update: I resolved all issues in scs.c and linAlg.c, but I now get some errors in scs_parser.c (check out this link for details). I'll try to fix them.

I had to add a few macros in setup.py; in particular:

define_macros = [('PYTHON', None), ('CTRLC', 1), ('COPYAMATRIX', None), ('USE_LAPACK', 1), ('LAPACK_LIB_FOUND', 1),('DSVD_ACTIVATED', 1)]

Feel free to close this issue if you like. Let me know if you have experienced similar issues on Windows.

alphaville avatar Apr 28 '18 12:04 alphaville

Looks like you got it to work? By the way, the SCS python CI is with the interface which I broke out to a separate repo, it's here now: https://github.com/bodono/scs-python

bodono avatar Apr 29 '18 13:04 bodono

Hi Brendan,

Thanks for your reply.

I resolved all these issue and at least on Linux and OSX everything works fine.

However, on Windows I get the following errors when running python setup.py install:

cones.obj : error LNK2019: unresolved external symbol dsyevr_ referenced in function setUpSdScsConeWorkSpace
cones.obj : error LNK2019: unresolved external symbol dsyr_ referenced in function projSemiDefiniteCone
cones.obj : error LNK2019: unresolved external symbol dnrm2_ referenced in function projSemiDefiniteCone
linAlg.obj : error LNK2001: unresolved external symbol dnrm2_
cones.obj : error LNK2019: unresolved external symbol dscal_ referenced in function projSemiDefiniteCone
linAlg.obj : error LNK2001: unresolved external symbol dscal_
linAlg.obj : error LNK2019: unresolved external symbol dgemm_ referenced in function scs_matrix_multiply
linAlg.obj : error LNK2019: unresolved external symbol ddot_ referenced in function scs_inner_product
linAlg.obj : error LNK2019: unresolved external symbol idamax_ referenced in function scs_norm_infinity
linAlg.obj : error LNK2019: unresolved external symbol daxpy_ referenced in function scs_add_scaled_array
linAlg.obj : error LNK2019: unresolved external symbol dgels_ referenced in function scs_qr_workspace_size
linAlg.obj : error LNK2019: unresolved external symbol dgelss_ referenced in function scs_svd_workspace_size
scs.obj : error LNK2019: unresolved external symbol isnan referenced in function scs_isnan
scs.obj : error LNK2019: unresolved external symbol round referenced in function scs_print_footer
build\lib.win-amd64-2.7\_superscs_direct.pyd : fatal error LNK1120: 12 unresolved externals
C:\Python27-x64\lib\site-packages\numpy\distutils\system_info.py:624: UserWarning: 
    Atlas (http://math-atlas.sourceforge.net/) libraries not found.
    Directories to search for the libraries can be specified in the
    numpy/distutils/site.cfg file (section [atlas]) or by setting
    the ATLAS environment variable.
  self.calc_info()
C:\Python27-x64\lib\site-packages\numpy\distutils\system_info.py:624: UserWarning: 
    Blas (http://www.netlib.org/blas/) libraries not found.
    Directories to search for the libraries can be specified in the
    numpy/distutils/site.cfg file (section [blas]) or by setting
    the BLAS environment variable.
  self.calc_info()
C:\Python27-x64\lib\site-packages\numpy\distutils\system_info.py:624: UserWarning: 
    Blas (http://www.netlib.org/blas/) sources not found.
    Directories to search for the sources can be specified in the
    numpy/distutils/site.cfg file (section [blas_src]) or by setting
    the BLAS_SRC environment variable.
  self.calc_info()
C:\Python27-x64\lib\site-packages\numpy\distutils\system_info.py:624: UserWarning: 
    Lapack (http://www.netlib.org/lapack/) libraries not found.
    Directories to search for the libraries can be specified in the
    numpy/distutils/site.cfg file (section [lapack]) or by setting
    the LAPACK environment variable.
  self.calc_info()
C:\Python27-x64\lib\site-packages\numpy\distutils\system_info.py:624: UserWarning: 
    Lapack (http://www.netlib.org/lapack/) sources not found.
    Directories to search for the sources can be specified in the
    numpy/distutils/site.cfg file (section [lapack_src]) or by setting
    the LAPACK_SRC environment variable.

Do you compile with blas and lapack in your tests on appveyor? Any idea how I could do it? Certain functionality in SuperSCS relies on lapack's SVD implementation.

alphaville avatar Apr 30 '18 12:04 alphaville

Yes, by default it links against the numpy blas / lapack. I have generally found conda to be the easiest way to get it all running. You should just be able to copy the scs and scs-python appveyor scripts. My guess from that error is that the blas install you're using has a different prefix or suffix, so instead of dscal_ it could be dscal or dscal_64_ etc.

bodono avatar May 01 '18 17:05 bodono