Giter VIP home page Giter VIP logo

qdldl-python's Introduction

The Operator Splitting QP Solver

CI Code coverage License

PyPI - downloads Conda - downloads

Visit our GitHub Discussions page for any questions related to the solver!

The documentation is available at osqp.org

The OSQP (Operator Splitting Quadratic Program) solver is a numerical optimization package for solving problems in the form

minimize        0.5 x' P x + q' x

subject to      l <= A x <= u

where x in R^n is the optimization variable. The objective function is defined by a positive semidefinite matrix P in S^n_+ and vector q in R^n. The linear constraints are defined by matrix A in R^{m x n} and vectors l and u so that l_i in R U {-inf} and u_i in R U {+inf} for all i in 1,...,m.

Citing OSQP

If you are using OSQP for your work, we encourage you to

We are looking forward to hearing your success stories with OSQP! Please share them with us.

Bug reports and support

Please report any issues via the Github issue tracker. All types of issues are welcome including bug reports, documentation typos, feature requests and so on.

Numerical benchmarks

Numerical benchmarks against other solvers are available here.

qdldl-python's People

Contributors

adamwrichardson avatar ajfriend avatar amitsolomonprinceton avatar bstellato avatar imciner2 avatar jonathanberthias avatar ptnobel avatar vineetbansal avatar wshanks avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

qdldl-python's Issues

error on installing mac M1 computer

I have problem pip installing qdldl on a mac M1 computer and the error doesn't seem to be an error of pip itself. here is what I get:

The C compiler
"/usr/bin/cc"

          is not able to compile a simple test program.
  
          It fails with the following output:
  
            Change Dir: /private/var/folders/3f/r0wbc5md3fd4qrrzdynqrtzm0000gn/T/pip-install-amewv_ax/qdldl_63c594913c0d4f96b904a16463ca161e/c/build/CMakeFiles/CMakeTmp
  
            Run Build Command(s):/usr/bin/make -f Makefile cmTC_49737/fast && xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
  
  
  
  
  
          CMake will not be able to correctly generate this project.
        Call Stack (most recent call first):
          CMakeLists.txt:4 (project)
  
  
        -- Configuring incomplete, errors occurred!
        See also "/private/var/folders/3f/r0wbc5md3fd4qrrzdynqrtzm0000gn/T/pip-install-amewv_ax/qdldl_63c594913c0d4f96b904a16463ca161e/c/build/CMakeFiles/CMakeOutput.log".
        See also "/private/var/folders/3f/r0wbc5md3fd4qrrzdynqrtzm0000gn/T/pip-install-amewv_ax/qdldl_63c594913c0d4f96b904a16463ca161e/c/build/CMakeFiles/CMakeError.log".
        xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
        building 'qdldl' extension
        creating build
        creating build/temp.macosx-11.1-arm64-cpython-38
        creating build/temp.macosx-11.1-arm64-cpython-38/cpp
     note: This error originates from a subprocess, and is likely not a problem with pip.
    ERROR: Failed building wheel for qdldl
    Running setup.py clean for qdldl
  Failed to build qdldl
  Installing collected packages: wheel, typing-extensions, tomli, setuptools, pyparsing, numpy, scipy, packaging, oldest-supported-numpy, setuptools_scm, qdldl
    Running setup.py install for qdldl: started
    Running setup.py install for qdldl: finished with status 'error'
    error: subprocess-exited-with-error
  
    × Running setup.py install for qdldl did not run successfully.
    │ exit code: 1
    ╰─> [44 lines of output]
        running install

miniforge3/envs/ninen/lib/python3.8/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
running build
running build_ext
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc - broken
The C compiler

            "/usr/bin/cc"
  
          is not able to compile a simple test program.
  
          It fails with the following output:
  
            Change Dir: /private/var/folders/3f/r0wbc5md3fd4qrrzdynqrtzm0000gn/T/pip-install-amewv_ax/qdldl_63c594913c0d4f96b904a16463ca161e/c/build/CMakeFiles/CMakeTmp
  
            Run Build Command(s):/usr/bin/make -f Makefile cmTC_a7ccf/fast && xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
  
  
  
          CMake will not be able to correctly generate this project.
        Call Stack (most recent call first):
          CMakeLists.txt:4 (project)
  
  
        -- Configuring incomplete, errors occurred!
        See also "/private/var/folders/3f/r0wbc5md3fd4qrrzdynqrtzm0000gn/T/pip-install-amewv_ax/qdldl_63c594913c0d4f96b904a16463ca161e/c/build/CMakeFiles/CMakeOutput.log".
        See also "/private/var/folders/3f/r0wbc5md3fd4qrrzdynqrtzm0000gn/T/pip-install-amewv_ax/qdldl_63c594913c0d4f96b904a16463ca161e/c/build/CMakeFiles/CMakeError.log".
        xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
        building 'qdldl' extension
        creating build
        creating build/temp.macosx-11.1-arm64-cpython-38
     xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
        error: command '/usr/bin/gcc' failed with exit code 1
        [end of output]
  
    note: This error originates from a subprocess, and is likely not a problem with pip.
  error: legacy-install-failure
  
  × Encountered error while trying to install package.
  ╰─> qdldl
  
  note: This is an issue with the package mentioned above, not pip.
  hint: See above for output from the failure.
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

Add support to release linux aarch64 wheels

Problem

On aarch64, pip install qdldl builds the wheels from source code and then installs it. It requires the user to have a development environment installed on their system. Also, it takes more time to build the wheels than downloading and extracting the wheels from PyPI.

Resolution

On aarch64, pip install qdldl should download the wheels from PyPI.

@bstellato, Please let me know your interest in releasing aarch64 wheels. I can help with this.

Qdldl cannot be properly installed on a mac m1 chip with latest poetry version (1.2.1)

  • Python version: pyenv local 3.10.0
  • OS version and name: Mac OS 12.6 (Apple M1 Pro)
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • I have consulted the FAQ and blog for any relevant entries or release notes.

Issue

qdldl cannot be properly installed on a mac m1 chip with latest poetry version (1.2.1)

I have got an issue with the qdldl package when installing with poetry. I ran the issue in the poetry github but it is apparently an upstream issue for qdldl. See the issue on poetry : python-poetry/poetry#6712

and the apparent solution: python-poetry/poetry#6712 (comment)

in order for poetry to be able to properly install qdldl.

DLL load failing for OSQP solver in version 0.1.5.post2

When using cvxpy for optimization, I am getting the following error message:

(CVXPY) Dec 20 02:25:38 PM: Encountered unexpected exception importing solver OSQP:
ImportError('DLL load failed while importing qdldl: The specified module could not be found.')

This error only occurs when qdldl-python==0.1.5.post2. If I update my conda environment to qdldl-python==0.1.5, it fixes the issue, which suggests that the issue might be resulting from the post2 release of qdldl.

See also: cvxpy/cvxpy#1946

Support batch inputs

Eg

A = sparse.eye(5)
s = qdldl.Solver(A)
rhs = np.random.randn(5, 2)
s.solve(rhs)

The pure python implementation would be something like
[s.solve(rhs[:,i]) for i in range(rhs.shape[1])]

Most of the numpy/scipy solve commands support this so it might be nice.

Error installing on Windows 10

I get the following error when trying to install qdldl on Windows 10 (Python 3.10.2):

PS C:\Users\user> pip install qdldl
Collecting qdldl
  Using cached qdldl-0.1.5.post0.tar.gz (69 kB)
  Preparing metadata (setup.py) ... done
Requirement already satisfied: numpy>=1.7 in c:\users\user\appdata\local\programs\python\python310\lib\site-packages (from qdldl) (1.22.1)
Requirement already satisfied: scipy>=0.13.2 in c:\users\user\appdata\local\programs\python\python310\lib\site-packages (from qdldl) (1.7.3)
Building wheels for collected packages: qdldl
  Building wheel for qdldl (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [52 lines of output]
      running bdist_wheel
      running build
      running build_ext
      -- Selecting Windows SDK version  to target Windows 10.0.19043.
      CMake Error at CMakeLists.txt:4 (project):
        Failed to run MSBuild command:

          MSBuild.exe

        to get the value of VCTargetsPath:

          Microsoft (R) Build Engine version 17.0.0+c9eb9dd64 for .NET Framework
          Copyright (C) Microsoft Corporation. All rights reserved.

          Build started 31/01/2022 10:53:56.
          Project "C:\Users\user\AppData\Local\Temp\pip-install-c17wh9nq\qdldl_e61c73a0a0a546d1b29e8c207a057446\c\build\CMakeFiles\3.22.2\VCTargetsPath.vcxproj" on node 1 (default targets).
          C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Microsoft\VC\v170\Microsoft.CppBuild.targets(436,5): error MSB8020: The build tools for Visual Studio 2015 (Platform Toolset = 'v140') cannot be found. To build using the v140 build tools, please install Visual Studio 2015 build tools.  Alternatively, you may upgrade to the current Visual Studio tools by selecting the Project menu or right-click the solution, and then selecting "Retarget solution". [C:\Users\user\AppData\Local\Temp\pip-install-c17wh9nq\qdldl_e61c73a0a0a546d1b29e8c207a057446\c\build\CMakeFiles\3.22.2\VCTargetsPath.vcxproj]
          Done Building Project "C:\Users\user\AppData\Local\Temp\pip-install-c17wh9nq\qdldl_e61c73a0a0a546d1b29e8c207a057446\c\build\CMakeFiles\3.22.2\VCTargetsPath.vcxproj" (default targets) -- FAILED.

          Build FAILED.

          "C:\Users\user\AppData\Local\Temp\pip-install-c17wh9nq\qdldl_e61c73a0a0a546d1b29e8c207a057446\c\build\CMakeFiles\3.22.2\VCTargetsPath.vcxproj" (default target) (1) ->
          (PrepareForBuild target) ->
            C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Microsoft\VC\v170\Microsoft.CppBuild.targets(436,5): error MSB8020: The build tools for Visual Studio 2015 (Platform Toolset = 'v140') cannot be found. To build using the v140 build tools, please install Visual Studio 2015 build tools.  Alternatively, you may upgrade to the current Visual Studio tools by selecting the Project menu or right-click the solution, and then selecting "Retarget solution". [C:\Users\user\AppData\Local\Temp\pip-install-c17wh9nq\qdldl_e61c73a0a0a546d1b29e8c207a057446\c\build\CMakeFiles\3.22.2\VCTargetsPath.vcxproj]

              0 Warning(s)
              1 Error(s)

          Time Elapsed 00:00:00.66


        Exit code: 1



      -- Configuring incomplete, errors occurred!


It seems the process looks for Visual Studio 2015 build tools. Is it really necessary to downgrade to Visual Studio 2015 to build qdldl?

Build fails on i386, armv7 architectures

Log: http://beefy17.nyi.freebsd.org/data/main-i386-default/p561775_sb7ab6832cd/logs/py37-qdldl-0.1.5.p0.log (IPv6 URL)

cc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -fPIC -Ic -Ic/qdldl/include -I/usr/local/lib/python3.7/site-packages/pybind11/include -I/usr/local/lib/python3.7/site-packages/pybind11/include -I/usr/local/include/python3.7m -c cpp/wrapper.cpp -o build/temp.freebsd-13.0-ALPHA1-i386-3.7/cpp/wrapper.o -O3 -std=c++11
cc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -fPIC -Ic -Ic/qdldl/include -I/usr/local/lib/python3.7/site-packages/pybind11/include -I/usr/local/lib/python3.7/site-packages/pybind11/include -I/usr/local/include/python3.7m -c cpp/qdldl.cpp -o build/temp.freebsd-13.0-ALPHA1-i386-3.7/cpp/qdldl.o -O3 -std=c++11
cpp/qdldl.cpp:34:25: error: no matching function for call to 'amd_l_order'
        QDLDL_int amd_status = amd_l_order(nx, Ap, Ai, P, NULL, NULL);
                               ^~~~~~~~~~~
c/amd/include/amd.h:60:18: note: candidate function not viable: no known conversion from 'QDLDL_int *' (aka 'int *') to 'const long long *' for 2nd argument
SuiteSparse_long amd_l_order    /* see above for description of arguments */
                 ^
1 error generated.
error: command 'cc' failed with exit status 1
*** Error code 1

OS: FreeBSD 12.2

QDLDL silently fails when sizes are wrong

It seems like you can pass in a rhs to QDLDL that is not the right shape. Might be worth checking in python-world before solving.

Here's a minimum working example:

from scipy import sparse
import numpy as np
import qdldl

A = sparse.eye(10)
b = np.random.randn(8)

factor = qdldl.Solver(A)
print (factor.solve(b)) # evalutes to (...., 0, 0)

You seem to have forgotten to add the qdldl code

You have not actually included the updated qdldl code in your distro....so installs from pypi and even from a download are not working. I manually added the module in to test and install - that worked.

Can't install qdldl via setup.py

In a blank folder, here's my setup.py:

from setuptools import setup, find_packages

setup(
    name="test",
    packages=find_packages(),
    install_requires=[
        "qdldl",
    ],
)

When I run python setup.py install, I get the following printout:

CMake Error: The source directory "/tmp/easy_install-w2_fim2u/qdldl-0.1.1/c" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.
Error: could not load cache
cpp/qdldl.cpp:1:10: fatal error: qdldl.hpp: No such file or directory
 #include "qdldl.hpp"
          ^~~~~~~~~~~
compilation terminated.
error: Setup script exited with error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

Cannot open include file: 'qdldl_types.h': No such file or directory

I use python 3.10 x64 on windows 11. However I cann't install qdldl via pip install qdldl, I have tried both vs 2019 and vs 2022.

shell logs
D:\code\weixin\wecom-ynu>pip install cvxpy
Collecting cvxpy
  Downloading cvxpy-1.2.0-cp310-cp310-win_amd64.whl (832 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 832.9/832.9 KB 2.3 MB/s eta 0:00:00
Collecting osqp>=0.4.1
  Downloading osqp-0.6.2.post5-cp310-cp310-win_amd64.whl (278 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 278.5/278.5 KB 1.4 MB/s eta 0:00:00
Requirement already satisfied: scipy>=1.1.0 in c:\users\liu.d.h\appdata\local\programs\python\python310\lib\site-packages (from cvxpy) (1.8.0)
Collecting ecos>=2
  Downloading ecos-2.0.10-cp310-cp310-win_amd64.whl (68 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 68.5/68.5 KB 1.9 MB/s eta 0:00:00
Requirement already satisfied: numpy>=1.15 in c:\users\liu.d.h\appdata\local\programs\python\python310\lib\site-packages (from cvxpy) (1.22.2)
Collecting scs>=1.1.6
  Downloading scs-3.2.0-cp310-cp310-win_amd64.whl (8.1 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 8.1/8.1 MB 6.9 MB/s eta 0:00:00
Collecting qdldl
  Downloading qdldl-0.1.5.post0.tar.gz (69 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 69.1/69.1 KB ? eta 0:00:00
  Preparing metadata (setup.py) ... done
Building wheels for collected packages: qdldl
  Building wheel for qdldl (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [29 lines of output]
      running bdist_wheel
      running build
      running build_ext
      -- Selecting Windows SDK version  to target Windows 10.0.22000.
      CMake Error at CMakeLists.txt:4 (project):
        Failed to run MSBuild command:

          MSBuild.exe

        to get the value of VCTargetsPath:

          The system cannot find the file specified



      -- Configuring incomplete, errors occurred!
      See also "C:/Users/Liu.D.H/AppData/Local/Temp/pip-install-n_emjwy9/qdldl_9ff300c6d45349718d72defe58fac30c/c/build/CMakeFiles/CMakeOutput.log".
      The system cannot find the file specified
      CMake Error: Generator: execution of make failed. Make command was: MSBuild.exe qdldlamd.vcxproj /p:Configuration=Release /p:Platform=x64 /p:VisualStudioVersion=14.0 /v:m &&
      building 'qdldl' extension
      creating build
      creating build\temp.win-amd64-3.10
      creating build\temp.win-amd64-3.10\Release
      creating build\temp.win-amd64-3.10\Release\cpp
      C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.30.30705\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ic -Ic\qdldl\include -IC:\Users\Liu.D.H\AppData\Local\Programs\Python\Python310\lib\site-packages\pybind11\include -IC:\Users\Liu.D.H\AppData\Local\Programs\Python\Python310\lib\site-packages\pybind11\include -IC:\Users\Liu.D.H\AppData\Local\Programs\Python\Python310\include -IC:\Users\Liu.D.H\AppData\Local\Programs\Python\Python310\Include -IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.30.30705\ATLMFC\include -IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.30.30705\include -IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um -IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt -IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\shared -IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um -IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\winrt -IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\cppwinrt /EHsc /Tpcpp\qdldl.cpp /Fobuild\temp.win-amd64-3.10\Release\cpp\qdldl.obj -std=c++11
      cl : Command line warning D9002 : ignoring unknown option '-std=c++11'
      qdldl.cpp
      c\qdldl/include/qdldl.h(5): fatal error C1083: Cannot open include file: 'qdldl_types.h': No such file or directory
      error: command 'C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.30.30705\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for qdldl
  Running setup.py clean for qdldl
Failed to build qdldl
Installing collected packages: scs, qdldl, ecos, osqp, cvxpy
  Running setup.py install for qdldl ... error
  error: subprocess-exited-with-error

  × Running setup.py install for qdldl did not run successfully.
  │ exit code: 1
  ╰─> [29 lines of output]
      running install
      running build
      running build_ext
      -- Selecting Windows SDK version  to target Windows 10.0.22000.
      CMake Error at CMakeLists.txt:4 (project):
        Failed to run MSBuild command:

          MSBuild.exe

        to get the value of VCTargetsPath:

          The system cannot find the file specified



      -- Configuring incomplete, errors occurred!
      See also "C:/Users/Liu.D.H/AppData/Local/Temp/pip-install-n_emjwy9/qdldl_9ff300c6d45349718d72defe58fac30c/c/build/CMakeFiles/CMakeOutput.log".
      The system cannot find the file specified
      CMake Error: Generator: execution of make failed. Make command was: MSBuild.exe qdldlamd.vcxproj /p:Configuration=Release /p:Platform=x64 /p:VisualStudioVersion=14.0 /v:m &&
      building 'qdldl' extension
      creating build
      creating build\temp.win-amd64-3.10
      creating build\temp.win-amd64-3.10\Release
      creating build\temp.win-amd64-3.10\Release\cpp
      C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.30.30705\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ic -Ic\qdldl\include -IC:\Users\Liu.D.H\AppData\Local\Programs\Python\Python310\lib\site-packages\pybind11\include -IC:\Users\Liu.D.H\AppData\Local\Programs\Python\Python310\lib\site-packages\pybind11\include -IC:\Users\Liu.D.H\AppData\Local\Programs\Python\Python310\include -IC:\Users\Liu.D.H\AppData\Local\Programs\Python\Python310\Include -IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.30.30705\ATLMFC\include -IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.30.30705\include -IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um -IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt -IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\shared -IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um -IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\winrt -IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\cppwinrt /EHsc /Tpcpp\qdldl.cpp /Fobuild\temp.win-amd64-3.10\Release\cpp\qdldl.obj -std=c++11
      cl : Command line warning D9002 : ignoring unknown option '-std=c++11'
      qdldl.cpp
      c\qdldl/include/qdldl.h(5): fatal error C1083: Cannot open include file: 'qdldl_types.h': No such file or directory
      error: command 'C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.30.30705\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> qdldl

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.

D:\code\weixin\wecom-ynu>set PATH=C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin;%PATH%
D:\code\weixin\wecom-ynu>pip install cvxpy
Collecting cvxpy
  Using cached cvxpy-1.2.0-cp310-cp310-win_amd64.whl (832 kB)
Collecting ecos>=2
  Using cached ecos-2.0.10-cp310-cp310-win_amd64.whl (68 kB)
Requirement already satisfied: scs>=1.1.6 in c:\users\liu.d.h\appdata\local\programs\python\python310\lib\site-packages (from cvxpy) (3.2.0)
Collecting osqp>=0.4.1
  Using cached osqp-0.6.2.post5-cp310-cp310-win_amd64.whl (278 kB)
Requirement already satisfied: scipy>=1.1.0 in c:\users\liu.d.h\appdata\local\programs\python\python310\lib\site-packages (from cvxpy) (1.8.0)
Requirement already satisfied: numpy>=1.15 in c:\users\liu.d.h\appdata\local\programs\python\python310\lib\site-packages (from cvxpy) (1.22.2)
Collecting qdldl
  Using cached qdldl-0.1.5.post0.tar.gz (69 kB)
  Preparing metadata (setup.py) ... done
Building wheels for collected packages: qdldl
  Building wheel for qdldl (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [52 lines of output]
      running bdist_wheel
      running build
      running build_ext
      -- Selecting Windows SDK version  to target Windows 10.0.22000.
      CMake Error at CMakeLists.txt:4 (project):
        Failed to run MSBuild command:

          MSBuild.exe

        to get the value of VCTargetsPath:

          Microsoft (R) Build Engine version 16.11.2+f32259642 for .NET Framework
          Copyright (C) Microsoft Corporation. All rights reserved.

          Build started 2022/3/22 9:49:39.
          Project "C:\Users\Liu.D.H\AppData\Local\Temp\pip-install-872phw2g\qdldl_04c3c60317d64359b0a66449445a2223\c\build\CMakeFiles\3.22.1\VCTargetsPath.vcxproj" on node 1 (default targets).
          C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppBuild.targets(439,5): error MSB8020: The build tools for Visual Studio 2015 (Platform Toolset = 'v140') cannot be found. To build using the v140 build tools, please install Visual Studio 2015 build tools.  Alternatively, you may upgrade to the current Visual Studio tools by selecting the Project menu or right-click the solution, and then selecting "Retarget solution". [C:\Users\Liu.D.H\AppData\Local\Temp\pip-install-872phw2g\qdldl_04c3c60317d64359b0a66449445a2223\c\build\CMakeFiles\3.22.1\VCTargetsPath.vcxproj]
          Done Building Project "C:\Users\Liu.D.H\AppData\Local\Temp\pip-install-872phw2g\qdldl_04c3c60317d64359b0a66449445a2223\c\build\CMakeFiles\3.22.1\VCTargetsPath.vcxproj" (default targets) -- FAILED.

          Build FAILED.

          "C:\Users\Liu.D.H\AppData\Local\Temp\pip-install-872phw2g\qdldl_04c3c60317d64359b0a66449445a2223\c\build\CMakeFiles\3.22.1\VCTargetsPath.vcxproj" (default target) (1) ->
          (PrepareForBuild target) ->
            C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppBuild.targets(439,5): error MSB8020: The build tools for Visual Studio 2015 (Platform Toolset = 'v140') cannot be found. To build using the v140 build tools, please install Visual Studio 2015 build tools.  Alternatively, you may upgrade to the current Visual Studio tools by selecting the Project menu or right-click the solution, and then selecting "Retarget solution". [C:\Users\Liu.D.H\AppData\Local\Temp\pip-install-872phw2g\qdldl_04c3c60317d64359b0a66449445a2223\c\build\CMakeFiles\3.22.1\VCTargetsPath.vcxproj]

              0 Warning(s)
              1 Error(s)

          Time Elapsed 00:00:00.49


        Exit code: 1



      -- Configuring incomplete, errors occurred!
      See also "C:/Users/Liu.D.H/AppData/Local/Temp/pip-install-872phw2g/qdldl_04c3c60317d64359b0a66449445a2223/c/build/CMakeFiles/CMakeOutput.log".
      Microsoft (R) Build Engine version 16.11.2+f32259642 for .NET Framework
      Copyright (C) Microsoft Corporation. All rights reserved.

      MSBUILD : error MSB1009: Project file does not exist.
      Switch: qdldlamd.vcxproj
      building 'qdldl' extension
      creating build
      creating build\temp.win-amd64-3.10
      creating build\temp.win-amd64-3.10\Release
      creating build\temp.win-amd64-3.10\Release\cpp
      C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.30.30705\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ic -Ic\qdldl\include -IC:\Users\Liu.D.H\AppData\Local\Programs\Python\Python310\lib\site-packages\pybind11\include -IC:\Users\Liu.D.H\AppData\Local\Programs\Python\Python310\lib\site-packages\pybind11\include -IC:\Users\Liu.D.H\AppData\Local\Programs\Python\Python310\include -IC:\Users\Liu.D.H\AppData\Local\Programs\Python\Python310\Include -IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.30.30705\ATLMFC\include -IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.30.30705\include -IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um -IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt -IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\shared -IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um -IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\winrt -IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\cppwinrt /EHsc /Tpcpp\qdldl.cpp /Fobuild\temp.win-amd64-3.10\Release\cpp\qdldl.obj -std=c++11
      cl : Command line warning D9002 : ignoring unknown option '-std=c++11'
      qdldl.cpp
      c\qdldl/include/qdldl.h(5): fatal error C1083: Cannot open include file: 'qdldl_types.h': No such file or directory
      error: command 'C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.30.30705\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for qdldl
  Running setup.py clean for qdldl
Failed to build qdldl
Installing collected packages: qdldl, ecos, osqp, cvxpy
  Running setup.py install for qdldl ... error
  error: subprocess-exited-with-error

  × Running setup.py install for qdldl did not run successfully.
  │ exit code: 1
  ╰─> [52 lines of output]
      running install
      running build
      running build_ext
      -- Selecting Windows SDK version  to target Windows 10.0.22000.
      CMake Error at CMakeLists.txt:4 (project):
        Failed to run MSBuild command:

          MSBuild.exe

        to get the value of VCTargetsPath:

          Microsoft (R) Build Engine version 16.11.2+f32259642 for .NET Framework
          Copyright (C) Microsoft Corporation. All rights reserved.

          Build started 2022/3/22 9:49:59.
          Project "C:\Users\Liu.D.H\AppData\Local\Temp\pip-install-872phw2g\qdldl_04c3c60317d64359b0a66449445a2223\c\build\CMakeFiles\3.22.1\VCTargetsPath.vcxproj" on node 1 (default targets).
          C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppBuild.targets(439,5): error MSB8020: The build tools for Visual Studio 2015 (Platform Toolset = 'v140') cannot be found. To build using the v140 build tools, please install Visual Studio 2015 build tools.  Alternatively, you may upgrade to the current Visual Studio tools by selecting the Project menu or right-click the solution, and then selecting "Retarget solution". [C:\Users\Liu.D.H\AppData\Local\Temp\pip-install-872phw2g\qdldl_04c3c60317d64359b0a66449445a2223\c\build\CMakeFiles\3.22.1\VCTargetsPath.vcxproj]
          Done Building Project "C:\Users\Liu.D.H\AppData\Local\Temp\pip-install-872phw2g\qdldl_04c3c60317d64359b0a66449445a2223\c\build\CMakeFiles\3.22.1\VCTargetsPath.vcxproj" (default targets) -- FAILED.

          Build FAILED.

          "C:\Users\Liu.D.H\AppData\Local\Temp\pip-install-872phw2g\qdldl_04c3c60317d64359b0a66449445a2223\c\build\CMakeFiles\3.22.1\VCTargetsPath.vcxproj" (default target) (1) ->
          (PrepareForBuild target) ->
            C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppBuild.targets(439,5): error MSB8020: The build tools for Visual Studio 2015 (Platform Toolset = 'v140') cannot be found. To build using the v140 build tools, please install Visual Studio 2015 build tools.  Alternatively, you may upgrade to the current Visual Studio tools by selecting the Project menu or right-click the solution, and then selecting "Retarget solution". [C:\Users\Liu.D.H\AppData\Local\Temp\pip-install-872phw2g\qdldl_04c3c60317d64359b0a66449445a2223\c\build\CMakeFiles\3.22.1\VCTargetsPath.vcxproj]

              0 Warning(s)
              1 Error(s)

          Time Elapsed 00:00:00.22


        Exit code: 1



      -- Configuring incomplete, errors occurred!
      See also "C:/Users/Liu.D.H/AppData/Local/Temp/pip-install-872phw2g/qdldl_04c3c60317d64359b0a66449445a2223/c/build/CMakeFiles/CMakeOutput.log".
      Microsoft (R) Build Engine version 16.11.2+f32259642 for .NET Framework
      Copyright (C) Microsoft Corporation. All rights reserved.

      MSBUILD : error MSB1009: Project file does not exist.
      Switch: qdldlamd.vcxproj
      building 'qdldl' extension
      creating build
      creating build\temp.win-amd64-3.10
      creating build\temp.win-amd64-3.10\Release
      creating build\temp.win-amd64-3.10\Release\cpp
      C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.30.30705\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ic -Ic\qdldl\include -IC:\Users\Liu.D.H\AppData\Local\Programs\Python\Python310\lib\site-packages\pybind11\include -IC:\Users\Liu.D.H\AppData\Local\Programs\Python\Python310\lib\site-packages\pybind11\include -IC:\Users\Liu.D.H\AppData\Local\Programs\Python\Python310\include -IC:\Users\Liu.D.H\AppData\Local\Programs\Python\Python310\Include -IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.30.30705\ATLMFC\include -IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.30.30705\include -IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um -IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt -IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\shared -IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um -IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\winrt -IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\cppwinrt /EHsc /Tpcpp\qdldl.cpp /Fobuild\temp.win-amd64-3.10\Release\cpp\qdldl.obj -std=c++11
      cl : Command line warning D9002 : ignoring unknown option '-std=c++11'
      qdldl.cpp
      c\qdldl/include/qdldl.h(5): fatal error C1083: Cannot open include file: 'qdldl_types.h': No such file or directory
      error: command 'C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.30.30705\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> qdldl

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.

D:\code\weixin\wecom-ynu>

M1 - "No Cmake" (with workaround)

Observed:

  RuntimeError: CMake must be installed to build qdldl

Tried:

$ xcode-select --install
xcode-select: error: command line tools are already installed, use "Software Update" to install updates

Resovled:

conda install cmake
pip install qdldl

Memory leak

I think there's a memory leak somewhere. For example, if I run many repeated solves with a single factorization, I see the memory consumption jump up much higher than it should.

Here's a simple example that makes it pretty obvious on my laptop:

import scipy.sparse as sp
import numpy as np
import qdldl as ldl

N = int(1e4)
runs = int(1e5)

A = sp.eye(N, format='csc', dtype='float64')
b = np.random.randn(N)

F = ldl.Solver(A)
# memory usage is fine up to this point

# memory usage goes through the roof with many repeated solves
for i in range(runs):
    F.solve(b)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.