Simulink embeded coder - Cross compiler on Windows targeted to Linux machine

조회 수: 8 (최근 30일)
Forrest Chen
Forrest Chen 2024년 4월 9일
답변: Swastik Sarkar 2025년 6월 24일
I have windows installed matlab and want simulink embeded coder to do model cross compile targeted to Linux. Is it possible? my model can be compiled on Ubuntu simulink embeded coder and run in right way. but my customer only have matlab on windows and I want to find solution how to achieve this goal. if the answer is yes, please let me know detail on how-to.
Thanks
Forrest
  댓글 수: 3
Forrest Chen
Forrest Chen 2024년 4월 9일
Thanks, Manikanta. The link is related to mex. however this would not work on my case because I have cpp s-function with some so shared library (device driver), I have to use mex to generate mexa64 first before generating code and package. The mex works at matlab on linux machine but doesn't work at matlab on windows. is it possible to let mex work on windows in my case? if this pass, I can only generate code on windows and copy the code to linux machine on building.

댓글을 달려면 로그인하십시오.

답변 (1개)

Swastik Sarkar
Swastik Sarkar 2025년 6월 24일
Given that the development environment is based on Windows, a practical approach would be to compile the generated source code using the Windows Subsystem for Linux (WSL). This enables compilation within a Linux-compatible environment—such as Ubuntu—on the same Windows system. Alternatively, compilation can be performed directly on the target Ubuntu machine intended for execution.
To implement this, it is necessary to install a WSL distribution, with Ubuntu being a suitable choice. For detailed instructions and further guidance, the following MATLAB Central Answer may be helpful:
Hope this helps cross-compilation on Windows.

카테고리

Help CenterFile Exchange에서 Simulink Coder에 대해 자세히 알아보기

제품


릴리스

R2023b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by