Skip to content

Commit

Permalink
Committing TBB 2019 Update 7 source code
Browse files Browse the repository at this point in the history
  • Loading branch information
tbbdev committed May 23, 2019
1 parent cc2c04e commit 4233fef
Show file tree
Hide file tree
Showing 73 changed files with 5,965 additions and 2,299 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ Thumbs.db
/rules.ninja
*~
.emacs.desktop
.tags

# Build system generated files #
################################
Expand Down
36 changes: 36 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,42 @@
The list of most significant changes made over time in
Intel(R) Threading Building Blocks (Intel(R) TBB).

Intel TBB 2019 Update 7
TBB_INTERFACE_VERSION == 11007

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

- Added TBBMALLOC_SET_HUGE_SIZE_THRESHOLD parameter to set the lower
bound for allocations that are not released back to OS unless
a cleanup is explicitly requested.
- Added zip_iterator::base() method to get the tuple of underlying
iterators.
- Improved async_node to never block a thread that sends a message
through its gateway.
- Extended decrement port of the tbb::flow::limiter_node to accept
messages of integral types.
- Added support of Windows* to the CMake module TBBInstallConfig.
- Added packaging of CMake configuration files to TBB packages built
using build/build.py script
(https://github.com/intel/tbb/issues/141).

Changes affecting backward compatibility:

- Removed the number_of_decrement_predecessors parameter from the
constructor of flow::limiter_node. To allow its usage, set
TBB_DEPRECATED_LIMITER_NODE_CONSTRUCTOR macro to 1.

Preview Features:

- Added ordered associative containers:
concurrent_{map,multimap,set,multiset} (requires C++11).

Open-source contributions integrated:

- Fixed makefiles to properly obtain the GCC version for GCC 7
and later (https://github.com/intel/tbb/pull/147) by Timmmm.

------------------------------------------------------------------------
Intel TBB 2019 Update 6
TBB_INTERFACE_VERSION == 11006

Expand Down
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 5
[![Stable release](https://img.shields.io/badge/version-2019_U6-green.svg)](https://github.com/01org/tbb/releases/tag/2019_U6)
# Threading Building Blocks 2019 Update 7
[![Stable release](https://img.shields.io/badge/version-2019_U7-green.svg)](https://github.com/01org/tbb/releases/tag/2019_U7)
[![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
2 changes: 1 addition & 1 deletion build/AIX.inc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ ifndef arch
endif

ifndef runtime
gcc_version:=$(shell gcc -dumpversion)
gcc_version:=$(shell gcc -dumpfullversion -dumpversion)
os_version:=$(shell uname -r)
os_kernel_version:=$(shell uname -r | sed -e 's/-.*$$//')
export runtime:=cc$(gcc_version)_kernel$(os_kernel_version)
Expand Down
2 changes: 1 addition & 1 deletion build/FreeBSD.gcc.inc
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ C_FLAGS = $(CPLUS_FLAGS)

# gcc 6.0 and later have -flifetime-dse option that controls
# elimination of stores done outside the object lifetime
ifneq (,$(shell gcc -dumpversion | egrep "^([6-9])"))
ifneq (,$(shell gcc -dumpfullversion -dumpversion | egrep "^([6-9])"))
# keep pre-contruction stores for zero initialization
DSE_KEY = -flifetime-dse=1
endif
Expand Down
2 changes: 1 addition & 1 deletion build/SunOS.inc
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ ifndef arch
endif

ifndef runtime
gcc_version:=$(shell gcc -dumpversion)
gcc_version:=$(shell gcc -dumpfullversion -dumpversion)
os_version:=$(shell uname -r)
os_kernel_version:=$(shell uname -r | sed -e 's/-.*$$//')
export runtime:=cc$(gcc_version)_kernel$(os_kernel_version)
Expand Down
49 changes: 32 additions & 17 deletions build/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,20 @@
default_prefix = jp(default_prefix, 'Library') # conda-specific by default on Windows

parser = argparse.ArgumentParser()
parser.add_argument('--tbbroot', default='.', help='Take Intel TBB from here')
parser.add_argument('--prefix', default=default_prefix, help='Prefix')
parser.add_argument('--prebuilt', default=[], action='append', help='Directories to find prebuilt files')
parser.add_argument('--no-rebuild', default=False, action='store_true', help='do not rebuild')
parser.add_argument('--install', default=False, action='store_true', help='install all')
parser.add_argument('--install-libs', default=False, action='store_true', help='install libs')
parser.add_argument('--install-devel', default=False, action='store_true', help='install devel')
parser.add_argument('--install-docs', default=False, action='store_true', help='install docs')
parser.add_argument('--install-python',default=False, action='store_true', help='install python module')
parser.add_argument('--make-tool', default='make', help='Use different make command instead')
parser.add_argument('--copy-tool', default=None, help='Use this command for copying ($ tool file dest-dir)')
parser.add_argument('--build-args', default="", help='specify extra build args')
parser.add_argument('--build-prefix', default='local', help='build dir prefix')
parser.add_argument('--tbbroot', default='.', help='Take Intel TBB from here')
parser.add_argument('--prefix', default=default_prefix, help='Prefix')
parser.add_argument('--prebuilt', default=[], action='append', help='Directories to find prebuilt files')
parser.add_argument('--no-rebuild', default=False, action='store_true', help='do not rebuild')
parser.add_argument('--install', default=False, action='store_true', help='install all')
parser.add_argument('--install-libs', default=False, action='store_true', help='install libs')
parser.add_argument('--install-devel', default=False, action='store_true', help='install devel')
parser.add_argument('--install-docs', default=False, action='store_true', help='install docs')
parser.add_argument('--install-python', default=False, action='store_true', help='install python module')
parser.add_argument('--make-tool', default='make', help='Use different make command instead')
parser.add_argument('--copy-tool', default=None, help='Use this command for copying ($ tool file dest-dir)')
parser.add_argument('--build-args', default="", help='specify extra build args')
parser.add_argument('--build-prefix', default='local', help='build dir prefix')
parser.add_argument('--cmake-dir', help='directory to install CMake configuraion files. Default: <prefix>/lib/cmake/tbb')
if is_win:
parser.add_argument('--msbuild', default=False, action='store_true', help='Use msbuild')
parser.add_argument('--vs', default="2012", help='select VS version for build')
Expand All @@ -71,10 +72,12 @@ def custom_cp(src, dst):
else:
install_cp = shutil.copy

bin_dir = jp(args.prefix, "bin")
lib_dir = jp(args.prefix, "lib")
inc_dir = jp(args.prefix, 'include')
doc_dir = jp(args.prefix, 'share', 'doc', 'tbb')
bin_dir = jp(args.prefix, "bin")
lib_dir = jp(args.prefix, "lib")
inc_dir = jp(args.prefix, 'include')
doc_dir = jp(args.prefix, 'share', 'doc', 'tbb')
cmake_dir = jp(args.prefix, "lib", "cmake", "tbb") if args.cmake_dir is None else args.cmake_dir

if is_win:
os.environ["OS"] = "Windows_NT" # make sure TBB will interpret it corretly
libext = '.dll'
Expand Down Expand Up @@ -151,6 +154,18 @@ def append_files(names, dst, paths=release_dirs):
files = [f for f in filenames if not '.html' in f]
append_files(files, jp(inc_dir, rootdir.split('include')[1][1:]), paths=(rootdir,))

# Preparing CMake configuration files
cmake_build_dir = jp(args.tbbroot, 'build', args.build_prefix+'_release', 'cmake_configs')
assert system('cmake -DINSTALL_DIR=%s -DSYSTEM_NAME=%s -DTBB_VERSION_FILE=%s -DINC_REL_PATH=%s -DLIB_REL_PATH=%s -DBIN_REL_PATH=%s -P %s' % \
(cmake_build_dir,
platform.system(),
jp(args.tbbroot, 'include', 'tbb', 'tbb_stddef.h'),
os.path.relpath(inc_dir, cmake_dir),
os.path.relpath(lib_dir, cmake_dir),
os.path.relpath(bin_dir, cmake_dir),
jp(args.tbbroot, 'cmake', 'tbb_config_installer.cmake'))) == 0
append_files(['TBBConfig.cmake', 'TBBConfigVersion.cmake'], cmake_dir, paths=[cmake_build_dir])

if args.install_python: # RML part
irml_dir = jp(args.tbbroot, 'build', args.build_prefix+'_release')
run_make('-C src tbb_build_prefix=%s %s python_rml'% (args.build_prefix, args.build_args))
Expand Down
2 changes: 1 addition & 1 deletion build/detect.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function doWork() {
WScript.Echo("unknown");
}
} else {
tmpExec = WshShell.Exec(compilerPath + " -dumpversion");
tmpExec = WshShell.Exec(compilerPath + " -dumpfullversion -dumpversion");
var gccVersion = tmpExec.StdOut.ReadLine();
if (WScript.Arguments(0) == "/runtime") {
WScript.Echo("mingw" + gccVersion);
Expand Down
10 changes: 5 additions & 5 deletions build/linux.gcc.inc
Original file line number Diff line number Diff line change
Expand Up @@ -36,30 +36,30 @@ LINK_FLAGS = -Wl,-rpath-link=. -rdynamic
C_FLAGS = $(CPLUS_FLAGS)

# gcc 4.2 and higher support OpenMP
ifneq (,$(shell $(CONLY) -dumpversion | egrep "^(4\.[2-9]|[5-9])"))
ifneq (,$(shell $(CONLY) -dumpfullversion -dumpversion | egrep "^(4\.[2-9]|[5-9])"))
OPENMP_FLAG = -fopenmp
endif

# gcc 4.8 and later support RTM intrinsics, but require command line switch to enable them
ifneq (,$(shell $(CONLY) -dumpversion | egrep "^(4\.[8-9]|[5-9])"))
ifneq (,$(shell $(CONLY) -dumpfullversion -dumpversion | egrep "^(4\.[8-9]|[5-9])"))
RTM_KEY = -mrtm
endif

# gcc 4.0 and later have -Wextra that is used by some our customers.
ifneq (,$(shell $(CONLY) -dumpversion | egrep "^([4-9])"))
ifneq (,$(shell $(CONLY) -dumpfullversion -dumpversion | egrep "^([4-9])"))
WARNING_KEY += -Wextra
endif

# gcc 5.0 and later have -Wsuggest-override and -Wno-sized-deallocation options
ifneq (,$(shell $(CONLY) -dumpversion | egrep "^([5-9])"))
ifneq (,$(shell $(CONLY) -dumpfullversion -dumpversion | egrep "^([5-9])"))
# enable -Wsuggest-override via a pre-included header in order to limit to C++11 and above
INCLUDE_TEST_HEADERS = -include $(tbb_root)/src/test/harness_preload.h
WARNING_SUPPRESS += -Wno-sized-deallocation
endif

# gcc 6.0 and later have -flifetime-dse option that controls
# elimination of stores done outside the object lifetime
ifneq (,$(shell $(CONLY) -dumpversion | egrep "^([6-9])"))
ifneq (,$(shell $(CONLY) -dumpfullversion -dumpversion | egrep "^([6-9])"))
# keep pre-contruction stores for zero initialization
DSE_KEY = -flifetime-dse=1
endif
Expand Down
2 changes: 1 addition & 1 deletion build/linux.inc
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ ifndef arch
endif

ifndef runtime
export gcc_version:=$(shell gcc -dumpversion)
export gcc_version:=$(shell gcc -dumpfullversion -dumpversion)
os_version:=$(shell uname -r)
os_kernel_version:=$(shell uname -r | sed -e 's/-.*$$//')
export os_glibc_version_full:=$(shell getconf GNU_LIBC_VERSION | grep glibc | sed -e 's/^glibc //')
Expand Down
6 changes: 3 additions & 3 deletions build/macos.gcc.inc
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,19 @@ LIB_LINK_FLAGS = -dynamiclib -install_name @rpath/$(BUILDING_LIBRARY)
C_FLAGS = $(CPLUS_FLAGS)

# gcc 4.8 and later support RTM intrinsics, but require command line switch to enable them
ifneq (,$(shell $(CONLY) -dumpversion | egrep "^(4\.[8-9]|[5-9])"))
ifneq (,$(shell $(CONLY) -dumpfullversion -dumpversion | egrep "^(4\.[8-9]|[5-9])"))
RTM_KEY = -mrtm
endif

# gcc 5.0 and later have -Wsuggest-override option
# enable it via a pre-included header in order to limit to C++11 and above
ifneq (,$(shell $(CONLY) -dumpversion | egrep "^([5-9])"))
ifneq (,$(shell $(CONLY) -dumpfullversion -dumpversion | egrep "^([5-9])"))
INCLUDE_TEST_HEADERS = -include $(tbb_root)/src/test/harness_preload.h
endif

# gcc 6.0 and later have -flifetime-dse option that controls
# elimination of stores done outside the object lifetime
ifneq (,$(shell $(CONLY) -dumpversion | egrep "^([6-9])"))
ifneq (,$(shell $(CONLY) -dumpfullversion -dumpversion | egrep "^([6-9])"))
# keep pre-contruction stores for zero initialization
DSE_KEY = -flifetime-dse=1
endif
Expand Down
8 changes: 5 additions & 3 deletions cmake/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ Provides the following functions:

.. code:: cmake
tbb_install_config(INSTALL_DIR <install_dir> SYSTEM_NAME Linux|Darwin
tbb_install_config(INSTALL_DIR <install_dir> SYSTEM_NAME Linux|Darwin|Windows
[TBB_VERSION <major>.<minor>.<interface>|TBB_VERSION_FILE <version_file>]
[LIB_REL_PATH <lib_rel_path> INC_REL_PATH <inc_rel_path>]
[LIB_PATH <lib_path> INC_PATH <inc_path>])``
Expand All @@ -243,7 +243,8 @@ The use case is applicable for package maintainers who create own TBB packages a
write it to TBBConfigVersion.cmake
``TBB_VERSION <major>.<minor>.<interface>`` Directly specified TBB version;
alternative to ``TBB_VERSION_FILE`` parameter
``LIB_REL_PATH <lib_rel_path>`` Relative path to TBB binaries, default: ``../..``
``LIB_REL_PATH <lib_rel_path>`` Relative path to TBB binaries (.lib files on Windows), default: ``../../../lib``
``BIN_REL_PATH <bin_rel_path>`` Relative path to TBB DLLs, default: ``../../../bin`` (applicable for Windows only)
``INC_REL_PATH <inc_rel_path>`` Relative path to TBB headers, default: ``../../../include``
=========================================== ===========================================================

Expand All @@ -268,7 +269,8 @@ The use case is applicable for users who have installed TBB, but do not have (or
============================ ==============================================
``INSTALL_DIR <directory>`` Directory to install CMake configuration files
``SYSTEM_NAME Linux|Darwin`` OS name to generate config files for
``LIB_PATH <lib_path>`` Path to installed TBB binaries
``LIB_PATH <lib_path>`` Path to installed TBB binaries (.lib files on Windows)
``BIN_PATH <bin_path>`` Path to installed TBB DLLs (applicable for Windows only)
``INC_PATH <inc_path>`` Path to installed TBB headers
============================ ==============================================

Expand Down
40 changes: 35 additions & 5 deletions cmake/TBBInstallConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,19 @@ set(_tbb_cmake_module_path ${CMAKE_CURRENT_LIST_DIR})
function(tbb_install_config)
set(oneValueArgs INSTALL_DIR
SYSTEM_NAME
LIB_REL_PATH INC_REL_PATH TBB_VERSION TBB_VERSION_FILE
LIB_PATH INC_PATH) # If TBB is installed on the system
LIB_REL_PATH INC_REL_PATH BIN_REL_PATH TBB_VERSION TBB_VERSION_FILE
LIB_PATH BIN_PATH INC_PATH) # If TBB is installed on the system

cmake_parse_arguments(tbb_IC "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})

get_filename_component(config_install_dir ${tbb_IC_INSTALL_DIR} ABSOLUTE)
file(MAKE_DIRECTORY ${config_install_dir})

# --- TBB_LIB_REL_PATH handling ---
set(TBB_LIB_REL_PATH "../..")
set(TBB_LIB_REL_PATH "../../../lib")

if (tbb_IC_LIB_REL_PATH)
set(TBB_LIB_REL_PATH ${tbb_IC_LIB_REL_PATH})
file(TO_CMAKE_PATH ${tbb_IC_LIB_REL_PATH} TBB_LIB_REL_PATH)
endif()

if (tbb_IC_LIB_PATH)
Expand All @@ -43,11 +43,25 @@ function(tbb_install_config)
endif()
# ------

# --- TBB_BIN_REL_PATH handling ---
set(TBB_BIN_REL_PATH "../../../bin")

if (tbb_IC_BIN_REL_PATH)
file(TO_CMAKE_PATH ${tbb_IC_BIN_REL_PATH} TBB_BIN_REL_PATH)
endif()

if (tbb_IC_BIN_PATH)
get_filename_component(bin_abs_path ${tbb_IC_BIN_PATH} ABSOLUTE)
file(RELATIVE_PATH TBB_BIN_REL_PATH ${config_install_dir} ${bin_abs_path})
unset(bin_abs_path)
endif()
# ------

# --- TBB_INC_REL_PATH handling ---
set(TBB_INC_REL_PATH "../../../include")

if (tbb_IC_INC_REL_PATH)
set(TBB_INC_REL_PATH ${tbb_IC_INC_REL_PATH})
file(TO_CMAKE_PATH ${tbb_IC_INC_REL_PATH} TBB_INC_REL_PATH)
endif()

if (tbb_IC_INC_PATH)
Expand Down Expand Up @@ -82,9 +96,25 @@ function(tbb_install_config)
if (tbb_system_name STREQUAL "Linux")
set(TBB_LIB_PREFIX "lib")
set(TBB_LIB_EXT "so.2")
set(TBB_IMPLIB_RELEASE "")
set(TBB_IMPLIB_DEBUG "")
elseif (tbb_system_name STREQUAL "Darwin")
set(TBB_LIB_PREFIX "lib")
set(TBB_LIB_EXT "dylib")
set(TBB_IMPLIB_RELEASE "")
set(TBB_IMPLIB_DEBUG "")
elseif (tbb_system_name STREQUAL "Windows")
set(TBB_LIB_PREFIX "")
set(TBB_LIB_EXT "dll")
# .lib files installed to TBB_LIB_REL_PATH (e.g. <prefix>/lib);
# .dll files installed to TBB_BIN_REL_PATH (e.g. <prefix>/bin);
# Expand TBB_LIB_REL_PATH here in IMPORTED_IMPLIB property and
# redefine it with TBB_BIN_REL_PATH value to properly fill IMPORTED_LOCATION property in TBBConfig.cmake.in template.
set(TBB_IMPLIB_RELEASE "
IMPORTED_IMPLIB_RELEASE \"\${CMAKE_CURRENT_LIST_DIR}/${TBB_LIB_REL_PATH}/\${_tbb_component}.lib\"")
set(TBB_IMPLIB_DEBUG "
IMPORTED_IMPLIB_DEBUG \"\${CMAKE_CURRENT_LIST_DIR}/${TBB_LIB_REL_PATH}/\${_tbb_component}_debug.lib\"")
set(TBB_LIB_REL_PATH ${TBB_BIN_REL_PATH})
else()
message(FATAL_ERROR "Unsupported OS name: ${tbb_system_name}")
endif()
Expand Down
10 changes: 6 additions & 4 deletions cmake/tbb_config_installer.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,19 @@
# limitations under the License.

function(tbb_conf_gen_print_help)
message("Usage: cmake -DINSTALL_DIR=<config_install_dir> -DSYSTEM_NAME=Linux|Darwin <parameters> -P tbb_config_generator.cmake
message("Usage: cmake -DINSTALL_DIR=<config_install_dir> -DSYSTEM_NAME=Linux|Darwin|Windows <parameters> -P tbb_config_generator.cmake
Parameters:
For custom TBB package:
-DTBB_VERSION_FILE=<tbb_version_file>
-DTBB_VERSION=<major>.<minor>.<interface> (alternative to TBB_VERSION_FILE)
-DLIB_REL_PATH=<relative_path_to_tbb_binaries>
-DINC_REL_PATH=<relative_path_to_tbb_headers>
-DLIB_REL_PATH=<relative_path_to_tbb_libs>
-DBIN_REL_PATH=<relative_path_to_tbb_dlls> (only for Windows)
For installed TBB:
-DLIB_PATH=<path_to_installed_tbb_binaries>
-DINC_PATH=<path_to_installed_tbb_headers>
-DLIB_PATH=<path_to_installed_tbb_libs>
-DBIN_PATH=<path_to_installed_tbb_dlls> (only for Windows)
")
endfunction()

Expand All @@ -37,7 +39,7 @@ if (NOT DEFINED SYSTEM_NAME)
message(FATAL_ERROR "Required parameter SYSTEM_NAME is not defined")
endif()

foreach (arg TBB_VERSION LIB_REL_PATH INC_REL_PATH TBB_VERSION_FILE LIB_PATH INC_PATH)
foreach (arg TBB_VERSION INC_REL_PATH LIB_REL_PATH BIN_REL_PATH TBB_VERSION_FILE INC_PATH LIB_PATH BIN_PATH)
set(optional_args ${optional_args} ${arg} ${${arg}})
endforeach()

Expand Down
4 changes: 2 additions & 2 deletions cmake/templates/TBBConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,13 @@ foreach (_tbb_component ${TBB_FIND_COMPONENTS})

if (EXISTS "${_tbb_release_lib}")
set_target_properties(TBB::${_tbb_component} PROPERTIES
IMPORTED_LOCATION_RELEASE "${_tbb_release_lib}")
IMPORTED_LOCATION_RELEASE "${_tbb_release_lib}"@TBB_IMPLIB_RELEASE@)
set_property(TARGET TBB::${_tbb_component} APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
endif()

if (EXISTS "${_tbb_debug_lib}")
set_target_properties(TBB::${_tbb_component} PROPERTIES
IMPORTED_LOCATION_DEBUG "${_tbb_debug_lib}")
IMPORTED_LOCATION_DEBUG "${_tbb_debug_lib}"@TBB_IMPLIB_DEBUG@)
set_property(TARGET TBB::${_tbb_component} APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
endif()

Expand Down
2 changes: 1 addition & 1 deletion examples/common/examples-common.inc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ else
CXX0XFLAGS ?= -std=c++0x
else
# support of lambda started GCC 4.5
ifneq (, $(strip $(shell g++ -dumpversion | egrep "^(4\.[5-9]|[5-9])")))
ifneq (, $(strip $(shell g++ -dumpfullversion -dumpversion | egrep "^(4\.[5-9]|[5-9])")))
CXX0XFLAGS ?= -std=c++0x
endif
endif
Expand Down
Loading

0 comments on commit 4233fef

Please sign in to comment.