codegen: Do I need to include the source generated under the "interface" directory when building a library on a different platform?

1 次查看(过去 30 天)
I am successfully generating code for a basic algorithm that does not depend on any toolboxes. I am using the following configuration settings:
% Set up the configuration cfg = coder.config('lib');
cfg.TargetLang = 'C++'; cfg.TargetLangStandard = 'C99 (ISO)'
cfg.GenerateReport = false; cfg.LaunchReport = false; cfg.EnableVariableSizing = true;
cfg.GenCodeOnly = true; cfg.GenerateExampleMain = 'DoNotGenerate';
The output produces a folder called "interface". So far I am able to build without including the source files in the "interface" folder, but I'd like to know what they are just in case I'm incorrectly building my library. Are the files in the "interface" folder necessary when building on a different platform? If not now, will they become necessary if I start to export code that depends on MatLab toolboxes?

采纳的回答

Ryan Livingston
Ryan Livingston 2016-5-26
You don't need to include the code in the interface folder. That code is used for things like Software-in-the-Loop (SIL) and Processor-in-the-Loop (PIL).
To reliably package the generated code and other dependencies for compilation elsewhere, you can use packNGo which is described in the documentation.
If you are generating code for another platform, make sure to set up the HardwareImplementation property of the configuration object to match the integer sizes and other properties of that platform. You can also choose from many pre-configured options by changing cfg.HardwareImplementation.ProdHWDeviceType and possibly cfg.HardwareImplementation.TargetHWDeviceType. Using the Coder app to change these settings may be easier than the command line or you can open the Coder configuration UI to edit cfg by running:
open cfg
in MATLAB.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 MATLAB Coder 的更多信息

标签

产品

Community Treasure Hunt

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

Start Hunting!

Translated by