oneTBB icon indicating copy to clipboard operation
oneTBB copied to clipboard

CMake: add option TBB_INSTALL

Open phprus opened this issue 3 years ago • 3 comments
trafficstars

Signed-off-by: Vladislav Shchapov [email protected]

Description

Make installation optional.

In the case of including oneTBB using add_subdirectory, it may require a custom installation rules.

Fixes # - issue number(s) if exists

  • [x] - git commit message contains an appropriate signed-off-by string (see CONTRIBUTING.md for details)

Type of change

Choose one or multiple, leave empty if none of the other choices apply

Add a respective label(s) to PR if you have permissions

  • [ ] bug fix - change that fixes an issue
  • [ ] new feature - change that adds functionality
  • [ ] tests - change in tests
  • [x] infrastructure - change in infrastructure and CI
  • [ ] documentation - documentation update

Tests

  • [ ] added - required for new features and some bug fixes
  • [x] not needed

Documentation

  • [x] updated in this PR
  • [ ] needs to be updated
  • [ ] not needed

Breaks backward compatibility

  • [ ] Yes
  • [x] No
  • [ ] Unknown

Notify the following users

List users with @ to send notifications

Other information

phprus avatar Mar 07 '22 10:03 phprus

Hi @phprus, I'd like to double check that I got the use case properly: you want to have oneTBB added into your project with add_subdirectory but don't want oneTBB to be installed when you run make install for your project. Right? And all you need - is to wrap all the installation instructions for oneTBB under condition with a new option TBB_INSTALL without other modifications of installation instructions. Right?

AlexVeprev avatar Mar 11 '22 15:03 AlexVeprev

  1. Yes;
  2. Yes.

I use this patch (and set TBB_INSTALL to OFF) and custom install() commands (and some additional options for tbb* targets) for tbb, tbbmalloc, tbbmalloc_proxy targets in parent cmake project.

phprus avatar Mar 11 '22 18:03 phprus

Ping?

phprus avatar Jul 01 '22 12:07 phprus

Rebased onto current master.

phprus avatar Oct 01 '22 13:10 phprus

Rebased

phprus avatar Nov 05 '22 18:11 phprus

@pavelkumbrasev, @isaevil what do you think about this PR?

phprus avatar Dec 19 '22 08:12 phprus

@pavelkumbrasev, @isaevil, @kboyarinov ping?

phprus avatar Feb 05 '23 10:02 phprus

Rebased

phprus avatar Feb 13 '23 16:02 phprus

Rebased and ping.

phprus avatar May 22 '23 20:05 phprus

Rebased to resolve conflicts with current master.

Request review @isaevil, @pavelkumbrasev, @dnmokhov, @ilya-lavrenov

phprus avatar Oct 28 '23 15:10 phprus

@phprus can you just use add_subdirectory with EXCLUDE_FROM_ALL option? It will ignore TBB install rules.

ilya-lavrenov avatar Oct 28 '23 21:10 ilya-lavrenov

@ilya-lavrenov, Thank you for your reply!

EXCLUDE_FROM_ALL by default disables test compilation and does not allow to set custom installation rules for targets.

I need build/run all tests and install targets tbb, tbbmalloc, tbbmalloc_proxy with custom DESTINATIONs and COMPONENTs options.

Since the build system has the TBB_INSTALL_VARS option, I suggest adding a option to completely disable the installation.

phprus avatar Oct 29 '23 07:10 phprus

EXCLUDE_FROM_ALL by default disables test compilation

Why do you need to build tests when TBB (or other external project) is used as submodule and included into main project via add_subdirectory? It's a good practice to include external projects with EXCLUDE_FROM_ALL option

does not allow to set custom installation rules for targets

It allows. But there are some corner cases (like we had with pugixml https://github.com/zeux/pugixml/pull/585 in OpenVINO). So, in general I agree that it's better to disable install rules.

ilya-lavrenov avatar Oct 29 '23 10:10 ilya-lavrenov

@ilya-lavrenov

Why do you need to build tests when TBB (or other external project) is used as submodule and included into main project via add_subdirectory?

We try to run tests for all dependencies. Sometimes this helps to find bugs in dependencies. Sometimes we use our own patches for dependencies, which requires running tests. For example, for oneTBB: this PR, #1114 and #714.

phprus avatar Oct 29 '23 11:10 phprus