Using CVX with Gurobi Version 11.0.0

Is it possible to use CVX with a newer version of Gurobi? (I want to use the latest Gurobi version 11.0.0). I added this new version to my MATLAB path however when I use cvx_setup it is skipping the Gurobi version I want to use, instead it uses Gurobi 9.0.

....
Setting CVX paths...done.
Saving updated path...done.
Searching for solvers...5 shims found.
3 solvers initialized (* = default):
    Gurobi     9.00       {cvx}/gurobi/maci64
 *  SDPT3      4.0        {cvx}/sdpt3
    SeDuMi     1.3.4      {cvx}/sedumi
4 solvers skipped:
    GLPK                  
        Could not find a GLPK installation.
    Gurobi_2   unknown    /Library/gurobi1100/macos_universal2/matlab
        result = gurobi(model, params)
    Gurobi_3   unknown    /Library/gurobi1100/macos_universal2/matlab
        result = gurobi(model, params)
    Mosek      unknown    
        Could not find a MOSEK MEX file.
Saving updated preferences...done.
Testing with a simple model...done!
....

How do I initialize Gurobi_2 ? Any help would be greatly appreciated.
Thank you!

It might be that Gurobi 11.0 is not compatible with CVX. If anyone has had success, they should post it here.

Gurobi 11 introduced incompatibilities with the existing YALMIP interface to Gurobi. So that doesn’t sound promising for CVX 2.2, whose last build was 4 years ago.

The CVX interface with older versions of Gurobi might be buggy, resulting in some error messages, and some incorrect problem solutions.

Unfortunately, neither the CVX developer nor anyone from Gurobi are active on this forum. This is the only remaining support channel for CVX. So you will probably have to figure things out for yourself to try to get Gurobi 11 to work under CVX.

To my best knowledge Gurobi was incompatible with CVX already for quite long:

I was told by @mcg (and I share this information with his explicit permission) that in the long run his plan is to make CVX open source including the currently obfuscated commercial solver interfaces. Then everybody will be able to adapt and fix them.

1 Like

Soon I will be opening up the Gurobi shim and including it in the open-source build of CVX. Once that’s done, I’m sure someone will be able to offer a fix.

1 Like

I have a preliminary gurobi shim here:

I have it working with Gurobi 11 on macOS Apple Silicon.

I just downloaded this version and tried, it is working with latest Gurobi on Apple Silicon, thank you so much

Fantastic! Thank you for the quick test

I’m facing the same problem with CVX and gurobi 11, but I did not understand your solution @mcg.

I would appreciate it if you could walk me through the steps tto fix the problem.

1 Like

Download the open source cvx version here: CVX Open Source

Make sure you uninstall the older cvx version and delete the paths in matlab before redownloading.

Then download the latest gurobi 11.01 for Mac.
Set up the license: https://support.gurobi.com/hc/en-us/articles/4534161999889-How-do-I-install-Gurobi-Optimizer
Setup gurobi path in matlab: https://support.gurobi.com/hc/en-us/articles/4533938303505-How-do-I-install-Gurobi-for-Matlab

Then run ‘cxv_setup’ in matlab. You will have to open ‘Privacy and Security’ in your computer’s settings and manually allow connections from cvx.

Repeat this process until there are no more privacy pop ups. Once this is finished it should recognize Gurobi as a solver and you can then use cvx as an interface.