Generate Code From a Model That Uses an External Linux Library

I have a Simulink model which currently calls a Windows library (.dll) using S-functions. I would now like to generate code from my model for a Linux target (such as ARM). How do I link against the Linux version of the library for use on the target?

 채택된 답변

MathWorks Support Team
MathWorks Support Team 2018년 5월 15일

0 개 추천

To use the Windows library for simulation and Linux library for code generation, you must first install the Linux library on your target. Then, in your Simulink model, navigate to Model Configuration Parameters > Code Generation > Custom Code. Under "Additional build information", specify the path and name of the library in "Libraries". Specify any necessary header files and include directories as needed in the other fields. When the model deploys to the target, it will then link against this library.
More information about including external code during code generation can be found here:
Please note that the library information specified in "Custom Code" is only used for code generation, and not for simulation. Simulation information can be specified in the "Simulation Target" section of Model Configuration Parameters.
Finally, note that you must have TLC files for your S-functions if you want to inline them in the generated code. More information about this can be found at the link below.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Simulink Coder에 대해 자세히 알아보기

제품

릴리스

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by