You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
In MATLAB 2021a the supported minGW compiler (installed in the MATLAB gui as a support package) fails with error "Error configuring CMAKE environment" because "CMAKE_MAKE_PROGRAM" is not set. The osqp docs currently suggest installing this compiler through a url to matlab's supported compilers, so this error is bound to happen for others.
Add this line to your matlab code: setenv('MW_MINGW64_LOC', 'C:\TDM-GCC-64');
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.
When installing osqp from the MATLAB terminal using the commands given in the osqp docs: >>websave('install_osqp.m', 'https://dl.bintray.com/bstellato/generic/OSQP/0.6.2/install_osqp.m'); >>install_osqp
the installation is saved to whatever directory is matlab's current working directory. If this path is too long, codegen will fail at some point due to mex.
Solution:
Delete the osqp folder.
Set matlab's working directory to a short path.
Reinstall osqp using the same commands as before.
The text was updated successfully, but these errors were encountered:
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:
setenv('MW_MINGW64_LOC', 'C:\TDM-GCC-64');
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.
>>websave('install_osqp.m', 'https://dl.bintray.com/bstellato/generic/OSQP/0.6.2/install_osqp.m');
>>install_osqp
the installation is saved to whatever directory is matlab's current working directory. If this path is too long, codegen will fail at some point due to mex.
Solution:
The text was updated successfully, but these errors were encountered: