Mismangement of MATLAB path in CVXv2.2 and external GUROBI v9.0.2


I am facing an issue with CVXv2.2 and external installation of gurobi (academic licensed).

I have Gurobi installed and added to MATLAB path. However, on running the following commands removes gurobi from my path`

cvx_solver Gurobi_2

Why is that?

There was some path clobbering in earlier builds of CVX 2.2, but I think they may be resolved in the current build (1148), or at least don’t manifest in as many cases… So if you’re not using build 1148, try installing it.

Thank you for the quick response. I am using the current build 1148.

The output of cvx_version

CVX: Software for Disciplined Convex Programming       (c)2014 CVX Research
Version 2.2, Build 1148 (62bfcca)                  Tue Jan 28 00:51:35 2020
Installation info:
    Path: /home/ubuntu/Documents/MATLAB/cvx
    MATLAB version: 9.8 (R2020a)
    OS: Linux amd64 version 4.4.0-1106-aws
    Java version: 1.8.0_202
Verfying CVX directory contents:
    WARNING: The following files/directories are missing:
    These omissions may prevent CVX from operating properly.
    Path: /home/ubuntu/.matlab/cvx_prefs.mat
Installed license:
    No license installed.

A minimal working example to demonstrate this issue.

>> cvx_solver SDPT3;cvx_save_prefs;                           % Reset CVX
>> addpath '/home/ubuntu/Documents/MATLAB/gurobi902/linux64/matlab';cvx_setup;
>> cvx_solver Gurobi_2;cvx_save_prefs;cvx_solver;
>> contains(path, 'gurobi')                                               % Returns 1
>> cvx_begin; variable a; minimize(a); cvx_end             % Solves this correctly
>> contains(path, 'gurobi')                                              % Returns 0