Commit 0e23298f authored by Graham Inggs's avatar Graham Inggs

Imported Upstream version 2.1r015

parent 533dc055
This diff is collapsed.
# Copyright 2005-2008 Intel Corporation. All Rights Reserved.
# Copyright 2005-2009 Intel Corporation. All Rights Reserved.
#
# This file is part of Threading Building Blocks.
#
......
# Copyright 2005-2008 Intel Corporation. All Rights Reserved.
# Copyright 2005-2009 Intel Corporation. All Rights Reserved.
#
# This file is part of Threading Building Blocks.
#
......@@ -47,7 +47,7 @@ ifeq ($(cfg), release)
CPLUS_FLAGS = -O2 -DUSE_PTHREAD
endif
ifeq ($(cfg), debug)
CPLUS_FLAGS = -DTBB_DO_ASSERT -g -O0 -DUSE_PTHREAD
CPLUS_FLAGS = -DTBB_USE_DEBUG -g -O0 -DUSE_PTHREAD
endif
ASM=
......
# Copyright 2005-2008 Intel Corporation. All Rights Reserved.
# Copyright 2005-2009 Intel Corporation. All Rights Reserved.
#
# This file is part of Threading Building Blocks.
#
......@@ -63,7 +63,7 @@ else
export LD_LIBRARY_PATH := .
endif
####### Build settigns ########################################################
####### Build settings ########################################################
OBJ = o
DLL = so
......
# Copyright 2005-2008 Intel Corporation. All Rights Reserved.
# Copyright 2005-2009 Intel Corporation. All Rights Reserved.
#
# This file is part of Threading Building Blocks.
#
......@@ -52,6 +52,7 @@ ifeq (1,$(TBB_NOSTRICT))
# The files below need the -strict_ansi flag downgraded to -ansi to compile
KNOWN_NOSTRICT = concurrent_hash_map.o \
concurrent_queue.o \
concurrent_vector_v2.o \
concurrent_vector.o
......
# Copyright 2005-2008 Intel Corporation. All Rights Reserved.
# Copyright 2005-2009 Intel Corporation. All Rights Reserved.
#
# This file is part of Threading Building Blocks.
#
......@@ -41,13 +41,15 @@ VPATH += $(MALLOC_ROOT) $(MALLOC_SOURCE_ROOT)
KNOWN_NOSTRICT = test_ScalableAllocator_STL.$(OBJ) #test_malloc_compliance.$(OBJ)
KNOWN_WARNINGS = test_malloc_compliance.$(OBJ)
CPLUS_FLAGS += $(if $(crosstest),$(DEFINE_KEY)__TBBMALLOC_NO_IMPLICIT_LINKAGE=1)
include $(tbb_root)/build/common_rules.inc
#------------------------------------------------------
# Define rules for making the TBBMalloc shared library.
#------------------------------------------------------
# Object files that gmake up TBBMalloc
# Object files that make up TBBMalloc
MALLOC_CPLUS.OBJ = tbbmalloc.$(OBJ)
MALLOC_CUSTOM.OBJ += tbb_misc_malloc.$(OBJ)
MALLOC_ASM.OBJ = $(TBB_ASM.OBJ)
......@@ -55,36 +57,64 @@ MALLOC_ASM.OBJ = $(TBB_ASM.OBJ)
# MALLOC_CPLUS.OBJ is built in two steps due to Intel Compiler Tracker # C69574
MALLOC.OBJ := $(MALLOC_CPLUS.OBJ) $(MALLOC_ASM.OBJ) $(MALLOC_CUSTOM.OBJ) MemoryAllocator.$(OBJ)
MALLOC_CPLUS.OBJ += MemoryAllocator.$(OBJ)
PROXY.OBJ := proxy.$(OBJ)
M_CPLUS_FLAGS := $(subst $(WARNING_KEY),,$(M_CPLUS_FLAGS)) $(DEFINE_KEY)__TBB_BUILD=1
M_INCLUDES = $(INCLUDES) $(INCLUDE_KEY)$(MALLOC_ROOT) $(INCLUDE_KEY)$(MALLOC_SOURCE_ROOT)
# Suppress superfluous warnings for TBBmalloc compilation
$(MALLOC.OBJ): M_CPLUS_FLAGS += $(WARNING_SUPPRESS)
$(PROXY.OBJ): %.$(OBJ): %.cpp
$(CPLUS) $(COMPILE_ONLY) $(CPLUS_FLAGS) $(PIC_KEY) $(M_INCLUDES) $<
$(MALLOC_CPLUS.OBJ): %.$(OBJ): %.cpp
$(CPLUS) $(COMPILE_ONLY) $(M_CPLUS_FLAGS) $(PIC_KEY) $(M_INCLUDES) $<
tbb_misc_malloc.$(OBJ): tbb_misc.cpp version_string.tmp
$(CPLUS) $(COMPILE_ONLY) $(subst -strict_ansi,-ansi,$(M_CPLUS_FLAGS)) $(PIC_KEY) $(OUTPUTOBJ_KEY)$@ $(INCLUDE_KEY). $(INCLUDES) $<
MALLOC_LINK_FLAGS = $(LIB_LINK_FLAGS)
PROXY_LINK_FLAGS = $(LIB_LINK_FLAGS)
ifneq (,$(MALLOC.DEF))
tbbmalloc.def: $(MALLOC.DEF)
$(CMD) "$(CPLUS) $(PREPROC_ONLY) $(MALLOC.DEF) $(filter $(DEFINE_KEY)%,$(CPLUS_FLAGS)) >tbbmalloc.def 2>$(NUL) || exit 0"
LIB_LINK_FLAGS += $(EXPORT_KEY)tbbmalloc.def
MALLOC_LINK_FLAGS += $(EXPORT_KEY)tbbmalloc.def
$(MALLOC.DLL): tbbmalloc.def
endif
$(MALLOC.DLL): BUILDING_LIBRARY = $(MALLOC.DLL)
$(MALLOC.DLL): $(MALLOC.OBJ) $(TBBMALLOC.RES) $(MALLOC_NO_VERSION.DLL)
$(LIB_LINK_CMD) $(LIB_OUTPUT_KEY)$(MALLOC.DLL) $(MALLOC.OBJ) $(TBBMALLOC.RES) $(LIB_LINK_LIBS) $(LIB_LINK_FLAGS)
$(MALLOC.DLL): $(MALLOC.OBJ) $(MALLOC.RES) $(MALLOC_NO_VERSION.DLL)
$(LIB_LINK_CMD) $(LIB_OUTPUT_KEY)$(MALLOC.DLL) $(MALLOC.OBJ) $(MALLOC.RES) $(LIB_LINK_LIBS) $(MALLOC_LINK_FLAGS)
ifneq (,$(MALLOCPROXY.DEF))
tbbmallocproxy.def: $(MALLOCPROXY.DEF)
$(CMD) "$(CPLUS) $(PREPROC_ONLY) $(MALLOCPROXY.DEF) $(filter $(DEFINE_KEY)%,$(CPLUS_FLAGS)) >tbbmallocproxy.def 2>$(NUL) || exit 0"
PROXY_LINK_FLAGS += $(EXPORT_KEY)tbbmallocproxy.def
$(MALLOCPROXY.DLL): tbbmallocproxy.def
endif
ifneq (,$(MALLOCPROXY.DLL))
$(MALLOCPROXY.DLL): BUILDING_LIBRARY = $(MALLOCPROXY.DLL)
$(MALLOCPROXY.DLL): $(PROXY.OBJ) $(MALLOCPROXY_NO_VERSION.DLL) $(MALLOC.DLL)
$(LIB_LINK_CMD) $(LIB_OUTPUT_KEY)$(MALLOCPROXY.DLL) $(PROXY.OBJ) $(LIB_LINK_LIBS) $(LINK_MALLOC.LIB) $(PROXY_LINK_FLAGS)
malloc: $(MALLOCPROXY.DLL)
endif
ifneq (,$(MALLOC_NO_VERSION.DLL))
$(MALLOC_NO_VERSION.DLL):
echo "INPUT ($(MALLOC.DLL))" > $(MALLOC_NO_VERSION.DLL)
endif
malloc: $(MALLOC.DLL)
ifneq (,$(MALLOCPROXY_NO_VERSION.DLL))
$(MALLOCPROXY_NO_VERSION.DLL):
echo "INPUT ($(MALLOCPROXY.DLL))" > $(MALLOCPROXY_NO_VERSION.DLL)
endif
malloc: $(MALLOC.DLL) $(MALLOCPROXY.DLL)
#------------------------------------------------------
# End of rules for making the TBBMalloc shared library
......@@ -97,22 +127,21 @@ malloc: $(MALLOC.DLL)
add_debug=$(basename $(1))_debug$(suffix $(1))
cross_suffix=$(if $(crosstest),$(if $(DEBUG_SUFFIX),$(subst _debug,,$(1)),$(call add_debug,$(1))),$(1))
MALLOC_MAIN_TESTS = test_ScalableAllocator.exe test_ScalableAllocator_STL.exe test_malloc_compliance.exe
MALLOC_MAIN_TESTS = test_ScalableAllocator.exe test_ScalableAllocator_STL.exe test_malloc_compliance.exe test_malloc_regression.exe
MALLOC_C_TESTS = test_malloc_pure_c.exe
$(MALLOC_MAIN_TESTS): %.exe: %.$(OBJ) $(call cross_suffix,$(MALLOC.LIB))
$(CPLUS) $(OUTPUT_KEY)$@ $(CPLUS_FLAGS) $^ $(LIBS) $(LINK_FLAGS)
$(MALLOC_C_TESTS): %.exe: %.$(OBJ) $(call cross_suffix,$(MALLOC.LIB))
$(CPLUS) $(OUTPUT_KEY)$@ $(CPLUS_FLAGS) $(INCLUDES) $^ $(LIBS) $(LINK_FLAGS)
$(CPLUS) $(OUTPUT_KEY)$@ $(CPLUS_FLAGS) $^ $(LIBS) $(LINK_FLAGS)
# run_cmd is usually empty
malloc_test: $(call cross_suffix,$(MALLOC.DLL)) $(MALLOC_MAIN_TESTS) $(MALLOC_C_TESTS)
ifndef norun
malloc_test:
$(TEST_LAUNCHER) ./test_malloc_compliance.exe
./test_ScalableAllocator.exe
./test_ScalableAllocator_STL.exe
./test_malloc_pure_c.exe
endif # norun
$(run_cmd) $(TEST_LAUNCHER) ./test_malloc_compliance.exe
$(run_cmd) ./test_ScalableAllocator.exe
$(run_cmd) ./test_ScalableAllocator_STL.exe
$(run_cmd) ./test_malloc_regression.exe
$(run_cmd) ./test_malloc_pure_c.exe
#------------------------------------------------------
# End of rules for making the TBBMalloc unit tests
......
# Copyright 2005-2008 Intel Corporation. All Rights Reserved.
# Copyright 2005-2009 Intel Corporation. All Rights Reserved.
#
# This file is part of Threading Building Blocks.
#
......@@ -46,6 +46,8 @@ endif
VPATH = $(tbb_root)/src/tbb/$(ASSEMBLY_SOURCE) $(tbb_root)/src/tbb $(tbb_root)/src/old $(tbb_root)/src/test $(tbb_root)/src/perf
CPLUS_FLAGS += $(if $(crosstest),$(DEFINE_KEY)__TBB_NO_IMPLICIT_LINKAGE=1)
ifeq (1,$(TBB_NOSTRICT))
# GNU 3.2.3 headers have a ISO syntax that is rejected by Intel compiler in -strict_ansi mode.
# The Mac uses gcc 4.0, so the list is empty for that platform.
......@@ -54,11 +56,13 @@ ifeq (1,$(TBB_NOSTRICT))
KNOWN_NOSTRICT += \
test_concurrent_hash_map.o \
test_concurrent_vector.o \
test_concurrent_queue.o \
test_handle_perror.o \
test_cache_aligned_allocator_STL.o \
test_task_scheduler_init.o \
test_model_plugin.o \
test_parallel_do.o \
test_eh_algorithms.o \
test_parallel_sort.o \
test_tbb_version.o
......@@ -156,57 +160,52 @@ test_tbb_openmp: test_openmp.exe
endif
test_tbb_plain: $(TEST_TBB_PLAIN.EXE)
ifndef norun
# Run tests that are in TEST_TBB_PLAIN.EXE
# The test are ordered so that simpler components are tested first.
# If a component Y uses component X, then tests for Y should come after tests for X.
test_tbb_plain:
./test_assembly.exe
./test_compiler.exe
# Note that usually run_cmd is empty, and tests run directly
test_tbb_plain: $(TEST_TBB_PLAIN.EXE)
$(run_cmd) ./test_assembly.exe
$(run_cmd) ./test_compiler.exe
# Yes, 4:8 is intended on the next line.
./test_yield.exe 4:8
./test_handle_perror.exe
./test_task_scheduler_init.exe 1:4
./test_task_scheduler_observer.exe 1:4
./test_task_assertions.exe
./test_task.exe 1:4
./test_task_leaks.exe
./test_atomic.exe
./test_cache_aligned_allocator.exe
./test_cache_aligned_allocator_STL.exe
./test_blocked_range.exe 1:4
./test_blocked_range2d.exe 1:4
./test_blocked_range3d.exe 1:4
./test_parallel_for.exe 1:4
./test_parallel_sort.exe 1:4
./test_aligned_space.exe
./test_parallel_reduce.exe 1:4
./test_parallel_scan.exe 1:4
./test_parallel_while.exe 1:4
./test_parallel_do.exe 1:4
./test_inits_loop.exe
./test_mutex.exe 1
./test_mutex.exe 2
./test_mutex.exe 4
./test_mutex_native_threads.exe 1
./test_mutex_native_threads.exe 2
./test_mutex_native_threads.exe 4
./test_rwm_upgrade_downgrade.exe 4
$(run_cmd) ./test_yield.exe 4:8
$(run_cmd) ./test_handle_perror.exe
$(run_cmd) ./test_task_scheduler_init.exe 1:4
$(run_cmd) ./test_task_scheduler_observer.exe 1:4
$(run_cmd) ./test_task_assertions.exe
$(run_cmd) ./test_task.exe 1:4
$(run_cmd) ./test_task_leaks.exe
$(run_cmd) ./test_atomic.exe
$(run_cmd) ./test_cache_aligned_allocator.exe
$(run_cmd) ./test_cache_aligned_allocator_STL.exe
$(run_cmd) ./test_blocked_range.exe 1:4
$(run_cmd) ./test_blocked_range2d.exe 1:4
$(run_cmd) ./test_blocked_range3d.exe 1:4
$(run_cmd) ./test_parallel_for.exe 1:4
$(run_cmd) ./test_parallel_sort.exe 1:4
$(run_cmd) ./test_aligned_space.exe
$(run_cmd) ./test_parallel_reduce.exe 1:4
$(run_cmd) ./test_parallel_scan.exe 1:4
$(run_cmd) ./test_parallel_while.exe 1:4
$(run_cmd) ./test_parallel_do.exe 1:4
$(run_cmd) ./test_inits_loop.exe
$(run_cmd) ./test_mutex.exe 1
$(run_cmd) ./test_mutex.exe 2
$(run_cmd) ./test_mutex.exe 4
$(run_cmd) ./test_mutex_native_threads.exe 1:4
$(run_cmd) ./test_rwm_upgrade_downgrade.exe 4
# Yes, 4:8 is intended on the next line.
./test_halt.exe 4:8
./test_pipeline.exe 1:4
./test_tick_count.exe 1:4
./test_concurrent_queue.exe 1:4
./test_concurrent_vector.exe 1:4
./test_concurrent_hash_map.exe 1:4
./test_model_plugin.exe 4
./test_tbb_version.exe
./test_eh_tasks.exe 2:4
./test_eh_algorithms.exe 2:4
./test_tbb_thread.exe
endif # norun
$(run_cmd) ./test_halt.exe 4:8
$(run_cmd) ./test_pipeline.exe 1:4
$(run_cmd) ./test_tick_count.exe 1:4
$(run_cmd) ./test_concurrent_queue.exe 1:4
$(run_cmd) ./test_concurrent_vector.exe 1:4
$(run_cmd) ./test_concurrent_hash_map.exe 1:4
$(run_cmd) ./test_model_plugin.exe 4
$(run_cmd) ./test_tbb_version.exe
$(run_cmd) ./test_eh_tasks.exe 2:4
$(run_cmd) ./test_eh_algorithms.exe 2:4
$(run_cmd) ./test_tbb_thread.exe
TEST_TBB_OLD.OBJ = test_concurrent_vector_v2.$(OBJ) test_concurrent_queue_v2.$(OBJ) test_mutex_v2.$(OBJ)
......@@ -217,34 +216,27 @@ $(TEST_TBB_OLD.OBJ): %.$(OBJ): %.cpp
TEST_TBB_OLD.EXE = $(subst .$(OBJ),.exe,$(TEST_TBB_OLD.OBJ))
test_tbb_old: $(TEST_TBB_OLD.EXE)
ifndef norun
test_tbb_old:
./test_concurrent_vector_v2.exe 1:4
./test_concurrent_queue_v2.exe 1:4
./test_mutex_v2.exe 1
./test_mutex_v2.exe 2
./test_mutex_v2.exe 4
endif # norun
debug_%: test_%.exe
$(debugger) ./$^ $(args)
test_%: test_%.exe
./$^ $(args)
$(run_cmd) ./test_concurrent_vector_v2.exe 1:4
$(run_cmd) ./test_concurrent_queue_v2.exe 1:4
$(run_cmd) ./test_mutex_v2.exe 1
$(run_cmd) ./test_mutex_v2.exe 2
$(run_cmd) ./test_mutex_v2.exe 4
test_% debug_%: test_%.exe
$(run_cmd) ./$^ $(args)
ifneq (,$(codecov))
profmerge
codecov $(if $(findstring -,$(codecov)),$(codecov),) -demang -comp $(tbb_root)/build/codecov.txt
endif
time_%: time_%.exe
./$^ $(args)
$(run_cmd) ./$^ $(args)
clean_%:
$(RM) $*.$(OBJ) $*.exe $*.$(DLL) $*.$(LIBEXT) $*.res $*.map $*.ilk $*.pdb $*.exp $*.*manifest $*.tmp $*.d
$(RM) $*.$(OBJ) $*.exe $*.$(DLL) $*.$(LIBEXT) $*.res $*.map $*.ilk $*.pdb $*.exp $*.*manifest $*.tmp $*.d pgopti.* *.dyn
clean:
$(RM) *.$(OBJ) *.exe *.$(DLL) *.$(LIBEXT) *.res *.map *.ilk *.pdb *.exp *.manifest *.tmp *.d core core.*[0-9][0-9]
$(RM) *.$(OBJ) *.exe *.$(DLL) *.$(LIBEXT) *.res *.map *.ilk *.pdb *.exp *.manifest *.tmp *.d pgopti.* *.dyn core core.*[0-9][0-9]
# Include automatically generated dependences
-include *.d
# Copyright 2005-2008 Intel Corporation. All Rights Reserved.
# Copyright 2005-2009 Intel Corporation. All Rights Reserved.
#
# This file is part of Threading Building Blocks.
#
......@@ -24,7 +24,7 @@
# invalidate any other reasons why the executable file might be covered by
# the GNU General Public License.
COMPILE_ONLY = -c -MMD
COMPILE_ONLY = -c -MMD
PREPROC_ONLY = -E -x c
INCLUDE_KEY = -I
DEFINE_KEY = -D
......@@ -32,7 +32,7 @@ OUTPUT_KEY = -o #
OUTPUTOBJ_KEY = -o #
PIC_KEY = -fPIC
WARNING_AS_ERROR_KEY = -Werror
WARNING_KEY =
WARNING_KEY = -Wall
DYLIB_KEY = -shared
LIBDL = -ldl
......@@ -47,7 +47,7 @@ ifeq ($(cfg), release)
CPLUS_FLAGS = -O2 -DUSE_PTHREAD
endif
ifeq ($(cfg), debug)
CPLUS_FLAGS = -DTBB_DO_ASSERT -g -O0 -DUSE_PTHREAD
CPLUS_FLAGS = -DTBB_USE_DEBUG -g -O0 -DUSE_PTHREAD
endif
ASM=
......@@ -70,6 +70,12 @@ ifeq (ia32,$(arch))
LIB_LINK_FLAGS += -m32
endif
# for some gcc versions on Solaris, -m64 may imply V9, but perhaps not everywhere (TODO: verify)
ifeq (sparc,$(arch))
CPLUS_FLAGS += -mcpu=v9 -m64
LIB_LINK_FLAGS += -mcpu=v9 -m64
endif
#------------------------------------------------------------------------------
# Setting assembler data.
#------------------------------------------------------------------------------
......
# Copyright 2005-2008 Intel Corporation. All Rights Reserved.
# Copyright 2005-2009 Intel Corporation. All Rights Reserved.
#
# This file is part of Threading Building Blocks.
#
......@@ -25,9 +25,17 @@
# the GNU General Public License.
ifndef arch
ifeq ($(shell arch),i86pc)
export arch:=ia32
arch:=$(shell uname -p)
ifeq ($(arch),i386)
ifeq ($(shell isainfo -b),64)
arch:=em64t
else
arch:=ia32
endif
endif
export arch
# For non-IA systems running Sun OS, 'arch' will contain whatever is printed by uname -p.
# In particular, for SPARC architecture it will contain "sparc".
endif
ifndef runtime
......@@ -52,8 +60,8 @@ MAKE_VERSIONS=bash $(tbb_root)/build/version_info_sunos.sh $(CPLUS) $(CPLUS_FLAG
MAKE_TBBVARS=bash $(tbb_root)/build/generate_tbbvars.sh
ifeq ($(compiler),suncc)
export TBB_CUSTOM_VARS_SH=CXXFLAGS="-I$(CWD)/include -library=stlport4 $(CXXFLAGS) -M$(CWD)/build/suncc.map.pause"
export TBB_CUSTOM_VARS_CSH=CXXFLAGS "-I$(CWD)/include -library=stlport4 $(CXXFLAGS) -M$(CWD)/build/suncc.map.pause"
export TBB_CUSTOM_VARS_SH=CXXFLAGS="-I$(CWD)/../include -library=stlport4 $(CXXFLAGS) -M$(CWD)/../build/suncc.map.pause"
export TBB_CUSTOM_VARS_CSH=CXXFLAGS "-I$(CWD)/../include -library=stlport4 $(CXXFLAGS) -M$(CWD)/../build/suncc.map.pause"
endif