Embedded coder duplicates rtw_linux.h header file in generated code package, prohibiting usage of the packNGo function
2 次查看(过去 30 天)
显示 更早的评论
Linux installation of Embedded coder generates two identical rtw_linux.h header files for a single Simulink model that prohibits the use of Package generated code in ZIP file for relocation - MATLAB packNGo (mathworks.com) function. The error message is thrown as follows:
>> packNGo(buildInfo)
Error using RTW.BuildInfo/checkForDups
The following files have the same file name which cannot be packaged
together in a flat hierarchy:
/usr/local/MATLAB/R2022a/rtw/c/src/rtw_linux.h
/home/oscar/MATLAB/Projects/slexMulticoreExample1/work/slprj/ert/_sharedutils/rtw_linux.h
Error in coder.make.internal.packNGo>locPackFlat (line 149)
buildInfo.checkForDups(fPathNames,names);
Error in coder.make.internal.packNGo (line 111)
locPackFlat(buildInfo,args,buildDir);
Error in RTW.BuildInfo/packNGo (line 58)
coder.make.internal.packNGo(buildInfo, varargin{:});
This error can be reproduced using the following steps:
- Download the slexMulticoreExample.zip attachment, which is modified based on the Assigning Tasks to Cores for Multicore Programming - MATLAB & Simulink (mathworks.com) example.
- Load slexMulticoreExample.mlproj from the .zip attachment in MATLAB R2022a Update 1 installed under Ubuntu 22.04 LTS, Simulink automatically opens slexMulticoreExample.slx model.
- Send Ctrl+B shortcut to the already opened slexMulticoreExample.slx to generate code from this model.
- Inspect the generated code package at [project root]/work/slexMulticoreExample.zip, note that rtw_linux.h has been included twice at both "/R2022a/rtw/c/src/rtw_linux.h" and "/work/slprj/ert/_sharedutils/rtw_linux.h"
- load buildInfo.mat from "/work/slexMulticoreExample_ert_rtw/buildInfo.mat" into Workspace and execute "packNGo(buildInfo)" in the Command Window to see the error message from the top of this page.
Bug report 2632466 mentioned a similar phenomenon as above. However, the error above was thrown using MATLAB R2022a Update 1, instead of being fixed in R2022a as stated in the bug report. How to work around this bug?
0 个评论
回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!