Skip to content

Commit 46fb877

Browse files
committed
Commit oneTBB 2021.1.1 source code
1 parent 978af3d commit 46fb877

File tree

293 files changed

+20049
-18797
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

293 files changed

+20049
-18797
lines changed

CMakeLists.txt

+14-13
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
cmake_minimum_required(VERSION 3.1)
1616

1717
include(CheckCXXCompilerFlag)
18+
include(GNUInstallDirs)
1819

1920
# Enable CMake policies
2021

@@ -46,7 +47,7 @@ if (CMAKE_VERSION VERSION_LESS 3.4)
4647
enable_language(C)
4748
endif()
4849

49-
file(READ include/tbb/version.h _tbb_version_info)
50+
file(READ include/oneapi/tbb/version.h _tbb_version_info)
5051
string(REGEX REPLACE ".*#define TBB_VERSION_MAJOR ([0-9]+).*" "\\1" _tbb_ver_major "${_tbb_version_info}")
5152
string(REGEX REPLACE ".*#define TBB_VERSION_MINOR ([0-9]+).*" "\\1" _tbb_ver_minor "${_tbb_version_info}")
5253
string(REGEX REPLACE ".*#define TBB_INTERFACE_VERSION ([0-9]+).*" "\\1" TBB_INTERFACE_VERSION "${_tbb_version_info}")
@@ -55,7 +56,7 @@ set(TBB_BINARY_MINOR_VERSION 1)
5556
set(TBBMALLOC_BINARY_VERSION 2)
5657
set(TBBBIND_BINARY_VERSION 3)
5758

58-
project(TBB VERSION ${_tbb_ver_major}.${_tbb_ver_minor} LANGUAGES CXX)
59+
project(TBB VERSION ${_tbb_ver_major}.${_tbb_ver_minor}.1 LANGUAGES CXX)
5960
unset(_tbb_ver_major)
6061
unset(_tbb_ver_minor)
6162

@@ -93,7 +94,6 @@ endif()
9394
option(TBB_TEST "Enable testing" ON)
9495
option(TBB_EXAMPLES "Enable examples" OFF)
9596
option(TBB_STRICT "Treat compiler warnings as errors" ON)
96-
option(TBB_NUMA_SUPPORT "Enable NUMA support that depends on Portable Hardware Locality (hwloc) library" OFF)
9797
option(TBB_WINDOWS_DRIVER "Build as Universal Windows Driver (UWD)" OFF)
9898
option(TBB_NO_APPCONTAINER "Apply /APPCONTAINER:NO (for testing binaries for Windows Store)" OFF)
9999
option(TBB4PY_BUILD "Enable tbb4py build" OFF)
@@ -187,25 +187,25 @@ else()
187187
if (NOT "${CMAKE_SYSTEM_PROCESSOR}" MATCHES "mips")
188188
add_subdirectory(src/tbbmalloc)
189189
add_subdirectory(src/tbbmalloc_proxy)
190-
if (TBB_NUMA_SUPPORT)
191-
if (APPLE)
192-
message(WARNING "TBBBind build target is disabled due to unsupported environment")
193-
else()
194-
add_subdirectory(src/tbbbind)
195-
endif()
190+
if (APPLE)
191+
message(STATUS "TBBBind build target is disabled due to unsupported environment")
192+
else()
193+
add_subdirectory(src/tbbbind)
196194
endif()
197195
endif()
198196

199197
# -------------------------------------------------------------------
200198
# Installation instructions
201199
include(CMakePackageConfigHelpers)
202200

203-
install(DIRECTORY include
204-
DESTINATION .)
201+
install(DIRECTORY include/
202+
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
203+
COMPONENT devel)
205204

206205
install(EXPORT ${PROJECT_NAME}Targets
207206
NAMESPACE TBB::
208-
DESTINATION lib/cmake/${PROJECT_NAME})
207+
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}
208+
COMPONENT devel)
209209
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake
210210
"include(\${CMAKE_CURRENT_LIST_DIR}/${PROJECT_NAME}Targets.cmake)\n")
211211

@@ -214,7 +214,8 @@ else()
214214

215215
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake"
216216
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake"
217-
DESTINATION lib/cmake/${PROJECT_NAME})
217+
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}
218+
COMPONENT devel)
218219
# -------------------------------------------------------------------
219220
endif()
220221

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# oneAPI Threading Building Blocks (Beta)
1+
# oneAPI Threading Building Blocks
22
[![Apache License Version 2.0](https://img.shields.io/badge/license-Apache_2.0-green.svg)](LICENSE.txt)
33

44
oneAPI Threading Building Blocks (oneTBB) lets you easily write parallel C++ programs that take
@@ -28,4 +28,4 @@ By its terms, contributions submitted to the project are also done under that li
2828
------------------------------------------------------------------------
2929
Intel and the Intel logo are trademarks of Intel Corporation or its subsidiaries in the U.S. and/or other countries.
3030

31-
\* Other names and brands may be claimed as the property of others.
31+
\* Other names and brands may be claimed as the property of others.

cmake/README.md

+13-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ The following controls are available during the configure stage:
66
```
77
TBB_TEST:BOOL - Enable testing (ON by default)
88
TBB_STRICT:BOOL - Treat compiler warnings as errors (ON by default)
9-
TBB_NUMA_SUPPORT:BOOL - Enable TBBBind build target and task_arena extensions for NUMA support (depends on Portable Hardware Locality (hwloc) library) (OFF by default)
109
TBB_SANITIZE:STRING - Sanitizer parameter, passed to compiler/linker
1110
TBB_SIGNTOOL:FILEPATH - Tool for digital signing, used in post install step for libraries if provided.
1211
TBB_SIGNTOOL_ARGS:STRING - Additional arguments for TBB_SIGNTOOL, used if TBB_SIGNTOOL is set.
@@ -138,6 +137,17 @@ make test_spec
138137

139138
**NOTE: be careful about installation: avoid commands like `make install` unless you fully understand the consequences.**
140139

140+
The following install components are supported:
141+
- `runtime` - oneTBB runtime package (core shared libraries and `.dll` files on Windows).
142+
- `devel` - oneTBB development package (header files, CMake integration files, library symbolic links and `.lib` files on Windows).
143+
- `tbb4py` - [oneTBB Module for Python](#onetbb-python-module-support).
144+
145+
How to install specific components after configuration and build:
146+
147+
```bash
148+
cmake -DCOMPONENT=<component> [-DBUILD_TYPE=<build-type>] -P cmake_install.cmake
149+
```
150+
141151
Simple packaging using CPack is supported.
142152
The following commands allow to create a simple portable package which includes header files, libraries and integration files for CMake:
143153

@@ -184,8 +194,8 @@ Variable | Description
184194
`TBB_VERSION` | oneTBB version (format: `<major>.<minor>.<patch>.<tweak>`)
185195
`TBB_IMPORTED_TARGETS` | All created oneTBB imported targets (not supported for builds from source code)
186196

187-
Starting from [oneTBB 2021.1-beta08](https://github.com/oneapi-src/oneTBB/releases/tag/v2021.1-beta08) GitHub release TBBConfig files in the binary packages are located under `<tbb-root>/lib[/<intel64|ia32>]/cmake/TBB`.
188-
For example, for Linux 64-bit `TBB_DIR` should be set to `<tbb-root>/lib/intel64/cmake/TBB`.
197+
Starting from [oneTBB 2021.1](https://github.com/oneapi-src/oneTBB/releases/tag/v2021.1) GitHub release TBBConfig files in the binary packages are located under `<tbb-root>/lib/cmake/TBB`.
198+
For example, `TBB_DIR` should be set to `<tbb-root>/lib/cmake/TBB`.
189199

190200
TBBConfig files are automatically created during the build from source code and can be installed together with the library.
191201
Also oneTBB provides a helper function that creates TBBConfig files from predefined templates: see `tbb_generate_config` in `cmake/config_generation.cmake`.

cmake/compilers/AppleClang.cmake

+5-3
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,13 @@ set(TBB_WARNING_LEVEL -Wall -Wextra $<$<BOOL:${TBB_STRICT}>:-Werror>)
1818
set(TBB_TEST_WARNING_FLAGS -Wshadow -Wcast-qual -Woverloaded-virtual -Wnon-virtual-dtor)
1919
set(TBB_WARNING_SUPPRESS -Wno-parentheses -Wno-non-virtual-dtor -Wno-dangling-else)
2020
# For correct ucontext.h structures layout
21-
set(TBB_LIB_COMPILE_FLAGS -D_XOPEN_SOURCE)
22-
set(TBB_BENCH_COMPILE_FLAGS -D_XOPEN_SOURCE)
21+
set(TBB_COMMON_COMPILE_FLAGS -D_XOPEN_SOURCE)
2322

2423
set(TBB_MMD_FLAG -MMD)
25-
set(TBB_COMMON_COMPILE_FLAGS -mrtm)
24+
25+
if (NOT "${CMAKE_OSX_ARCHITECTURES}" MATCHES "^arm64$")
26+
set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} -mrtm)
27+
endif()
2628

2729
# TBB malloc settings
2830
set(TBBMALLOC_LIB_COMPILE_FLAGS -fno-rtti -fno-exceptions)

cmake/config_generation.cmake

+20-6
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ function(tbb_generate_config)
2222
set(options HANDLE_SUBDIRS)
2323
set(oneValueArgs INSTALL_DIR
2424
SYSTEM_NAME
25-
SIZEOF_VOID_P # 4 for 32 bit, 8 for 64 bit.
2625
LIB_REL_PATH INC_REL_PATH DLL_REL_PATH
2726
VERSION
2827
TBB_BINARY_VERSION
@@ -39,8 +38,6 @@ function(tbb_generate_config)
3938
file(TO_CMAKE_PATH "${tbb_gen_cfg_DLL_REL_PATH}" TBB_DLL_REL_PATH)
4039
file(TO_CMAKE_PATH "${tbb_gen_cfg_INC_REL_PATH}" TBB_INC_REL_PATH)
4140

42-
set(TBB_SIZEOF_VOID_P "${tbb_gen_cfg_SIZEOF_VOID_P}")
43-
4441
set(TBB_VERSION ${tbb_gen_cfg_VERSION})
4542

4643
set(TBB_COMPONENTS_BIN_VERSION "
@@ -57,7 +54,11 @@ set(_tbbbind_bin_version ${tbb_gen_cfg_TBBBIND_BINARY_VERSION})
5754
set(TBB_IMPLIB_DEBUG "")
5855
if (tbb_gen_cfg_HANDLE_SUBDIRS)
5956
set(TBB_HANDLE_SUBDIRS "
60-
set(_tbb_subdir gcc4.8)
57+
if (CMAKE_SIZEOF_VOID_P STREQUAL \"8\")
58+
set(_tbb_subdir intel64/gcc4.8)
59+
else ()
60+
set(_tbb_subdir ia32/gcc4.8)
61+
endif()
6162
")
6263
endif()
6364
elseif (tbb_gen_cfg_SYSTEM_NAME STREQUAL "Darwin")
@@ -76,9 +77,9 @@ set(_tbb_subdir gcc4.8)
7677
# Expand TBB_LIB_REL_PATH here in IMPORTED_IMPLIB property and
7778
# redefine it with TBB_DLL_REL_PATH value to properly fill IMPORTED_LOCATION property in TBBConfig.cmake.in template.
7879
set(TBB_IMPLIB_RELEASE "
79-
IMPORTED_IMPLIB_RELEASE \"\${CMAKE_CURRENT_LIST_DIR}/${TBB_LIB_REL_PATH}/\${_tbb_subdir}/\${_tbb_component}.lib\"")
80+
IMPORTED_IMPLIB_RELEASE \"\${CMAKE_CURRENT_LIST_DIR}/${TBB_LIB_REL_PATH}/\${_tbb_subdir}/\${_tbb_component}\${_bin_version}.lib\"")
8081
set(TBB_IMPLIB_DEBUG "
81-
IMPORTED_IMPLIB_DEBUG \"\${CMAKE_CURRENT_LIST_DIR}/${TBB_LIB_REL_PATH}/\${_tbb_subdir}/\${_tbb_component}_debug.lib\"")
82+
IMPORTED_IMPLIB_DEBUG \"\${CMAKE_CURRENT_LIST_DIR}/${TBB_LIB_REL_PATH}/\${_tbb_subdir}/\${_tbb_component}\${_bin_version}_debug.lib\"")
8283
set(TBB_LIB_REL_PATH ${TBB_DLL_REL_PATH})
8384

8485
if (tbb_gen_cfg_HANDLE_SUBDIRS)
@@ -87,8 +88,21 @@ set(_tbb_subdir vc14)
8788
if (WINDOWS_STORE)
8889
set(_tbb_subdir \${_tbb_subdir}_uwp)
8990
endif()
91+
92+
if (CMAKE_SIZEOF_VOID_P STREQUAL \"8\")
93+
set(_tbb_subdir intel64/\${_tbb_subdir})
94+
else ()
95+
set(_tbb_subdir ia32/\${_tbb_subdir})
96+
endif()
9097
")
9198
endif()
99+
100+
set(TBB_HANDLE_BIN_VERSION "
101+
unset(_bin_version)
102+
if (_tbb_component STREQUAL tbb)
103+
set(_bin_version \${_tbb_bin_version})
104+
endif()
105+
")
92106
else()
93107
message(FATAL_ERROR "Unsupported OS name: ${tbb_system_name}")
94108
endif()

0 commit comments

Comments
 (0)