Knitro solver

428 views
Skip to first unread message

Domagoj-Krešimir Jukić

unread,
Jul 5, 2022, 3:52:26 AM7/5/22
to CasADi
Hi,

I'm solving a MINLP. Currently, I'm using BONMIN which is working, but I'm trying to move to Knitro for the optimization. I have installed knitro and I have a license (the provided MATLAB examples are working). However, if I set the solver to knitro inside my CasADi problem, I get the error:

CasADi -  WARNING(".../casadi/core/plugin_interface.hpp:322: Assertion "handle!=nullptr" failed:
PluginInterface::load_plugin: Cannot load shared library 'libcasadi_nlpsol_knitro.dll':
   (
    Searched directories: 1. casadipath from GlobalOptions
                          2. CASADIPATH env var
                          3. PATH env var (Windows)
                          4. LD_LIBRARY_PATH env var (Linux)
                          5. DYLD_LIBRARY_PATH env var (osx)
    A library may be 'not found' even if the file exists:
          * library is not compatible (different compiler/bitness)
          * the dependencies are not found
   )
  Tried 'D:\MATLAB\Dispatch\PSPP - 986 LYS\casadi-windows-matlabR2016a-v3.5.5' :
    Error code (WIN32): 126
  Tried '' :
    Error code (WIN32): 126
  Tried '.' :
    Error code (WIN32): 126") [.../casadi/core/plugin_interface.hpp:171]
Error using casadi.nlpsol (line 988)
.../casadi/core/plugin_interface.hpp:417: Plugin 'knitro' is not found.


The library libcasadi_nlpsol_knitro.dll' exists and it is provided with CasADi (I'm using version v3.5.5). I assume that there is an error in the installation. Is there a step-by-step guide on how to include knitro to CasADi in MATLAB?

Thanks and greeting,
Domagoj

Domagoj-Krešimir Jukić

unread,
Jul 5, 2022, 4:23:32 AM7/5/22
to CasADi
Hi,

I tried an additional solution proposed in 
and it worked by changing the name of the .dll "knitro.dll" to "knitro1032.dll". In the newest knitro version (v13.1.0) the .dll does not contain the version name, so I assume that a simple edit of the "libcasadi_nlpsol_knitro.dll" might solve the problem for future users.
As it is a duplicate of the linked discussion, this post could also be deleted.

Greetings,
Domagoj

Charles Khazoom

unread,
Aug 13, 2022, 1:12:34 PM8/13/22
to CasADi
Hi,

Did the MINLP work with knitro in Casadi ? using knitro v13.0.1, I can solve NLPs, but MINLP's don't work (does not even start solving)

Reply all
Reply to author
Forward
0 new messages