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

4 views (last 30 days)
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.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 30 Apr 2020
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
()
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:

More Answers (0)

s manbetx 845


Release

R2018b

Community Treasure Hunt

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

Start Hunting!