LINK : fatal error LNK1181: cannot open input file 'lapack.lib'

459 Views Asked by At
LINK : fatal error LNK1181: cannot open input file 'lapack.lib'
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Tools\\MSVC\\14.34.31933\\bin\\HostX86\\x64\\link.exe' failed with exit code 1181

I'm getting this error while installing cvxopt. I've set the directory for lapack lib in the setup.py file inside the cvxopt folder. However running the command

python setup.py install

generates this error. Can anyone help me with this?

1

There are 1 best solutions below

1
Cory Kramer On

If you use pip install cvxopt it will use a pre-built binary wheel package already.

If you want to build from source (as you are currently doing) then you need to have BLAS and LAPACK installed on your system
https://cvxopt.org/install/#building-and-installing-from-source

Required and optional software

The package requires version 3.x of Python, and building from source requires core binaries and header files and libraries for Python.

The installation requires BLAS and LAPACK. Using an architecture optimized implementation such as ATLAS, OpenBLAS, or MKL is recommended and gives a large performance improvement over reference implementations of the BLAS and LAPACK libraries.

The installation also requires SuiteSparse. We recommend linking against a shared SuiteSparse library. It is also possible to build the required components of SuiteSparse when building CVXOPT, but this requires the SuiteSparse source which is no longer included with CVXOPT and must be downloaded separately.

The following software libraries are optional.

  • The GNU Scientific Library GSL.
  • FFTW is a C library for discrete Fourier transforms.
  • GLPK is a linear programming package.
  • MOSEK version 9 is a commercial library of convex optimization solvers.
  • DSDP5.8 is a semidefinite programming solver.