-
-
Notifications
You must be signed in to change notification settings - Fork 671
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
COMP: add FindTBB.cmake from VTK #991
Conversation
- this allows ITK to find TBB also on Windows (TBBConfig.cmake is not generated on Windows) - I tried to make it backwards compatible, i.e. use the current mechanism (find TBBConfig.cmake), and only if it fails use the FindTBB.cmake
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will also test this on my computer.
set(COMPILER_PREFIX "vc11") | ||
elseif(MSVC_VERSION EQUAL 1800) | ||
set(COMPILER_PREFIX "vc12") | ||
elseif(MSVC_VERSION EQUAL 1900) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
VS2019 is missing:
1910-1919 = VS 15.0 (v141 toolset)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing 1920 (Visual Studio 2019 RTW (16.0)). Both 15.0 and 16.0 use vc14 folder.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could add lines like:
elseif(MSVC_VERSION GREATER 1900 AND MSVC_VERSION LESS 1920)
set(COMPILER_PREFIX "vc15")
elseif(MSVC_VERSION EQUAL 1920 OR MSVC_VERSION EQUAL 1921)
set(COMPILER_PREFIX "vc16")
But the most recent pre-compiled version of TBB does not come with those folders (yet?).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The newer versions all use vc14's compiled libraries, because they are binary compatible with it. So put something like:
elseif(MSVC_VERSION GREATER 1900 AND MSVC_VERSION LESS 1920)
set(COMPILER_PREFIX "vc14")
elseif(MSVC_VERSION EQUAL 1920 OR MSVC_VERSION EQUAL 1921)
set(COMPILER_PREFIX "vc14")
or:
elseif(MSVC_VERSION GREATER 1800 AND MSVC_VERSION LESS 1929)
set(COMPILER_PREFIX "vc14") # expect all compilers in 192X series to have same binary compatibility as 1920 and 1921.
I tried it on my computer, and it either worked or was not triggered due to the existence of |
Hi, I am trying to build ITK with TBB. Thank you, |
On my computer, |
As reported on the forum, this patch does not work as expected. |
Commented in the forum. I don't understand what nm97 means by "run examples". I am happy to spend a bit more time to improve/fix the patch. |
Initially, I added a message to the FindTBB.cmake, to debug if cmake would enter into that file. It did for my build of TBB. |
Testing .... |
I stumbled upon this PR trying to figure out how to build ITK with TBB. I succeeded to build VTK with TBB, I just had to provide a path for each lib and the headers folder. But for ITK, it seems to want me to point to Is the purpose of this patch to make ITK work like VTK, where one would just need to point to the libraries? |
If I need to specify path to 10 lib files once, that is fine but not ideal. If I need to do that frequently, it is super annoying. The purpose of this patch seems to be ability to specify TBB via means other than The best solution is to bite the bullet and add code which generates If you think you can make TBB work without Additional relevant links: |
Here is a PR I use to get TBB working for me, which automatically downloaded it: As I recall the proposed idea was not general enough to be accepted. |
I ended up patching the TBBConfig.cmake to include a tbb prefix. Our build of tbb has a prefix to avoid conflicts with thirdparty libs pulling in a potentially different version of tbb. |
PR Checklist
Refer to the ITK Software Guide for
further development details if necessary.