Skip to content

Commit

Permalink
Committing TBB 2020 source code
Browse files Browse the repository at this point in the history
  • Loading branch information
tbbdev committed Dec 18, 2019
1 parent a803f27 commit 1807034
Show file tree
Hide file tree
Showing 51 changed files with 1,474 additions and 109 deletions.
20 changes: 19 additions & 1 deletion CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,21 @@
The list of most significant changes made over time in
Intel(R) Threading Building Blocks (Intel(R) TBB).

Intel TBB 2020
TBB_INTERFACE_VERSION == 11100

Changes (w.r.t. Intel TBB 2019 Update 9):

- Extended task_arena interface to simplify development of NUMA-aware
applications.
- Added warning notifications when the deprecated functionality is used.

Open-source contributions integrated:

- Fixed various build warnings
(https://github.com/intel/tbb/pull/179) by Raf Schietekat.

------------------------------------------------------------------------
Intel TBB 2019 Update 9
TBB_INTERFACE_VERSION == 11009

Expand All @@ -13,7 +28,7 @@ Changes (w.r.t. Intel TBB 2019 Update 8):

Preview Features:

- Added isolated_task_group class that allows multiple threads to add
- Added isolated_task_group class that allows multiple threads to add
and execute tasks sharing the same isolation.
- Extended the flow graph API to simplify connecting nodes.
- Added erase() by heterogeneous keys for concurrent ordered containers.
Expand All @@ -27,6 +42,9 @@ Bugs fixed:
- Fixed a bug in the merge() method of concurrent unordered
containers.
- Fixed behavior of a continue_node that follows buffering nodes.
- Fixed compilation error caused by missed stdlib.h when CMake
integration is used (https://github.com/intel/tbb/issues/195).
Inspired by Andrew Penkrat.

Open-source contributions integrated:

Expand Down
16 changes: 5 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# limitations under the License.

tbb_root?=.
cfg?=release
include $(tbb_root)/build/common.inc
.PHONY: default all tbb tbbmalloc tbbproxy test examples

Expand All @@ -25,25 +26,22 @@ default: tbb tbbmalloc $(if $(use_proxy),tbbproxy)
all: tbb tbbmalloc tbbproxy test examples

tbb: mkdir
$(MAKE) -C "$(work_dir)_debug" -r -f $(tbb_root)/build/Makefile.tbb cfg=debug
$(MAKE) -C "$(work_dir)_release" -r -f $(tbb_root)/build/Makefile.tbb cfg=release

tbbmalloc: mkdir
$(MAKE) -C "$(work_dir)_debug" -r -f $(tbb_root)/build/Makefile.tbbmalloc cfg=debug malloc
$(MAKE) -C "$(work_dir)_release" -r -f $(tbb_root)/build/Makefile.tbbmalloc cfg=release malloc

tbbproxy: mkdir
$(MAKE) -C "$(work_dir)_debug" -r -f $(tbb_root)/build/Makefile.tbbproxy cfg=debug tbbproxy
$(MAKE) -C "$(work_dir)_release" -r -f $(tbb_root)/build/Makefile.tbbproxy cfg=release tbbproxy

tbbbind: mkdir
$(MAKE) -C "$(work_dir)_release" -r -f $(tbb_root)/build/Makefile.tbbbind cfg=release tbbbind

test: tbb tbbmalloc $(if $(use_proxy),tbbproxy)
-$(MAKE) -C "$(work_dir)_debug" -r -f $(tbb_root)/build/Makefile.tbbmalloc cfg=debug malloc_test
-$(MAKE) -C "$(work_dir)_debug" -r -f $(tbb_root)/build/Makefile.test cfg=debug
-$(MAKE) -C "$(work_dir)_release" -r -f $(tbb_root)/build/Makefile.tbbmalloc cfg=release malloc_test
-$(MAKE) -C "$(work_dir)_release" -r -f $(tbb_root)/build/Makefile.test cfg=release

rml: mkdir
$(MAKE) -C "$(work_dir)_debug" -r -f $(tbb_root)/build/Makefile.rml cfg=debug
$(MAKE) -C "$(work_dir)_release" -r -f $(tbb_root)/build/Makefile.rml cfg=release

examples: tbb tbbmalloc
Expand All @@ -60,22 +58,18 @@ doxygen:
clean: clean_examples
$(shell $(RM) $(work_dir)_release$(SLASH)*.* >$(NUL) 2>$(NUL))
$(shell $(RD) $(work_dir)_release >$(NUL) 2>$(NUL))
$(shell $(RM) $(work_dir)_debug$(SLASH)*.* >$(NUL) 2>$(NUL))
$(shell $(RD) $(work_dir)_debug >$(NUL) 2>$(NUL))
@echo clean done

clean_examples:
$(shell $(MAKE) -s -i -r -C examples -f Makefile tbb_root=.. clean >$(NUL) 2>$(NUL))

mkdir:
$(shell $(MD) "$(work_dir)_release" >$(NUL) 2>$(NUL))
$(shell $(MD) "$(work_dir)_debug" >$(NUL) 2>$(NUL))
@echo Created $(work_dir)_release and ..._debug directories
@echo Created the $(work_dir)_release directory

info:
@echo OS: $(tbb_os)
@echo arch=$(arch)
@echo compiler=$(compiler)
@echo runtime=$(runtime)
@echo tbb_build_prefix=$(tbb_build_prefix)

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Threading Building Blocks 2019 Update 9
[![Stable release](https://img.shields.io/badge/version-2019_U9-green.svg)](https://github.com/intel/tbb/releases/tag/2019_U9)
# Threading Building Blocks 2020
[![Stable release](https://img.shields.io/badge/version-2020-green.svg)](https://github.com/intel/tbb/releases/tag/2020)
[![Apache License Version 2.0](https://img.shields.io/badge/license-Apache_2.0-green.svg)](LICENSE)

Threading Building Blocks (TBB) lets you easily write parallel C++ programs that take
Expand Down
69 changes: 69 additions & 0 deletions build/Makefile.tbbbind
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Copyright (c) 2005-2019 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

#------------------------------------------------------------------------------
# Define rules for making the tbbbind shared library.
#------------------------------------------------------------------------------

tbb_root ?= "$(TBBROOT)"
BUILDING_PHASE=1
include $(tbb_root)/build/common.inc
CPLUS_FLAGS += $(SDL_FLAGS)
DEBUG_SUFFIX=$(findstring _debug,_$(cfg))

#------------------------------------------------------------
# Define static pattern rules dealing with .cpp source files
#------------------------------------------------------------
$(warning CONFIG: cfg=$(cfg) arch=$(arch) compiler=$(compiler) target=$(target) runtime=$(runtime))

.PHONY: tbbbind
.PRECIOUS: %.$(OBJ)

VPATH = $(tbb_root)/src/tbb/$(ASSEMBLY_SOURCE) $(tbb_root)/src/tbb $(tbb_root)/src/old $(tbb_root)/src/rml/client

CPLUS_FLAGS += $(PIC_KEY) $(DSE_KEY)

# Suppress superfluous warnings for tbbbind compilation
WARNING_KEY += $(WARNING_SUPPRESS)

include $(tbb_root)/build/common_rules.inc

TBBBIND.OBJ = tbbbind.$(OBJ)

ifneq (,$(TBBBIND.DEF))
tbbbind.def: $(TBBBIND.DEF)
$(CPLUS) $(PREPROC_ONLY) $< $(CPLUS_FLAGS) $(INCLUDES) > $@

LIB_LINK_FLAGS += $(EXPORT_KEY)tbbbind.def
$(TBBBIND.DLL): tbbbind.def
endif

ifneq (,$(TBBBIND.DLL))
$(TBBBIND.DLL): BUILDING_LIBRARY = $(TBBBIND.DLL)
$(TBBBIND.DLL): $(TBBBIND.OBJ) $(TBBBIND_NO_VERSION.DLL)
$(LIB_LINK_CMD) $(LIB_OUTPUT_KEY)$(TBBBIND.DLL) $(TBBBIND.OBJ) $(HWLOC.LIB) $(LINK_TBB.LIB) $(LIB_LINK_FLAGS)
endif

ifneq (,$(TBBBIND_NO_VERSION.DLL))
$(TBBBIND_NO_VERSION.DLL):
echo "INPUT ($(TBBBIND.DLL))" > $(TBBBIND_NO_VERSION.DLL)
endif

tbbbind: $(TBB.DLL) $(TBBBIND.DLL)

#clean:
# $(RM) *.$(OBJ) *.$(DLL) *.res *.map *.ilk *.pdb *.exp *.manifest *.tmp *.d core core.*[0-9][0-9] *.ver

# Include automatically generated dependencies
-include *.d
2 changes: 2 additions & 0 deletions build/Makefile.test
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,8 @@ endif

test_opencl_node.$(TEST_EXT): LIBS += $(OPENCL.LIB)

test_arena_constraints_hwloc.$(TEST_EXT): LIBS += $(HWLOC.LIB)

$(TEST_TBB_PLAIN.EXE) $(TEST_TBB_SPECIAL.EXE): WARNING_KEY += $(TEST_WARNING_KEY)

# Run tests that are in SCHEDULER_DIRECTLY_INCLUDED and TEST_TBB_PLAIN.EXE but not in skip_tests (which is specified by user)
Expand Down
11 changes: 8 additions & 3 deletions build/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ <H2>Files</H2>
<DT><A HREF="Makefile.tbbmalloc">Makefile.tbbmalloc</A>
<DD>Main Makefile to build the Intel TBB scalable memory allocator library as well as its tests.
Invoked via 'make tbbmalloc' from <A HREF="../Makefile">top-level Makefile</A>.
<DT><A HREF="Makefile.tbbbind">Makefile.tbbbind</A>
<DD>Main Makefile to build the tbbbind library.
Invoked via 'make tbbbind' from <A HREF="../Makefile">top-level Makefile</A>
<DT><A HREF="Makefile.test">Makefile.test</A>
<DD>Main Makefile to build and run the tests for the Intel TBB library.
Invoked via 'make test' from <A HREF="../Makefile">top-level Makefile</A>.
Expand Down Expand Up @@ -73,7 +76,7 @@ <H3>Software prerequisites:</H3>
<LI>Explicitly specify the architecture when invoking GNU make, e.g. <TT>make arch=ia32</TT>.
</OL>

<P>The default make target will build the release and debug versions of the Intel TBB library.</P>
<P>The default make target will build the release version of the Intel TBB library.</P>
<P>Other targets are available in the top-level Makefile. You might find the following targets useful:
<UL>
<LI><TT>make test</TT> will build and run Intel TBB <A HREF="../src/test">unit-tests</A>;
Expand Down Expand Up @@ -111,13 +114,15 @@ <H3>Software prerequisites:</H3>
<DT><TT>cd src;make debug</TT>
<DD>Build and test debug libraries only.
<DT><TT>make tbb</TT>
<DD>Make Intel TBB release and debug libraries.
<DD>Make Intel TBB release libraries.
<DT><TT>make tbbmalloc</TT>
<DD>Make Intel TBB scalable memory allocator libraries.
<DT><TT>make tbbbind</TT>
<DD>Make the tbbbind library.
<DT><TT>make test</TT>
<DD>Compile and run unit-tests
<DT><TT>make examples</TT>
<DD>Build libraries and run all examples, like doing <TT>make debug clean release</TT> from <A HREF="../examples/Makefile">the general example Makefile</A>.
<DD>Build libraries and run all examples, like doing <TT>make clean release</TT> from <A HREF="../examples/Makefile">the general example Makefile</A>.
Available in the open-source version only.
<DT><TT>make python</TT>
<DD>Build, install, and test Python* API for Intel TBB. See <A HREF="../python/index.html">details here</A>.
Expand Down
7 changes: 7 additions & 0 deletions build/linux.inc
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,13 @@ TBB.LIB = $(TBB.DLL)
TBB_NO_VERSION.DLL=libtbb$(CPF_SUFFIX)$(DEBUG_SUFFIX).$(DLL)
LINK_TBB.LIB = $(TBB_NO_VERSION.DLL)

TBBBIND_NO_VERSION.DLL = libtbbbind$(DEBUG_SUFFIX).$(DLL)
TBBBIND.DEF = $(tbb_root)/src/tbb/$(def_prefix)-tbbbind-export.def
TBBBIND.DLL = $(TBBBIND_NO_VERSION.DLL).$(SONAME_SUFFIX)
TBBBIND.LIB = $(TBBBIND_NO_VERSION.DLL)
LINK_TBBBIND.LIB = $(TBBBIND.LIB)
HWLOC.LIB = -lhwloc

MALLOC_NO_VERSION.DLL = libtbbmalloc$(DEBUG_SUFFIX).$(MALLOC_DLL)
MALLOC.DEF = $(MALLOC_ROOT)/$(def_prefix)-tbbmalloc-export.def
MALLOC.DLL = $(MALLOC_NO_VERSION.DLL).$(SONAME_SUFFIX)
Expand Down
7 changes: 7 additions & 0 deletions build/windows.inc
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,13 @@ ifneq ($(filter vc8 vc9,$(runtime)),)
TBB.MANIFEST = tbbmanifest.exe.manifest
endif

TBBBIND.DEF = $(tbb_root)/src/tbb/$(def_prefix)-tbbbind-export.def
TBBBIND.DLL = tbbbind$(DEBUG_SUFFIX).$(DLL)
TBBBIND.LIB = tbbbind$(DEBUG_SUFFIX).$(LIBEXT)
TBBBIND.RES = tbbbind.res
LINK_TBBBIND.LIB = $(TBBBIND.LIB)
HWLOC.LIB = libhwloc.$(LIBEXT)

MALLOC.DEF = $(MALLOC_ROOT)/$(def_prefix)-tbbmalloc-export.def
MALLOC.DLL = tbbmalloc$(DEBUG_SUFFIX).$(DLL)
MALLOC.LIB = tbbmalloc$(DEBUG_SUFFIX).$(LIBEXT)
Expand Down
1 change: 1 addition & 0 deletions cmake/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ If ``tbbmalloc_proxy`` is requested, ``tbbmalloc`` component will also be added
TBBConfig creates `imported targets <https://cmake.org/cmake/help/latest/manual/cmake-buildsystem.7.html#imported-targets>`_ as
shared libraries using the following format: ``TBB::<component>`` (for example, ``TBB::tbb``, ``TBB::tbbmalloc``).

Set ``TBB_FIND_RELEASE_ONLY`` to ``TRUE`` before ``find_package`` call in order to search only for release TBB version. This variable helps to avoid simultaneous linkage of release and debug TBB versions when CMake configuration is `Debug` but a third-party component depends on release TBB version.
Variables set during TBB configuration:

========================= ================================================
Expand Down
20 changes: 14 additions & 6 deletions cmake/templates/TBBConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,20 @@ unset(_tbbmalloc_proxy_ix)
foreach (_tbb_component ${TBB_FIND_COMPONENTS})
set(TBB_${_tbb_component}_FOUND 0)

set(_tbb_release_lib "${CMAKE_CURRENT_LIST_DIR}/@TBB_LIB_REL_PATH@/@TBB_LIB_PREFIX@${_tbb_component}.@TBB_LIB_EXT@")
set(_tbb_debug_lib "${CMAKE_CURRENT_LIST_DIR}/@TBB_LIB_REL_PATH@/@TBB_LIB_PREFIX@${_tbb_component}_debug.@TBB_LIB_EXT@")
get_filename_component(_tbb_release_lib "${CMAKE_CURRENT_LIST_DIR}/@TBB_LIB_REL_PATH@/@TBB_LIB_PREFIX@${_tbb_component}.@TBB_LIB_EXT@" ABSOLUTE)

if (NOT TBB_FIND_RELEASE_ONLY)
get_filename_component(_tbb_debug_lib "${CMAKE_CURRENT_LIST_DIR}/@TBB_LIB_REL_PATH@/@TBB_LIB_PREFIX@${_tbb_component}_debug.@TBB_LIB_EXT@" ABSOLUTE)
endif()

if (EXISTS "${_tbb_release_lib}" OR EXISTS "${_tbb_debug_lib}")
if (NOT TARGET TBB::${_tbb_component})
add_library(TBB::${_tbb_component} SHARED IMPORTED)

get_filename_component(_tbb_include_dir "${CMAKE_CURRENT_LIST_DIR}/@TBB_INC_REL_PATH@" ABSOLUTE)
set_target_properties(TBB::${_tbb_component} PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_LIST_DIR}/@TBB_INC_REL_PATH@")
INTERFACE_INCLUDE_DIRECTORIES "${_tbb_include_dir}")
unset(_tbb_include_dir)

if (EXISTS "${_tbb_release_lib}")
set_target_properties(TBB::${_tbb_component} PROPERTIES
Expand All @@ -72,14 +78,16 @@ foreach (_tbb_component ${TBB_FIND_COMPONENTS})
if (_tbb_component STREQUAL tbbmalloc_proxy)
set_target_properties(TBB::tbbmalloc_proxy PROPERTIES INTERFACE_LINK_LIBRARIES TBB::tbbmalloc)
endif()
else()
message(STATUS "Using previously found TBB::${_tbb_component}")
endif()
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(STATUS "Missed required Intel TBB component: ${_tbb_component}")
message(STATUS " one or both of:\n ${_tbb_release_lib}\n ${_tbb_debug_lib}\n files must exist.")
if (TBB_FIND_RELEASE_ONLY)
message(STATUS " ${_tbb_release_lib} must exist.")
else()
message(STATUS " one or both of:\n ${_tbb_release_lib}\n ${_tbb_debug_lib}\n files must exist.")
endif()
set(TBB_FOUND FALSE)
endif()
endforeach()
Expand Down
13 changes: 9 additions & 4 deletions cmake/templates/TBBConfigInternal.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ foreach (_tbb_component ${TBB_FIND_COMPONENTS})
set(TBB_${_tbb_component}_FOUND 0)

set(_tbb_release_lib "@TBB_RELEASE_LIB_PATH@/@TBB_LIB_PREFIX@${_tbb_component}.@TBB_LIB_EXT@")
set(_tbb_debug_lib "@TBB_DEBUG_LIB_PATH@/@TBB_LIB_PREFIX@${_tbb_component}_debug.@TBB_LIB_EXT@")

if (NOT TBB_FIND_RELEASE_ONLY)
set(_tbb_debug_lib "@TBB_DEBUG_LIB_PATH@/@TBB_LIB_PREFIX@${_tbb_component}_debug.@TBB_LIB_EXT@")
endif()

if (EXISTS "${_tbb_release_lib}" OR EXISTS "${_tbb_debug_lib}")
if (NOT TARGET TBB::${_tbb_component})
Expand All @@ -73,14 +76,16 @@ foreach (_tbb_component ${TBB_FIND_COMPONENTS})
if (_tbb_component STREQUAL tbbmalloc_proxy)
set_target_properties(TBB::tbbmalloc_proxy PROPERTIES INTERFACE_LINK_LIBRARIES TBB::tbbmalloc)
endif()
else()
message(STATUS "Using previously found TBB::${_tbb_component}")
endif()
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(STATUS "Missed required Intel TBB component: ${_tbb_component}")
message(STATUS " one or both of:\n ${_tbb_release_lib}\n ${_tbb_debug_lib}\n files must exist.")
if (TBB_FIND_RELEASE_ONLY)
message(STATUS " ${_tbb_release_lib} must exist.")
else()
message(STATUS " one or both of:\n ${_tbb_release_lib}\n ${_tbb_debug_lib}\n files must exist.")
endif()
set(TBB_FOUND FALSE)
endif()
endforeach()
Expand Down
Loading

0 comments on commit 1807034

Please sign in to comment.