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

Replace deprecated tbb task for tbb >= 2021 #3174

Merged
merged 23 commits into from
Mar 10, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
b8b5650
Fix typo
alexdewar Dec 13, 2021
f216564
Remove TopicManagerProcessTask as it is unused
alexdewar Dec 13, 2021
426c22e
Use oneapi::tbb::task_group instead of tbb::task if available
alexdewar Dec 13, 2021
fdbab59
Assign my copyright to OSRF
alexdewar Dec 14, 2021
c42bfe8
Add myself to AUTHORS
alexdewar Dec 14, 2021
7a7fe64
We no longer need to restrict ourselves to tbb<2021
alexdewar Dec 14, 2021
0c4b54f
Default to using tbb::task for older versions of TBB, to maintain ABI
alexdewar Dec 14, 2021
309194b
Remove C++14-ism from TaskGroup.hh
alexdewar Dec 14, 2021
a9e9aed
Use C++ macros cf. CMakery to find TBB version
alexdewar Dec 15, 2021
d89a2b0
Replace use of tbb/version.h with tbb/tbb.h
alexdewar Dec 17, 2021
212cf5e
Make sure that there are no ABI changes for tbb < 2021
traversaro Feb 13, 2022
568bf9b
Fix indentation
traversaro Feb 13, 2022
45f24b3
Update transport_pch.hh
traversaro Feb 13, 2022
a99a224
Fix linking problems
scpeters Feb 15, 2022
6b0d230
Undef more emit symboles for tbb includes
scpeters Feb 15, 2022
bf5240a
Remove trailing whitespace
scpeters Feb 15, 2022
6903800
Cleanup TAskGroup as it is used only if tbb>=2021
traversaro Feb 15, 2022
73db7c7
If tbb >= 2021 add TBB::tbb to GAZEBO_LIBRARIES for downstream users
traversaro Feb 15, 2022
d32ae31
Fix CMake configuration failure with tbb 2020
traversaro Feb 15, 2022
f1fadd0
Fix GAZEBO_TRANSPORT_TASKGROUP_HH_ header guard
traversaro Feb 17, 2022
8111c4f
For tbb >= 2021 make PublishTask::operator() const
traversaro Feb 27, 2022
4fff786
Merge branch 'gazebo11' into replace_deprecated_tbb_task
traversaro Mar 6, 2022
8f739f2
Unpin tbb-devel
traversaro Mar 6, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions gazebo/transport/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,12 @@ if (WIN32)
target_link_libraries(gazebo_transport ws2_32 Iphlpapi)
endif()

if(${CMAKE_VERSION} VERSION_LESS "3.13.0")
link_directories(${TBB_LIBRARY_DIRS})
else()
target_link_directories(gazebo_transport PUBLIC ${TBB_LIBRARY_DIRS})
endif()

if (USE_PCH)
add_pch(gazebo_transport transport_pch.hh ${Boost_PKGCONFIG_CFLAGS} "-I${PROTOBUF_INCLUDE_DIR}" "-I${TBB_INCLUDEDIR}")
endif()
Expand Down
2 changes: 2 additions & 0 deletions gazebo/transport/Connection.hh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
#ifndef _CONNECTION_HH_
#define _CONNECTION_HH_

#undef emit
#include <tbb/task.h>
#define emit

// If TBB_VERSION_MAJOR is not defined, this means that
// tbb >= 2021 and we can include the tbb/version.h header
Expand Down
2 changes: 2 additions & 0 deletions gazebo/transport/Node.hh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
#ifndef GAZEBO_TRANSPORT_NODE_HH_
#define GAZEBO_TRANSPORT_NODE_HH_

#undef emit
#include <tbb/task.h>
#define emit
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was a bit afraid of doing so as it changes also the case tbb<2021. Do you think that defining emit as empty is ok?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@traversaro emit is actually defined by Qt as empty too! It's just convention that it's used in Qt code as a pseudo-keyword.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh, cool.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hadn't thought clearly about the implications; I was just trying to get to a working build. We can wrap in #ifdefs if needed

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@scpeters Yes but that shouldn't be necessary. As I said, qt just defines it as an empty macro too.

#ifndef TBB_VERSION_MAJOR
#include <tbb/version.h>
#endif
Expand Down
1 change: 1 addition & 0 deletions tools/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ target_link_libraries(gz
gazebo_gui
gazebo_physics
gazebo_sensors
gazebo_transport
${Qt5Core_LIBRARIES}
${Qt5Widgets_LIBRARIES}
${Boost_LIBRARIES}
Expand Down