How to install opencv with tbb support using mingw

How to install Opencv with TBB support?

I tried the following:

1) TBB package loaded.

2) Build using the following command

mingw32-make compiler=gcc arch=ia32 runtime=mingw default 

3) I set the environment variable path as "d: \ tbb \ build \ windows_ia32_gcc_mingw_release

3) Now, using cmake, I turned on "WITH_TBB" and compiled opencv.

causing an error below.

 [ 22%] Built target pch_Generate_opencv_core Linking CXX shared library ..\..\bin\libopencv_core245.dll c:/mingw/bin/../lib/gcc/mingw32/4.6.2/../../../../mingw32/bin/ld.exe: cannot fin d -ltbb collect2: ld returned 1 exit status make[2]: *** [bin/libopencv_core245.dll] Error 1 make[1]: *** [modules/core/CMakeFiles/opencv_core.dir/all] Error 2 make: *** [all] Error 2 

I missed something ... Please advice.

+4
source share
1 answer

I had the same problem, to fix the tbb binding error the following was developed:

(Assuming you already created tbb, as you already explain in your question)

  • Configure OpenCV once from CMake

  • Enable WITH_TBB , be careful not to BUILD_TBB : automatic loading and building OpenCV failed miserably for me, despite a lot of effort. If you previously enabled BUILD_TBB , my suggestion is to restart from the beginning, clear the CMake cache.

  • Configure OpenCV a second time

  • Some variables should now appear: TBB_INCLUDE_DIRS . For me, I set the following values ​​(respectively):

    tbb41_20130314oss/include

  • Two new variables will appear: TBB_STDDEF_PATH and TBB_LIB_DIR . They are assigned some apparently reasonable values. For me, TBB_STDDEF_PATH was correct, but TBB_LIB_DIR not! So I fixed this:

    tbb41_20130314oss/build/windows_ia32_gcc_mingw4.8.1_release

    and I left TBB_STDDEF_PATH as it is:

    tbb41_20130314oss/include/tbb/tbb_stddef.h

  • Set the third time

  • Finally, click Create and you are ready to create mingw32-make -j7

  • Once you start using the opencv library, make sue that the tbb dlls are in your path.

+10
source

Source: https://habr.com/ru/post/1482893/


All Articles