Is mcc a cross-compiler?
조회 수: 8 (최근 30일)
이전 댓글 표시
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
채택된 답변
Walter Roberson
2021년 2월 1일
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
Walter Roberson
2021년 2월 1일
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.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 C Shared Library Integration에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!