How can I generate MATLAB Coder code that does not use tbb libraries?

7 次查看(过去 30 天)
I'm using MATLAB coder for generating C++ code. I see that MATLAB uses several libraries (dlls and libs) like:
libmwmorphop_binary_tbb.lib
libmwbwlookup_tbb.lib
Which is any library in the following format: libmw*_tbb.lib or libmw*_tbb.dll.
Due to an overall system performance, I'd like to generate code that does not_* *_depend on the "tbb" libraries.

采纳的回答

MathWorks Support Team
tbb libraries, or "thread build blocks", are used for parallel programming. In this case to disable dependency for these libraries, you can launch MATLAB with the startup flag -singleCompThread
(<https://www.mathworks.com/help/matlab/ref/matlabwindows.html#buklxlz-3>)
After doing so, verify that you're in single thread mode at the MATLAB command line:
>> maxNumCompThreads
ans =
1
Once you've done this, you can proceed with your normal MATLAB Coder workflow (e.g. the MATLAB Coder App or using the "codegen" function at the command line). Then, use the "packNGo" function to zip up the generated code and dependencies. In single thread mode, you will no longer see dependencies on "tbb" libraries. See below for an example where single thread mode has no "tbb" dependency:

更多回答(0 个)

产品


版本

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by