Is mcc a cross-compiler?
6 views (last 30 days)
Show older comments
Maura Monville
on 1 Feb 2021
Commented: Walter Roberson
on 1 Feb 2021
I am developing a Matlab code on my Mac.
I was asked to generape an executable that can be run on Windows.
I understand MatLab comes witha compiler for scripting language "mcc".
I understand I have to install the MATLAB Compiler Runtime (MCR).
What is not clear is where I need the MCR.
Do I need the MCR on my Mac or do I need the MCR on the Windows workstation where the execuable will be run?
Furthermore, if I produce an executable on my Mac, using a MatLab version for Mac, then will such an executable be running on a Windows platform? I fesr that execuables generated on a Mac can only be run n a Mac.
Please, advise.
Thank you
Maura M. (maura.monville@nhs.net)
0 Comments
Accepted Answer
Walter Roberson
on 1 Feb 2021
You need to compile on the same operating system as the program will be executed on.
For example you could install Bootcamp and Windows 10, use your MATLAB license there (same license because it is the same host) and build for execution on Windows.
2 Comments
Walter Roberson
on 1 Feb 2021
MATLAB Compiler and MATLAB Compiler SDK include MCR. Historically you could choose to bundle MCR inside the executable or to not bundle it, in which case you either had to send it to the user separately or else the user had to install it from Mathworks. I am not sure whether the option to bundle it in the executable is still present.
MCR is needed to execute the resulting executable. Technically speaking, I am not sure it is needed to also compile the executable, but as the person doing the compiling would want to test the executable at least once, effectively it becomes mandatory on the host doing the compiling. But it is also a moot point because it is included inside the only two products that you can use to compile with to generate an executable, so it is going to be there anyhow unless you delete it.
MCR is not a development environment: it is the Mathworks Component Runtime, used to execute only.
More Answers (0)
See Also
Categories
Find more on C Shared Library Integration in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!