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

CMake FetchContent fails to install oneTBB #1375

Open
VincentRouvreau opened this issue May 2, 2024 · 1 comment
Open

CMake FetchContent fails to install oneTBB #1375

VincentRouvreau opened this issue May 2, 2024 · 1 comment

Comments

@VincentRouvreau
Copy link

I tried to install oneTBB with cmake FetchContent feature with these few lines of CMake:

cmake_minimum_required(VERSION 3.11)
project(cmake_fetch_content_onetbb VERSION 0.0)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)

include(FetchContent)
FetchContent_Declare(
  tbb
  GIT_REPOSITORY https://github.com/oneapi-src/oneTBB.git
  GIT_TAG v2021.12.0
  GIT_SHALLOW ON
)
FetchContent_MakeAvailable(tbb)

add_executable(one_tbb_example src/one_tbb_example.cpp)
target_link_libraries(one_tbb_example TBB::tbb)

But when I launch the CMake command in a fresh conda environment where only cmake is installed:

mkdir build; cd build; cmake -DCMAKE_PREFIX_PATH=$CONDA_PREFIX ..
-- The C compiler identification is GNU 11.4.0                                                                                                                                
-- The CXX compiler identification is GNU 11.4.0                                                                                                                              
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE  
-- Checking for one of the modules 'hwloc'
-- Looking for getcontext
-- Looking for getcontext - found
-- IPO enabled
-- HWLOC target HWLOC::hwloc_1_11 doesn't exist. The tbbbind target cannot be created
-- HWLOC target HWLOC::hwloc_2 doesn't exist. The tbbbind_2_0 target cannot be created
-- HWLOC target HWLOC::hwloc_2_5 doesn't exist. The tbbbind_2_5 target cannot be created
-- Configuring done (14.0s)
-- Generating done (0.0s)
-- Build files have been written to: /workspace/cmake_fetch_content_onetbb/build

I had a quick look on your installation guidelines, but the dependency to hwloc is not mentioned.

By the way, I fixed the compilation issue by installing hwloc: conda install -c conda-forge libhwloc.

@dnmokhov
Copy link
Contributor

dnmokhov commented May 2, 2024

Hi @VincentRouvreau,

Thank you for submitting this. Hwloc is not a required dependency for oneTBB but is optional (if you need Hybrid CPU and NUMA Support).

Please see the Build System Description for more details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants