cvxr / CVX

A MATLAB system for disciplined convex programming
Other
226 stars 83 forks source link

Failing to Register Gurobi License on Windows System with Path Which Includes Spaces #13

Closed RoyiAvital closed 5 months ago

RoyiAvital commented 4 years ago

Hello, I tried registering academic license of Gurobi. I had failed messages on cvx_grbgetkey() function.

On the latest version at the moment (Version 2.2, January 2020, Build 1148) there is at line 299 the following:

[status,result]=system( sprintf( '%s --path=%s %s', gname, tdir, kcode ) ); %#ok

The issue is in case the path of gname or tdir includes spaces the operation fails. In order to support spaces the string should have " at the beginning and the end.

So something like the following will fix it:

gname = ['"', gname, '"'];
tdir = ['"', tdir, '"'];
mcg1969 commented 5 months ago

Closing this in favor of the open-sourced Gurobi shim to come (which will need fixing anyway!)

RoyiAvital commented 5 months ago

I am excited to see new updates are coming. Thanks!