Ask Your Question
1

Can't use OpenCV with TBB enabled (default_num_threads not found)

asked 2017-08-16 09:38:20 -0600

a.francesconi gravatar image

updated 2017-08-17 02:39:17 -0600

Hello, I'm following this guide to compile OpenCV 3.3.0 for Windows 32bit.

In particular, I would like to enable Intel's TBB so I followed the last chapter, step-by-step. Here is the steps I did in details:

  • I downloaded the latest release of TBB for Windows here: https://github.com/01org/tbb/releases...
  • Extracted it in C:\dev\tbb2017_20170604oss_win folder
  • In Cmake, after Configure, my variables are:
    • BUILD_TBB = FALSE
    • TBB_ENV_INCLUDE = C:/dev/tbb2017_20170604oss/include
    • TBB_ENV_LIB = C:/dev/tbb2017_20170604oss/lib/ia32/vc14/tbb.lib
    • TBB_ENV_LIB_DEBUG = C:/dev/tbb2017_20170604oss/lib/ia32/vc14/tbb_debug.lib
    • TBB_VER_FILE = C:/dev/tbb2017_20170604oss/include/tbb/tbb_stddef.h
    • WITH_TBB = TRUE

The Visual Studio project is generated and I can compile everything without problems (using BUILD_ALL). After that, I build the INSTALLER sub-project to populate the "installer" folder with all the compiled files.

I link the new OpenCV distribution to my project. It compiles fine too, but when the project start it throws this error:

The procedure entry point ?default_num_threads@task_scheduler_init@tbb@@SAHXZ could not be located in the dynamic link library [...]\opencv_core330.dll

Did I miss something while configuring/compiling OpenCV? Thanks for the help

edit retag flag offensive close merge delete

Comments

Seems like you have problem loading dll or you're loading wrong version .

Ziri gravatar imageZiri ( 2017-08-16 11:33:35 -0600 )edit

It could be, but what dll? In the same level of "opencv_core330.dll" there are all the others opencv_*.dll. I tried to put there also the dlls from Intel TBB (located in tbb2017_20170604oss\bin\ia32\vc14), but no luck. About the wrong version... is there a "right" one? As I wrote, I used the latest release of Intel TBB... maybe I must use a different version? I don't see any documentation about that.

a.francesconi gravatar imagea.francesconi ( 2017-08-17 01:59:25 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
2

answered 2017-08-17 16:06:55 -0600

mshabunin gravatar image

You have to call tbbvars script before building and runing application, it will set all necessary environment variables. Try to run it like this: <path-to-tbb>\bin\tbbvars.bat intel64 vs2015

You can omit all TBB_* cmake parameters, just pass -DWITH_TBB=ON -DBUILD_TBB=OFF.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2017-08-16 09:38:20 -0600

Seen: 3,644 times

Last updated: Aug 17 '17