-
Notifications
You must be signed in to change notification settings - Fork 1.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
Implement CMake-based build of TBB for easy embedding into open-source projects #6
Comments
I maintain a CMake build system overlay here: https://github.com/wjakob/tbb |
I would be happy to sign this over under any license so that Intel can incorporate the changes into their regular TBB releases (in fact, I'd be more than happy because I wouldn't have keep updating the build system for each and every new version. :)) |
Hello, wjakob. |
Hello, All. |
I'm not sure that's what people asked for. Your "CMake integration" ignores the host CMake project and just shells out to make to build TBB, and is thus more or less worthless (you might as well just provide a TBB-config.cmake file to simplify a Find call), as it ignores the compile options and other CMake project settings. It also ignores the CMake build settings; I can't build a "RelWithDebug" using this integration, I can just build the stuff which is already pre-packaged in the binary release, but it may or may not be ABI compatible with what I'm currently compiling. A find module for CMake would have been more useful than this wrapper. If you're going the build route, why not use While I'm really happy there's progress on this front, @wjakob CMake integration remains much more useful for CMake based projects. |
Agreed -- I plan to continue maintaining my repository. @tbbdev: if you'd like to integrate my CMakeLists.txt (or a variant thereof) into the official distribution at some point, you have my permission (and I am happy to sign an CLA). It would make my life easier ;) |
I really appreciate the effort to add CMake integration via configure scripts. However, the current version seems quite buggy; and because it is not integrated into the default build, it is not usable since Recommendations: do one or both of the following:
See here for an example of adding TBBConfig to the brew formula, and if you try it on macOS, you'll find it is broken, component tbb cannot be found. |
@tbbdev - I just found this thread, and I highly agree with integrating @wjakob -> https://github.com/wjakob/tbb One of the biggest uses is to use this repo as a submodule that you can build and include in your project or deployment and the I highly support rolling in @wjakob 's changes into this repo !!!! |
Just a side comment on how easy it is to build TBB on Windows. Please take a look at how conda-forge builds TBB package: |
This is not relevant for CMake-configured C++ projects that want to use TBB as a dependency. The majority of C++ project build systems use CMake. While adoption of CMake for TBB itself from @wjakob would be great, the intermediate step of always generating TBBConfig.cmake from the Makefile would be a good incremental step forward, as suggested by @henryiii . Also, it seems that the generation of TBBConfig.cmake with cmake/tbb_config_generator.cmake does not appear to support binaries generated from a local source build. |
Is there someone still working on this issue? Many people have already chimed in and outlined the main issues with the current approach.... what CMake users really need is along the lines of https://github.com/tschw/tbb/blob/target-exports/CMakeLists.txt , which is a fork of https://github.com/wjakob/tbb (already mentioned above). The fork exports the necessary configuration files (i.e. generates appropriate find_package(tbb)
target_link_libraries(my_project PRIVATE tbb::tbb_static) and potentially use the flag I don't know what the plans for the future of this project is, but having a quality CMake support should be at the top of the priority list.... it's been already 2 years since the issue was raised.... |
In our project we are also heavily relying on the ExternalProject_Add mechanism, which makes integration of other CMake-based code extremely smooth. Replacing OpenMP with TBB would be very helpful for us, especially given the OpenMP limitations in Visual Studio, but we do not want to fragment our build process again, after finally having something consistently CMake-based. So +1 from us... |
Hi all, +1 for us too. Having the TBBConfig.cmake generated when building is very good. But I agree with previous comments that having TBB use CMake to build from source would be great. That would allow inclusion in ExternalProject_Add very much easier, especially for use with the ITK library. Is there any plan for this soon? |
If direct CMake support is not an option at the moment, can we get a |
@tbbdev Any chance of getting a proper cmake support any time soon? |
I too would like to see improvements to the CMake scripts. Courtesy of @wjakob I have the following configuration using FetchContent:
Would love to replace that git repo with the official Intel one. |
TBB 2019 U5 has a new CMake module for config generation: TBBInstallConfig.cmake (developed in scope of PRs #119, #126, #127). It is not included into the TBB Makefile as a separate target yet, but can be used as a CMake module or from command line via wrapper script. |
Well, @Anteru explains the issue in his answer above:
So reasons for building sources are mostly:
|
Thanks for the suggestion. I am a bit new to cmake and I was not able to understand (from reading the documentation) how to use what was provided. On the other hand the FetchContent based approach follows easily from the documentation/examples and worked straight away.
I went for building from source because it was not clear that the released binaries would be compatible with the version of clang that I am using and the standard library that I am linking against. I also want the ability to have different versions of our software utilising different versions of TBB so I don't want to use system install directories. |
Note that the pre-built TBB release binaries do have debug information. |
I'm sorry but I still think this issue is relevant to this day. I just tried Also, does TBBuild supports compiling with static runtime ( PS: The CMake script in @wjakob's fork is not without issue either, as indicated by the 4 open issues on the project page (e.g. it fiddles with the |
The biggest issue with @wjakob's script is that it does not properly export targets or generate a config. Building with clang for llvm-pstl is not possible unless you go for a tagged and shared library - which is often unacceptable. |
Hi all, I'm glad to announce that TBB migrated to CMake in oneAPI 2021.1-beta08 release. Source code was published to onetbb_2021 branch. Some instructions are provided in cmake/README.md. Feel free to provide your feedback and contributions. |
CMake support was implemented as described above. Closing the request. Please submit new issues/PRs for problems and proposals. |
Signed-off-by: Alexei Katranov <alexei.katranov@intel.com>
Signed-off-by: Alexei Katranov <alexei.katranov@intel.com>
Signed-off-by: Alexei Katranov <alexei.katranov@intel.com>
Signed-off-by: Alexei Katranov <alexei.katranov@intel.com>
Signed-off-by: Alexei Katranov <alexei.katranov@intel.com>
Signed-off-by: Alexei Katranov <alexei.katranov@intel.com>
Signed-off-by: Alexei Katranov <alexei.katranov@intel.com>
Signed-off-by: Alexei Katranov <alexei.katranov@intel.com>
Signed-off-by: Alexei Katranov <alexei.katranov@intel.com>
Signed-off-by: Alexei Katranov <alexei.katranov@intel.com>
Signed-off-by: Alexei Katranov <alexei.katranov@intel.com>
Signed-off-by: Alexei Katranov <alexei.katranov@intel.com>
Signed-off-by: Alexei Katranov <alexei.katranov@intel.com>
See discussion at #2 (comment)
The text was updated successfully, but these errors were encountered: