Generate Code From a Model That Uses an External Linux Library

5 views (last 30 days)
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?

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 15 May 2018
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.

More Answers (0)

Categories

Find more on Simulink Coder in Help Center and File Exchange

Products


Release

R2017b

Community Treasure Hunt

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

Start Hunting!