blob: e8e58ea3141cb095ff2aab1aaf75da377e527bce [file] [log] [blame]
Austin Schuh9049e202022-02-20 17:34:16 -08001Matlab
2======
3OSQP Matlab interface requires Matlab 2015b or newer.
4
5
6Binaries
7--------
8
9Precompiled platform-dependent Matlab binaries are available on `GitHub <https://github.com/osqp/osqp-matlab/releases>`_.
10
11To install the interface, just run the following commands:
12
13.. code:: matlab
14
15 websave('install_osqp.m','https://raw.githubusercontent.com/osqp/osqp-matlab/master/package/install_osqp.m');
16 install_osqp
17
18
19Sources
20-------
21
22You need to install the following (see :ref:`build_from_sources` for more details):
23
24- A supported 64bit `C/C++ compiler <https://www.mathworks.com/support/compilers.html>`_
25- `CMake <https://cmake.org/>`_
26
27
28
29After you install both, check that your compiler is selected by executing
30
31.. code:: matlab
32
33 mex -setup
34
35.. note::
36
37 **Windows**: If Matlab does not find TDM-GCC, you need to set the environment variable :code:`MW_MINGW64_LOC` as follows
38
39 .. code:: matlab
40
41 setenv('MW_MINGW64_LOC', 'C:\TDM-GCC-64')
42
43
44 where :code:`C:\TDM-GCC-64` is the installation folder for TDM-GCC.
45
46You can now build the interface by running inside Matlab
47
48.. code:: matlab
49
50 !git clone --recurse-submodules https://github.com/osqp/osqp-matlab
51 cd osqp-matlab
52 make_osqp
53
54
55Then you can add the interface to the search path by executing from the same directory
56
57.. code:: matlab
58
59 addpath(pwd)
60 savepath