Skip to content

Compiling issue with GAPI #15784

Closed
Closed

Description

@thewoz

Hi,

I try to compile the last version of the code under osx.

Here the cmake command:

cmake -DWITH_QT=ON -DWITH_OPENGL=ON -DWITH_TBB=ON -DBUILD_EXAMPLES=OFF -DBUILD_DOCS=OFF -DBUILD_TESTS=OFF -OPENCV_CONTRIB=OFF -DENABLE_PRECOMPILED_HEADERS=OFF -DOPENCV_GENERATE_PKGCONFIG=ON -DCMAKE_PREFIX_PATH=/Applications/Qt/5.12.3/clang_64/ ..

here the error that I get:

In file included from /Users/thewoz/Documents/GitHub/opencv/modules/gapi/src/compiler/gcompiler.cpp:31:
In file included from /Users/thewoz/Documents/GitHub/opencv/modules/gapi/src/compiler/gstreaming_priv.hpp:12:
/Users/thewoz/Documents/GitHub/opencv/modules/gapi/src/executor/gstreamingexecutor.hpp:19:12: fatal error: 'tbb/concurrent_queue.h' file not found
#  include <tbb/concurrent_queue.h> // FIXME: drop it from here!

Activity

  1. alalek commented on Oct 26, 2019

    @alalek
    Member

    -DWITH_TBB=ON

    Looks like G-API wants some fresh TBB version (missing version check).

    Possible workarounds:

    • -DWITH_TBB=OFF
    • or add -DBUILD_TBB=ON (build TBB from sources)
    • if don't need G-API then disable it: -DBUILD_opencv_gapi=OFF
  2. thewoz commented on Oct 26, 2019

    @thewoz
    ContributorAuthor

    Of course with -DBUILD_opencv_gapi=OFF is all right

    However it is strange since I have the TBB installed and I have the concurrent_queue.h file in the right place
    Looks like that in the receipt of G-API in the cmake is missing the path of TBB

  3. alalek commented on Oct 26, 2019

    @alalek
    Member

    Could you please dump compiler args. Something like:

    • make VERBOSE=1
    • or ninja -v
  4. thewoz commented on Oct 27, 2019

    @thewoz
    ContributorAuthor

    Looks like that the path for TBB is missing.

    I have the TBB installed here: /usr/local/include/tbb

    [ 73%] Building CXX object modules/gapi/CMakeFiles/opencv_gapi.dir/src/compiler/gcompiler.cpp.o
    cd /Users/thewoz/Documents/GitHub/opencv/build/modules/gapi && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++  -DCVAPI_EXPORTS -D_USE_MATH_DEFINES -D__OPENCV_BUILD=1 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/Users/thewoz/Documents/GitHub/opencv/build -I/Users/thewoz/Documents/GitHub/opencv/modules/gapi/include -I/Users/thewoz/Documents/GitHub/opencv/build/modules/gapi -I/Users/thewoz/Documents/GitHub/opencv/modules/core/include -I/Users/thewoz/Documents/GitHub/opencv/modules/imgproc/include -I/Users/thewoz/Documents/GitHub/opencv/modules/gapi/src -I/Users/thewoz/Documents/GitHub/opencv/build/3rdparty/ade/ade-0.1.1f/sources/ade/include -isystem /usr/local/include/eigen3  -fsigned-char -ffast-math -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -Wno-comment -fdiagnostics-show-option -Wno-long-long -Qunused-arguments -Wno-semicolon-before-method-body -ffunction-sections -fdata-sections  -fvisibility=hidden -fvisibility-inlines-hidden -g  -O0 -DDEBUG -D_DEBUG -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -mmacosx-version-min=10.14 -fPIC   -std=c++11 -o CMakeFiles/opencv_gapi.dir/src/compiler/gcompiler.cpp.o -c /Users/thewoz/Documents/GitHub/opencv/modules/gapi/src/compiler/gcompiler.cpp
    In file included from /Users/thewoz/Documents/GitHub/opencv/modules/gapi/src/compiler/gcompiler.cpp:31:
    In file included from /Users/thewoz/Documents/GitHub/opencv/modules/gapi/src/compiler/gstreaming_priv.hpp:12:
    /Users/thewoz/Documents/GitHub/opencv/modules/gapi/src/executor/gstreamingexecutor.hpp:19:12: fatal error: 
          'tbb/concurrent_queue.h' file not found
    #  include <tbb/concurrent_queue.h> // FIXME: drop it from here!
    
    
  5. amrosado commented on Nov 11, 2019

    @amrosado

    I also have this issue building with MSVC 2017 x64 using the WITH_TBB option. I worked around this by after generating with cmake changing opencv_gapi settings to have access to TBB using the configuration GUI interface (Intel performance libraries section). I could not fix this for some reason by specifying a specific location for the tbb includes. The best fix for this should be fixing the cmake configuration because all the other modules don't seem to have this issue.

  6. dmatveev commented on Dec 6, 2019

    @dmatveev
    Contributor

    Thanks for reporting this. @amrosado so what CMake configuration you are proposing to fix?

  7. dmatveev commented on Dec 6, 2019

    @dmatveev
    Contributor

    @alalek do we need to use anything special in our add_module thing to get TBB linked properly?

  8. alalek commented on Dec 6, 2019

    @alalek
    Member

    @thewoz @amrosado Could you please check if this patch resolves problem on your side: #16084 ?

  9. amrosado commented on Dec 6, 2019

    @amrosado

    I tested your branch and it appears to resolve the problem. I'm using CMAKE 3.16.0-rc4 and MSVC 2019. Thanks so much for your help.

  10. dmatveev commented on Dec 6, 2019

    @dmatveev
    Contributor

    @alalek cool, thanks!

  11. thewoz commented on Dec 7, 2019

    @thewoz
    ContributorAuthor

    I try patch and it seems to work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions