CVX_setup Macbook pro M2 error


I have been trying to install cvx_setup through MATLAB on my mac M2 pro but am receiving the error below. Please advise on how I can resolve this issue. I have removed the path for privacy.

Many thanks!


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:
MATLAB version: 23.2 (R2023b)
OS: Mac OS X x86_64 version 14.3
Java version: 1.8.0_202
Verfying CVX directory contents:
No missing files.

Setting CVX paths…already set!
Searching for solvers…4 shims found.
2 solvers initialized (* = default):

  • SDPT3 4.0 {cvx}/sdpt3
    SeDuMi 1.3.4 {cvx}/sedumi
    2 solvers skipped:
    Could not find a GLPK installation.
    Mosek unknown
    Could not find a MOSEK MEX file.
    Saving updated preferences…done.
    Testing with a simple model…
    UNEXPECTED ERROR: ------------------------------------------------
    Undefined function ‘mexnnz’ for input arguments of type ‘double’.
    Error in checkdepconstr (line 97)
    nnzmatold = mexnnz(AAt);
    Error in sqlpmain (line 93)
    Error in sqlp (line 242)
    Error in cvx_run_solver (line 50)
    [ varargout{1:nargout} ] = sfunc( inputs{:} );
    Error in cvx_sdpt3>solve (line 362)
    [ obj, xx, y, zz, info ] = cvx_run_solver( @sqlp, blk, Avec, Cvec,
    b, OPTIONS, ‘obj’, ‘x’, ‘y’, ‘z’, ‘info’, settings, 5 ); %#ok
    Error in cvxprob/solve (line 435)
    [ x, status, tprec, iters ] = shim.solve( At, b, c,
    cones, quiet, prec, solv.settings, eargs{:} );
    Error in cvx_end (line 88)
    solve( prob );
    Error in cvx_setup (line 213)

Please report this error to support, and include entire output of
CVX_SETUP in your support request.

Look through these links

Since you output shows

OS: Mac OS X x86_64 version 14.3

then you use the Intel CPU version of MATLAB. You should use the Apple Silicon version.

Hi Earling, I am using the version below and still getting the error.

You can use the Intel macOS release. It should work. I don’t think there is anybody who can tell you for sure why you are getting this error. Maybe there is something incomplete about your CVX installation or you have some permission issues. Try to start all over again in a completely clean Matlab session and a clean CVX installation.

On the other hand what Erling suggests is that you can also try the Apple Sillicon release of Matlab and use Announcement: CVX for Apple Silicon In principle this is closer to the hardware.