osqp icon indicating copy to clipboard operation
osqp copied to clipboard

mkl_rt library in Windows renamed in MKL 2021 => dll import failing

Open lequant40 opened this issue 4 years ago • 2 comments

Hello there !

Trying to setup OSQP with MKL Pardiso under Windows, the library is not anymore named mkl_rt.dll but mkl_rt.2.dll !

This makes the dll load fail with error:

ERROR in lh_load_lib: Windows error while loading dynamic library mkl_rt.dll, error = 126

The code portion in OSQP which references the old name is there -> https://github.com/osqp/osqp/blob/0b34f2ef5c5eec314e7945762e1c8167e937afbd/lin_sys/direct/pardiso/pardiso_loader.c#L8

(Plus in the documentation, like there -> https://osqp.org/docs/get_started/linear_system_solvers.html)

The solution for Windows users is simple (manually rename the lib), but still, I think it would be great if you could include an auto-detection for the proper lib name in OSQP instead of hardcodes (like PyPardiso ->https://github.com/haasad/PyPardisoProject/pull/13).

Cheers,

Roman

lequant40 avatar Feb 01 '22 22:02 lequant40

Any update to this? It seems the install instructions are out of date. There is no file called mklvars.bat anywhere I can see. Manually setting PATH and LIB, and renaming to mkl_rt.dll as above gets me as far as not getting a message about not being able to find the dll, but then R crashes when I try to solve.

travis-leith avatar Jul 31 '22 10:07 travis-leith

Are not you supposed to compile your own mkl_rt.dll with only the functions you need?

ValZapod avatar Oct 07 '22 18:10 ValZapod