osqp / osqp-matlab

Matlab interface for OSQP
https://osqp.org/
Apache License 2.0
42 stars 25 forks source link

Getting codegen to work in MATLAB #38

Open makeller1 opened 3 years ago

makeller1 commented 3 years ago

After troubleshooting getting codegen to work in MATLAB, I've got some errors to report and solutions for people struggling like I was. If these cannot be fixed, it would be helpful to have some messages in the docs about these specifics.

Solution:

  1. Install the minGW compiler from TDM-GCC at https://jmeubank.github.io/tdm-gcc/download/
  2. Add this line to your matlab code: setenv('MW_MINGW64_LOC', 'C:\TDM-GCC-64');
  3. Add this line to your matlab code: setenv('PATH', [getenv('PATH') ';C:\TDM-GCC-64\bin']); where C:\TDM-GCC-64 is replaced in 2 and 3 with the location of your TDM-GCC installation.

Solution:

  1. Delete the osqp folder.
  2. Set matlab's working directory to a short path.
  3. Reinstall osqp using the same commands as before.