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

Fix tbb config #119

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
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
7 changes: 6 additions & 1 deletion cmake/templates/TBBConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,12 @@ foreach (_tbb_component ${TBB_FIND_COMPONENTS})
list(APPEND TBB_IMPORTED_TARGETS TBB::${_tbb_component})
set(TBB_${_tbb_component}_FOUND 1)
elseif (TBB_FIND_REQUIRED AND TBB_FIND_REQUIRED_${_tbb_component})
message(FATAL_ERROR "Missed required Intel TBB component: ${_tbb_component}")
Copy link
Contributor

Choose a reason for hiding this comment

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

This FATAL_ERROR can appear only if TBB_FIND_REQUIRED AND TBB_FIND_REQUIRED_${_tbb_component}. I.e. only if the requested component is required.

With your change you also will get FATAL_ERROR in case of find_package(TBB QUIET REQUIRED):

CMake Error at CMakeLists.txt:7 (find_package):
  Found package configuration file:

    /tmp/tbb2019_20181203oss/cmake/TBBConfig.cmake

  but it set TBB_FOUND to FALSE so package "TBB" is considered to be NOT
  FOUND.

Could you please explain a use case when this change has effect?

Copy link
Author

Choose a reason for hiding this comment

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

YES!

I want to attempt to use a custom FindTBB.cmake that exists in my project in order to overcome problems with broken os installed versions of TBB.

Use case "Use system version of TBB if it can be found and configured correctly, else (disable tbb capabilites|build tbb from source|use custom FindTBB.cmake that does more brute force introspection of the system with different rules).

The current homebrew installed version of TBB uses "TBBMakeConfig.cmake" to generate a TBBConfig.cmake file with incorrect hard-coded paths to the wrong directories for finding the libraries. If TBB is installed on the system, there is no recovery in any way.

I'm trying to get a TBB dependant tool to build and be tested on the Travis continuous integration environment. Installing TBB from homebrew causes build failure for the reasons above. Trying to install TBB from source fails as well because the instructions for building from source for a cmake project require access to api.github.com (which is prohibited from CI environments).

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok, thank you for explanation, I think this change (removal of fatal error) is ready to be integrated.

message(STATUS "Missed required Intel TBB component: ${_tbb_component}")
# Do not use FATAL_ERROR message as that
# breaks find_package(TBB QUIET) behavior
set(TBB_FOUND FALSE) # Set TBB_FOUND considered to be NOT FOUND if
# required components missing
set(TBB_${_tbb_component}_FOUND 0)
endif()
endforeach()

Expand Down