Simulink Multiplatform Code Generation

I use a FMU inside a Simulink model from which I want to generate code, how could I generate multiplatform code of this Simulink model including the FMU? For example for Linux and CPU ARM.
Thank you very much in advance.
Best regards,
Víctor Sánchez Suárez

Answers (1)

Adarsh
Adarsh 10 minutes ago
As per my understanding, your goal is to use a Simulink model that imports an FMU and generate deployable code or FMUs that can run on multiple platforms, such as Linux on x86 and Linux on ARM.
In this scenario, multiplatform code generation is supported only in the following two cases.
First, this works if the imported FMU was exported with source code. In this case, the FMU does not rely on precompiled platform-specific binaries. During code generation or FMU export, the source code can be recompiled using the appropriate compiler toolchain for each target platform. This allows you to generate separate outputs for Linux x86 and Linux ARM from the same Simulink model.
Second, this also works if you maintain a single Simulink model but use a different FMU for each target platform. Each FMU must already contain binaries compiled for its respective platform. You can then generate code or export an FMU per platform by selecting the corresponding FMU during the build process.
If the imported FMU is a binary-only FMU built for a single platform, exporting the entire Simulink model as multiple FMUs will not make it portable. In that case, the original FMU binary is reused as-is, and the exported FMUs will only run on the platform for which that binary was built.
For more information the following documentation link can be referred:
If you want to export any model to an Multiplatform FMU you can refer to the following links:
I hope this helps!

Categories

Find more on Deployment, Integration, and Supported Hardware in Help Center and File Exchange

Products

Release

R2024b

Asked:

on 25 Mar 2026 at 14:09

Answered:

about 7 hours ago

Community Treasure Hunt

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

Start Hunting!