Skip to content

Commit

Permalink
Committing Intel(R) TBB 2018 Update 2 source code
Browse files Browse the repository at this point in the history
  • Loading branch information
tbbdev committed Dec 6, 2017
1 parent e8b3e24 commit 4c73c3b
Show file tree
Hide file tree
Showing 63 changed files with 2,856 additions and 522 deletions.
26 changes: 26 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,32 @@
The list of most significant changes made over time in
Intel(R) Threading Building Blocks (Intel(R) TBB).

Intel TBB 2018 Update 2
TBB_INTERFACE_VERSION == 10002

Changes (w.r.t. Intel TBB 2018 Update 1):

- Added support for Android* NDK r16, macOS* 10.13, Fedora* 26.
- Binaries for Universal Windows Driver (vc14_uwd) now link with static
Microsoft* runtime libraries, and are only available in commercial
releases.
- Extended flow graph documentation with more code samples.

Preview Features:

- Added a Python* module for multi-processing computations in numeric
Python* libraries.

Bugs fixed:

- Fixed constructors of concurrent_hash_map to be exception-safe.
- Fixed auto-initialization in the main thread to be cleaned up at
shutdown.
- Fixed a crash when tbbmalloc_proxy is used together with dbghelp.
- Fixed static_partitioner to assign tasks properly in case of nested
parallelism.

------------------------------------------------------------------------
Intel TBB 2018 Update 1
TBB_INTERFACE_VERSION == 10001

Expand Down
6 changes: 2 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,11 @@ 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
$(MAKE) -C examples -r -f Makefile tbb_root=.. release test

python: mkdir
$(MAKE) -C "$(work_dir)_release" -r -f $(tbb_root)/build/Makefile.tbb cfg=release
bash -c ". $(work_dir)_release$(SLASH)tbbvars.sh && $(MAKE) -rC '$(full_tbb_root)/python' CXX=$(compiler) install test-install"
python: tbb
$(MAKE) -C "$(work_dir)_release" -rf $(tbb_root)/python/Makefile install

.PHONY: clean clean_examples mkdir info

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

Intel(R) Threading Building Blocks (Intel(R) TBB) lets you easily write parallel C++ programs that take
Expand Down
14 changes: 13 additions & 1 deletion build/android.clang.inc
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,20 @@ ifeq (0, $(dynamic_load))
endif

# Paths to the NDK prebuilt tools and libraries
CPLUS_FLAGS += --sysroot=$(SYSROOT)
ifneq (,$(findstring $(ndk_version),r16 r16b))
# Since Android* NDK r16 another sysroot and isystem paths have to be specified
CPLUS_FLAGS += --sysroot=$(NDK_ROOT)/sysroot -isystem $(NDK_ROOT)/sysroot/usr/include/$(TRIPLE)
# Android* version flag required since r16
CPLUS_FLAGS += -D__ANDROID_API__=$(API_LEVEL)
else
CPLUS_FLAGS += --sysroot=$(SYSROOT)
endif

# Library sysroot flag
LIB_LINK_FLAGS += --sysroot=$(SYSROOT)
# Flag for test executables
LINK_FLAGS += --sysroot=$(SYSROOT)

LIBS = -L$(CPLUS_LIB_PATH) -lc++_shared
ifeq (,$(findstring $(ndk_version),$(foreach v, 7 8 9 10 11,r$(v) r$(v)b r$(v)c r$(v)d r$(v)e)))
LIBS += -lc++abi
Expand Down
177 changes: 177 additions & 0 deletions build/build.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
#!/usr/bin/env python
#
# Copyright (c) 2017 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.
#
#
#
#

# Provides unified tool for preparing TBB for packaging

from __future__ import print_function
import os
import re
import sys
import shutil
import platform
import argparse
from glob import glob
from collections import OrderedDict

jp = os.path.join
is_win = (platform.system() == 'Windows')
is_lin = (platform.system() == 'Linux')
is_mac = (platform.system() == 'Darwin')

default_prefix = os.getenv('PREFIX', 'install_prefix')
if is_win:
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('--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')
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')
parser.add_argument('--vs-platform', default="x64", help='select VS platform for build')
parser.add_argument('ignore', nargs='?', help="workaround conda-build issue #2512")

args = parser.parse_args()

if args.install:
args.install_libs = True
args.install_devel = True
args.install_docs = True
args.install_python= True

def custom_cp(src, dst):
assert os.system(' '.join([args.copy_tool, src, dst])) == 0

if args.copy_tool:
install_cp = custom_cp # e.g. to use install -p -D -m 755 on Linux
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')
if is_win:
os.environ["OS"] = "Windows_NT" # make sure TBB will interpret it corretly
libext = '.dll'
libpref = ''
dll_dir = bin_dir
else:
libext = '.dylib' if is_mac else '.so.2'
libpref = 'lib'
dll_dir = lib_dir

tbb_names = ["tbb", "tbbmalloc", "tbbmalloc_proxy"]

##############################################################

os.chdir(args.tbbroot)
if is_win and args.msbuild:
preview_release_dir = release_dir = jp(args.tbbroot, 'build', 'vs'+args.vs, args.vs_platform, 'Release')
if not args.no_rebuild or not os.path.isdir(release_dir):
assert os.system('msbuild /m /p:Platform=%s /p:Configuration=Release %s build/vs%s/makefile.sln'% \
(args.vs_platform, args.build_args, args.vs)) == 0
preview_debug_dir = debug_dir = jp(args.tbbroot, 'build', 'vs'+args.vs, args.vs_platform, 'Debug')
if not args.no_rebuild or not os.path.isdir(debug_dir):
assert os.system('msbuild /m /p:Platform=%s /p:Configuration=Debug %s build/vs%s/makefile.sln'% \
(args.vs_platform, args.build_args, args.vs)) == 0
else:
release_dir = jp(args.tbbroot, 'build', args.build_prefix+'_release')
debug_dir = jp(args.tbbroot, 'build', args.build_prefix+'_debug')
if not args.no_rebuild or not (os.path.isdir(release_dir) and os.path.isdir(debug_dir)):
assert os.system('%s -j tbb_build_prefix=%s %s'% \
(args.make_tool, args.build_prefix, args.build_args)) == 0
preview_release_dir = jp(args.tbbroot, 'build', args.build_prefix+'_preview_release')
preview_debug_dir = jp(args.tbbroot, 'build', args.build_prefix+'_preview_debug')
if not args.no_rebuild or not (os.path.isdir(preview_release_dir) and os.path.isdir(preview_debug_dir)):
assert os.system('%s -j tbb_build_prefix=%s_preview %s tbb_cpf=1 tbb'% \
(args.make_tool, args.build_prefix, args.build_args)) == 0


filemap = OrderedDict()
def append_files(files, dst):
global filemap
filemap.update(dict(zip(files, [dst]*len(files))))

if args.install_libs:
files = [jp(release_dir, libpref+f+libext) for f in tbb_names]
append_files(files, dll_dir)

if args.install_devel:
dll_files = [jp(debug_dir, libpref+f+'_debug'+libext) for f in tbb_names] # adding debug libraries
if not is_win or not args.msbuild:
dll_files += [jp(preview_release_dir, libpref+"tbb_preview"+libext),
jp(preview_debug_dir, libpref+"tbb_preview_debug"+libext)]
if is_win:
dll_files += sum( [glob(jp(d, 'tbb*.pdb')) for d in # copying debug info
(release_dir, debug_dir, preview_release_dir, preview_debug_dir)], [])
if is_lin:
dll_files += sum( [glob(jp(d, 'libtbb*.so')) for d in # copying linker scripts
(release_dir, debug_dir, preview_release_dir, preview_debug_dir)], [])
# symlinks .so -> .so.2 should not be created instead
# since linking with -ltbb when using links can result in
# incorrect dependence upon unversioned .so files
append_files(dll_files, dll_dir)
if is_win:
lib_files = sum([glob(jp(d,e)) for d in (release_dir, debug_dir) for e in ('*.lib', '*.def')], [])
append_files(lib_files, lib_dir) # copying linker libs and defs
for rootdir, dirnames, filenames in os.walk(jp(args.tbbroot,'include')):
files = [jp(rootdir, f) for f in filenames if not '.html' in f]
append_files(files, jp(inc_dir, rootdir.split('include')[1][1:]))

if args.install_python:
assert os.system('%s -j tbb_build_prefix=%s %s python'% \
(args.make_tool, args.build_prefix, args.build_args)) == 0
if is_lin:
append_files([jp(release_dir, 'libirml.so.1')], dll_dir)

if args.install_docs:
files = [jp(args.tbbroot, *f) for f in (
('CHANGES',),
('LICENSE',),
('README',),
('README.md',),
('doc','Release_Notes.txt'),
)]
append_files(files, doc_dir)

for f in filemap.keys():
assert os.path.exists(f)
assert os.path.isfile(f)

if filemap:
print("Copying to prefix =", args.prefix)
for f, dest in filemap.items():
if not os.path.isdir(dest):
os.makedirs(dest)
print("+ %s to $prefix%s"%(f,dest.replace(args.prefix, '')))
install_cp(f, dest)

print("done")
7 changes: 7 additions & 0 deletions build/common_rules.inc
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,14 @@ ifeq ($(origin LIB_LINK_LIBS), undefined)
LIB_LINK_LIBS = $(LIBDL) $(LIBS)
endif

# Define C & C++ compilers according to platform defaults or CXX & CC environment variables
ifneq (,$(findstring environment, $(origin CXX)))
CPLUS = $(CXX)
endif
CONLY ?= $(CPLUS)
ifneq (,$(findstring environment, $(origin CC)))
CONLY = $(CC)
endif

# The most generic rules
#$(1) - is the target pattern
Expand Down
4 changes: 3 additions & 1 deletion build/macos.clang.inc
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ else
CPLUS_FLAGS = -g -O0 -DTBB_USE_DEBUG
endif

CPLUS_FLAGS += -DUSE_PTHREAD
CPLUS_FLAGS += -DUSE_PTHREAD $(ITT_NOTIFY)

# For Clang, we add the option to support RTM intrinsics *iff* xtest is found in <immintrin.h>
ifneq (,$(shell grep xtest `echo "\#include<immintrin.h>" | clang -E -M - 2>&1 | grep immintrin.h` 2>/dev/null))
Expand All @@ -57,12 +57,14 @@ ifneq (,$(stdlib))
endif

ifeq (intel64,$(arch))
ITT_NOTIFY = -DDO_ITT_NOTIFY
CPLUS_FLAGS += -m64 $(RTM_KEY)
LINK_FLAGS += -m64
LIB_LINK_FLAGS += -m64
endif

ifeq (ia32,$(arch))
ITT_NOTIFY = -DDO_ITT_NOTIFY
CPLUS_FLAGS += -m32 $(RTM_KEY)
LINK_FLAGS += -m32
LIB_LINK_FLAGS += -m32
Expand Down
4 changes: 3 additions & 1 deletion build/macos.gcc.inc
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,17 @@ else
CPLUS_FLAGS = -g -O0 -DTBB_USE_DEBUG
endif

CPLUS_FLAGS += -DUSE_PTHREAD
CPLUS_FLAGS += -DUSE_PTHREAD $(ITT_NOTIFY)

ifeq (intel64,$(arch))
ITT_NOTIFY = -DDO_ITT_NOTIFY
CPLUS_FLAGS += -m64
LINK_FLAGS += -m64
LIB_LINK_FLAGS += -m64
endif

ifeq (ia32,$(arch))
ITT_NOTIFY = -DDO_ITT_NOTIFY
CPLUS_FLAGS += -m32
LINK_FLAGS += -m32
LIB_LINK_FLAGS += -m32
Expand Down
3 changes: 2 additions & 1 deletion build/macos.icc.inc
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ else
CPLUS_FLAGS = -g -O0 -DTBB_USE_DEBUG
endif

CPLUS_FLAGS += -DUSE_PTHREAD
ITT_NOTIFY = -DDO_ITT_NOTIFY
CPLUS_FLAGS += -DUSE_PTHREAD $(ITT_NOTIFY)

ifneq (,$(codecov))
CPLUS_FLAGS += -prof-gen=srcpos
Expand Down
18 changes: 13 additions & 5 deletions build/windows.cl.inc
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ else
endif
EH_FLAGS = $(if $(no_exceptions),/EHs-,/EHsc /GR)

# UWD binaries have to use static CRT linkage
ifeq ($(target_app), uwd)
MS_CRT_KEY = /MT$(if $(findstring debug,$(cfg)),d)
endif

ifeq ($(cfg), release)
CPLUS_FLAGS = $(MS_CRT_KEY) /O2 /Zi $(EH_FLAGS) /Zc:forScope /Zc:wchar_t /D__TBB_LIB_NAME=$(TBB.LIB)
ASM_FLAGS =
Expand All @@ -54,17 +59,20 @@ endif

ZW_KEY = /ZW:nostdlib

ifneq (,$(filter win8ui,$(target_app) $(target_ui)))
CPLUS_FLAGS += $(ZW_KEY) /D "_UNICODE" /D "UNICODE" /D "WINAPI_FAMILY=WINAPI_FAMILY_APP"
# These flags are general for Windows* universal applications
ifneq (,$(target_app))
CPLUS_FLAGS += $(ZW_KEY) /D "_UNICODE" /D "UNICODE" /D "WINAPI_FAMILY=WINAPI_FAMILY_APP"
endif

ifeq ($(target_app), win8ui)
_WIN32_WINNT = 0x0602
else ifneq (,$(filter uwp,$(target_app) $(target_ui)))
CPLUS_FLAGS += $(ZW_KEY) /D "_UNICODE" /D "UNICODE" /D "WINAPI_FAMILY=WINAPI_FAMILY_APP"
else ifneq (,$(filter $(target_app),uwp uwd))
_WIN32_WINNT = 0x0A00
LIB_LINK_FLAGS += /NODEFAULTLIB:kernel32.lib OneCore.lib
else
CPLUS_FLAGS += /DDO_ITT_NOTIFY
endif
ifneq (,$(filter store,$(target_mode) $(target_ui_mode)))
ifeq ($(target_mode), store)
# it is necessary to source vcvars with 'store' argument in production
LIB_LINK_FLAGS += /APPCONTAINER
endif
Expand Down
10 changes: 5 additions & 5 deletions doc/Release_Notes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ Software - Supported Operating Systems
Systems with Linux* operating systems
CentOS 7.1
Debian* 8, 9
Fedora* 24, 25
Fedora* 24, 25, 26
Intel(R) Cluster Ready
Red Hat* Enterprise Linux* 6, 7
SuSE* Linux* Enterprise Server 11, 12
Expand All @@ -75,9 +75,9 @@ Software - Supported Operating Systems
Yocto 2.2, 2.3
Systems with OS X* or macOS* operating systems
OS X* 10.10, 10.11
macOS* 10.12
macOS* 10.12, 10.13
Systems with Android* operating systems
Android* 5.x, 6.x, 7.x
Android* 5.x, 6.x, 7.x, 8.x

Software - Supported Compilers

Expand All @@ -94,8 +94,8 @@ Software - Supported Compilers
version provided with that operating system is supported
GNU Compilers (gcc) 4.1 - 7.1
GNU C Library (glibc) version 2.4 - 2.19
Xcode* 6.3 - 8.3
Android* NDK r10e - r15b
Xcode* 6.3 - 9.1
Android* NDK r10e - r16

Software - Supported Performance Analysis Tools

Expand Down
Loading

0 comments on commit 4c73c3b

Please sign in to comment.