Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[tbb] compile error(s) if TBB_USE_DEBUG is defined #13846

Closed
2 of 7 tasks
OliverSCE opened this issue Nov 3, 2022 · 7 comments · Fixed by #13906
Closed
2 of 7 tasks

[tbb] compile error(s) if TBB_USE_DEBUG is defined #13846

OliverSCE opened this issue Nov 3, 2022 · 7 comments · Fixed by #13906
Labels

Comments

@OliverSCE
Copy link

OliverSCE commented Nov 3, 2022

Description

  • compile error(s) if TBB_USE_DEBUG is defined

(TBB_USE_DEBUG is defined automatically if using cmake via TBBTargets.cmake)

Verification

Windows Version

Microsoft Windows Version = "10.0.19041.1806"

MINGW environments affected

  • MINGW64
  • MINGW32
  • UCRT64
  • CLANG64
  • CLANG32
  • CLANGARM64

Expected behavior

should compile

Actual behavior

1.)
C:/msys64/mingw64/include/oneapi/tbb/profiling.h:148:36: error: cannot convert 'const char*' to 'const tbb::detail::d0::tchar*' {aka 'const wchar_t*'}
148 | r1::itt_set_sync_name(obj, name);

2.) (only in Qt-Projects)
C:/msys64/mingw64/include/oneapi/tbb/profiling.h:229:15: error: expected unqualified-id before ')' token
229 | void emit() { }

(name clash with Qt's emit)

Repro steps

echo -e "#include <execution>\nint main(){}" >main.cpp
gcc -DTBB_USE_DEBUG main.cpp -ltbb12

Are you willing to submit a PR?

No response

@OliverSCE OliverSCE added the bug label Nov 3, 2022
@OliverSCE OliverSCE changed the title [tbb] [tbb] compile error(s) if TBB_USE_DEBUG is defined Nov 3, 2022
@MehdiChinoune
Copy link
Collaborator

I don't see any reproducer!

@OliverSCE
Copy link
Author

...updated...

@MehdiChinoune
Copy link
Collaborator

TBB were not built with Debug Build Type, What do you expect?

@OliverSCE
Copy link
Author

I expect to be able to build an application in debug mode via cmake. As gcc implements the standard parallel C++ features via tbb, there is no other option.

The issue has nothing to do with TBB beeing or not beeing build with DEBUG Type. The compilation fails in the headers, long before any debug-type lib would be linked.

They issue can be easily avoided, if the TBB_USE_DEBUG defines is omitted. However, this define is set by TBBTargets.cmake for any project build in debug mode.

For me the solution is simple. As I don't need the TBB_USE_DEBUG functionality at all, I have edited TBBTargets.cmake accordingly.

I hope the issue becomes clearer now.

@OliverSCE
Copy link
Author

Just to be clear: the issue is related to building in debug mode, not release mode.

To my humble opinion the setting of TBB_USE_DEBUG in TBBTargets.cmake for a debug target is something which should be avoided.

@MehdiChinoune
Copy link
Collaborator

@OliverSCE I have opened a PR to fix the issue in #13906
Please consider testing the artifacts and see if it fixes the issue.

@OliverSCE
Copy link
Author

Thanks.
this fixes issue #1 from above.

Issue #2 (name clash with emit from Qt) is still there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants