-
Notifications
You must be signed in to change notification settings - Fork 1k
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
ittnotify: use untouched library #1456
base: master
Are you sure you want to change the base?
Conversation
@clementperon, the CI is showing link errors. |
38c23bb
to
5618ad2
Compare
Sorry indeed, Let me check on my CI first. |
09761e6
to
de786a3
Compare
I don't think we can remove ittnotify from TBB |
@pavelkumbrasev My plan is not to remove it but to link with a proper library/target. In my project i'm linking with both TBB and ITT, and as TBB is redefining ITT symbols. It creates an issue at link time. |
@dnmokhov Sorry for spamming the CI i thought putting it in draft would have stopped the CI to run. in order to clean a bit more I think moving the itt_notify.cpp and itt_notify.h to src/ittapi would be also cleaner. What do you think? |
@dnmokhov @pavelkumbrasev @isaevil any feedback on this? |
@clementperon I don't really think that storing an archive in the repo is a good idea. It leaves us without the ability to apply particular workarounds if any issues with third-parties occur without waiting for them to be upstreamed (@pavelkumbrasev @dnmokhov what do you think?). Could you please describe a little bit more your issue with linkage? I've tried locally to fetch both oneTBB and ittnotify in the same CMake project and it worked: CMakeLists.txtcmake_minimum_required(VERSION 3.5)
project(sample)
include(FetchContent)
# Fetch oneTBB
FetchContent_Declare(
oneTBB
GIT_REPOSITORY https://github.com/oneapi-src/oneTBB.git
GIT_TAG master
)
FetchContent_Declare(
ittnotify
GIT_REPOSITORY https://github.com/intel/ittapi.git
GIT_TAG master
)
FetchContent_MakeAvailable(oneTBB)
FetchContent_MakeAvailable(ittnotify)
add_executable(sample main.cpp)
target_link_libraries(sample TBB::tbb ittnotify)
main.cpp#include "tbb/tbb.h"
#include "ittnotify.h"
void pseudoComputation(int n) {
tbb::parallel_for(0, n, [](int i) {
for (volatile int j = 0; j < 1000000; ++j)
;
});
}
int main() {
__itt_resume();
pseudoComputation(42);
__itt_pause();
}
|
You can still patch an archive with FetchContent()
The error i'm trying to deal with is:
|
Description
I build Intel oneTBB and Intel ITT in the same project.
Leading to symbols defined multiple times at link time.
Fixes # -
Explicit link with ittapi::ittnotify library
Avoid duplicating the library if ittapi::ittnotify already exist
Type of change
Explicit the ittapi library and properly fetch it.
Add a respective label(s) to PR if you have permissions
Tests
Documentation
Breaks backward compatibility
Notify the following users
@JhaShweta1
Other information