From a645b4b8999509f422d3f83710a4dec55b2dd5fe Mon Sep 17 00:00:00 2001 From: Petr Machata Date: Feb 13 2008 18:01:54 +0000 Subject: Initial import --- diff --git a/.cvsignore b/.cvsignore index e69de29..2decd0a 100644 --- a/.cvsignore +++ b/.cvsignore @@ -0,0 +1,5 @@ +301111_301111.pdf +301114_301114.pdf +301132_301132.pdf +312687_312687.pdf +tbb20_20070927oss_src.tar.gz diff --git a/sources b/sources index e69de29..fed9432 100644 --- a/sources +++ b/sources @@ -0,0 +1,5 @@ +af809ce2b1e33d3fdb2ca2a756a08ace 301111_301111.pdf +e5a46b0638e0337cb7ebee0c1d832f7d 301114_301114.pdf +1eb7ef6b85b5a7580b300e8e76a3029e 301132_301132.pdf +0faf9fcb09fd53cfd6059ee554671d7d 312687_312687.pdf +22de880c793d5013235fb8c3010e8f67 tbb20_20070927oss_src.tar.gz diff --git a/tbb-2.0-20070927-cxxflags.patch b/tbb-2.0-20070927-cxxflags.patch new file mode 100644 index 0000000..7cd9e11 --- /dev/null +++ b/tbb-2.0-20070927-cxxflags.patch @@ -0,0 +1,16 @@ +diff -urp tbb20_20070927oss_src/build/linux.gcc.inc tbb20_20070927oss_src.pm/build/linux.gcc.inc +--- tbb20_20070927oss_src/build/linux.gcc.inc 2007-09-28 22:13:21.000000000 +0200 ++++ tbb20_20070927oss_src.pm/build/linux.gcc.inc 2007-12-19 16:56:13.000000000 +0100 +@@ -45,10 +45,10 @@ LIBS = -lpthread -lrt -ldl + C_FLAGS = $(CPLUS_FLAGS) -x c + + ifeq ($(cfg), release) +- CPLUS_FLAGS = -DDO_ITT_NOTIFY -O2 -DUSE_PTHREAD ++ CPLUS_FLAGS = $(CXXFLAGS) -DDO_ITT_NOTIFY -DUSE_PTHREAD + endif + ifeq ($(cfg), debug) +- CPLUS_FLAGS = -DTBB_DO_ASSERT -DDO_ITT_NOTIFY -g -O0 -DUSE_PTHREAD ++ CPLUS_FLAGS = $(CXXFLAGS) -DTBB_DO_ASSERT -DDO_ITT_NOTIFY -DUSE_PTHREAD -g -O0 + endif + + ASM= diff --git a/tbb-2.0-20070927-gcc43.patch b/tbb-2.0-20070927-gcc43.patch new file mode 100644 index 0000000..b3ea815 --- /dev/null +++ b/tbb-2.0-20070927-gcc43.patch @@ -0,0 +1,312 @@ +diff -urp tbb20_20070927oss_src/src/test/harness_memory.h tbb20_20070927oss_src.pm3/src/test/harness_memory.h +--- tbb20_20070927oss_src/src/test/harness_memory.h 2007-09-28 22:13:25.000000000 +0200 ++++ tbb20_20070927oss_src.pm3/src/test/harness_memory.h 2007-12-19 20:00:49.000000000 +0100 +@@ -59,7 +59,7 @@ static size_t GetMemoryUsage() { + size_t pagesize = getpagesize(); + ASSERT( statsfile, NULL ); + long total_mem; +- fscanf(statsfile,"%lu",&total_mem); ++ ASSERT( fscanf(statsfile,"%lu",&total_mem) == 1, NULL ); + fclose(statsfile); + return total_mem*pagesize; + #elif __APPLE__ +diff -urp tbb20_20070927oss_src.orig/src/test/test_concurrent_hash_map.cpp tbb20_20070927oss_src/src/test/test_concurrent_hash_map.cpp +--- tbb20_20070927oss_src.orig/src/test/test_concurrent_hash_map.cpp 2008-01-31 16:03:16.000000000 +0100 ++++ tbb20_20070927oss_src/src/test/test_concurrent_hash_map.cpp 2008-01-31 16:04:29.000000000 +0100 +@@ -177,7 +177,7 @@ public: + }; + + template +-void DoConcurrentOperations( MyTable& table, int n, char* what, int nthread ) { ++void DoConcurrentOperations( MyTable& table, int n, char const* what, int nthread ) { + if( Verbose ) + printf("testing %s with %d threads\n",what,nthread); + tbb::tick_count t0 = tbb::tick_count::now(); +diff -urp tbb20_20070927oss_src/include/tbb/concurrent_hash_map.h tbb20_20070927oss_src.ORIG/include/tbb/concurrent_hash_map.h +--- tbb20_20070927oss_src.orig/include/tbb/concurrent_hash_map.h 2008-02-08 17:17:13.000000000 +0100 ++++ tbb20_20070927oss_src/include/tbb/concurrent_hash_map.h 2008-02-08 19:04:49.000000000 +0100 +@@ -584,7 +584,7 @@ bool concurrent_hash_map= sizeof(Bin) * numBlockBins, ASSERT_TEXT ); + tls = (Bin*) bootStrapMalloc(tlsSize); + /* the block contains zeroes after bootStrapMalloc, so bins are initialized */ + #ifdef MALLOC_DEBUG +- for (i = 0; i < numBlockBinLimit; i++) { ++ for (int i = 0; i < numBlockBinLimit; i++) { + MALLOC_ASSERT( tls[i].activeBlk == 0, ASSERT_TEXT ); + MALLOC_ASSERT( tls[i].mailbox == 0, ASSERT_TEXT ); + } +diff -urp tbb20_20070927oss_src.orig/src/tbb/concurrent_vector.cpp tbb20_20070927oss_src/src/tbb/concurrent_vector.cpp +--- tbb20_20070927oss_src.orig/src/tbb/concurrent_vector.cpp 2008-01-31 14:07:33.000000000 +0100 ++++ tbb20_20070927oss_src/src/tbb/concurrent_vector.cpp 2008-01-31 14:21:46.000000000 +0100 +@@ -31,6 +31,7 @@ + #include + #include "itt_notify.h" + #include "tbb/task.h" ++#include + + + namespace tbb { +diff -urp tbb20_20070927oss_src.orig/include/tbb/concurrent_vector.h tbb20_20070927oss_src/include/tbb/concurrent_vector.h +--- tbb20_20070927oss_src.orig/include/tbb/concurrent_vector.h 2008-01-31 15:39:02.000000000 +0100 ++++ tbb20_20070927oss_src/include/tbb/concurrent_vector.h 2008-01-31 15:48:04.000000000 +0100 +@@ -280,7 +280,7 @@ public: // workaround for MSVC + size_t k = ++my_index; + if( my_item ) { + // Following test uses 2's-complement wizardry +- if( (k& k-2)==0 ) { ++ if( (k& (k-2))==0 ) { + // k is a power of two that is at least k-2 + my_item= NULL; + } else { +@@ -296,7 +296,7 @@ public: // workaround for MSVC + size_t k = my_index--; + if( my_item ) { + // Following test uses 2's-complement wizardry +- if( (k& k-2)==0 ) { ++ if( (k& (k-2))==0 ) { + // k is a power of two that is at least k-2 + my_item= NULL; + } else { +diff -urp tbb20_20070927oss_src.orig/src/tbbmalloc/Statistics.h tbb20_20070927oss_src/src/tbbmalloc/Statistics.h +--- tbb20_20070927oss_src.orig/src/tbbmalloc/Statistics.h 2008-01-31 14:07:33.000000000 +0100 ++++ tbb20_20070927oss_src/src/tbbmalloc/Statistics.h 2008-01-31 14:16:12.000000000 +0100 +@@ -66,7 +66,7 @@ static inline int STAT_increment(int thr + return ++(statistic[thread][bin].counter[ctr]); + } + #else +-#define STAT_increment(a,b,c) ((int)0) ++#define STAT_increment(a,b,c) ((void)0) + #endif + + static inline void STAT_print(int thread) +diff -urp tbb20_20070927oss_src.orig/src/tbb/task.cpp tbb20_20070927oss_src/src/tbb/task.cpp +--- tbb20_20070927oss_src.orig/src/tbb/task.cpp 2008-01-31 15:22:32.000000000 +0100 ++++ tbb20_20070927oss_src/src/tbb/task.cpp 2008-01-31 15:28:11.000000000 +0100 +@@ -393,7 +393,7 @@ static inline bool IsGenuineIntel() { + bool result = true; + #if defined(__TBB_cpuid) + char info[16]; +- char *genuine_string = "GenuntelineI"; ++ static char const genuine_string[] = "GenuntelineI"; + __TBB_x86_cpuid( reinterpret_cast(info), 0 ); + // The multibyte chars below spell "GenuineIntel". + //if( info[1]=='uneG' && info[3]=='Ieni' && info[2]=='letn' ) { +diff -urp tbb20_20070927oss_src.orig/src/tbb/pipeline.cpp tbb20_20070927oss_src/src/tbb/pipeline.cpp +--- tbb20_20070927oss_src.orig/src/tbb/pipeline.cpp 2008-01-31 15:08:02.000000000 +0100 ++++ tbb20_20070927oss_src/src/tbb/pipeline.cpp 2008-01-31 15:14:19.000000000 +0100 +@@ -62,6 +62,10 @@ class ordered_buffer { + //! Initial size for "array" + /** Must be a power of 2 */ + static const size_type initial_buffer_size = 4; ++ ++ static inline size_type getindex(size_type token, size_type size) { ++ return token & (size - 1); ++ } + public: + //! Construct empty buffer. + ordered_buffer() : array(NULL), array_size(0), low_token(0) { +@@ -92,7 +96,7 @@ public: + if( token-low_token>=array_size ) + grow( token-low_token+1 ); + ITT_NOTIFY( sync_releasing, this ); +- array[token&array_size-1] = &putter; ++ array[getindex(token, array_size)] = &putter; + } + } + return result; +@@ -106,7 +110,7 @@ public: + spin_mutex::scoped_lock lock( array_mutex ); + if( token==low_token ) { + // Wake the next task +- task*& item = array[++low_token & array_size-1]; ++ task*& item = array[getindex(++low_token, array_size)]; + ITT_NOTIFY( sync_acquired, this ); + wakee = item; + item = NULL; +@@ -129,7 +133,7 @@ void ordered_buffer::grow( size_type min + new_array[i] = NULL; + long t=low_token; + for( size_type i=0; i(operator new( n )); +@@ -181,7 +185,7 @@ bool micro_queue::pop( void* dst, ticket + SpinwaitWhileEq( tail_counter, k ); + page& p = *head_page; + __TBB_ASSERT( &p, NULL ); +- size_t index = (k/concurrent_queue_rep::n_queue & base.items_per_page-1); ++ size_t index = concurrent_queue_rep::getindex(k, base); + bool success = false; + { + pop_finalizer finalizer( *this, k+concurrent_queue_rep::n_queue, index==base.items_per_page-1 ? &p : NULL ); +@@ -319,7 +323,7 @@ public: + else { + concurrent_queue_base::page* p = array[concurrent_queue_rep::index(k)]; + __TBB_ASSERT(p,NULL); +- size_t i = k/concurrent_queue_rep::n_queue & my_queue.items_per_page-1; ++ size_t i = concurrent_queue_rep::getindex(k, my_queue); + return static_cast(static_cast(p+1)) + my_queue.item_size*i; + } + } +@@ -351,7 +355,7 @@ void concurrent_queue_iterator_base::adv + size_t k = my_rep->head_counter; + const concurrent_queue_base& queue = my_rep->my_queue; + __TBB_ASSERT( my_item==my_rep->choose(k), NULL ); +- size_t i = k/concurrent_queue_rep::n_queue & queue.items_per_page-1; ++ size_t i = concurrent_queue_rep::getindex(k, queue); + if( i==queue.items_per_page-1 ) { + concurrent_queue_base::page*& root = my_rep->array[concurrent_queue_rep::index(k)]; + root = root->next; +diff -urp tbb20_20070927oss_src.orig/include/tbb/concurrent_hash_map.h tbb20_20070927oss_src/include/tbb/concurrent_hash_map.h +--- tbb20_20070927oss_src.orig/include/tbb/concurrent_hash_map.h 2008-01-31 16:03:16.000000000 +0100 ++++ tbb20_20070927oss_src/include/tbb/concurrent_hash_map.h 2008-01-31 16:10:02.000000000 +0100 +@@ -328,7 +328,7 @@ private: + }; + + segment& get_segment( hashcode_t hashcode ) { +- return my_segment[hashcode&n_segment-1]; ++ return my_segment[hashcode&(n_segment-1)]; + } + + HashCompare my_hash_compare; +diff -urp tbb20_20070927oss_src.orig/include/tbb/parallel_scan.h tbb20_20070927oss_src/include/tbb/parallel_scan.h +--- tbb20_20070927oss_src.orig/include/tbb/parallel_scan.h 2008-01-31 16:19:28.000000000 +0100 ++++ tbb20_20070927oss_src/include/tbb/parallel_scan.h 2008-01-31 16:30:17.000000000 +0100 +@@ -232,7 +232,7 @@ namespace internal { + is_final = false; + } + task* next_task = NULL; +- if( is_right_child && !treat_as_stolen || partitioner.should_execute_range(range, *this) ) { ++ if( (is_right_child && !treat_as_stolen) || partitioner.should_execute_range(range, *this) ) { + if( is_final ) + (body->body)( range, final_scan_tag() ); + else if( sum ) +diff -urp tbb20_20070927oss_src/src/tbb/cache_aligned_allocator.cpp tbb20_20070927oss_src.pm/src/tbb/cache_aligned_allocator.cpp +--- tbb20_20070927oss_src/src/tbb/cache_aligned_allocator.cpp 2007-09-28 22:13:24.000000000 +0200 ++++ tbb20_20070927oss_src.pm/src/tbb/cache_aligned_allocator.cpp 2008-02-08 12:51:36.000000000 +0100 +@@ -129,7 +129,7 @@ void* NFS_Allocate( size_t n, size_t ele + using namespace internal; + size_t m = NFS_LineSize; + __TBB_ASSERT( m<=NFS_MaxLineSize, "illegal value for NFS_LineSize" ); +- __TBB_ASSERT( (m & m-1)==0, "must be power of two" ); ++ __TBB_ASSERT( (m & (m-1))==0, "must be power of two" ); + size_t bytes = n*element_size; + unsigned char* base; + if( bytes=BigSize?malloc(m+bytes):(*MallocHandler)(m+bytes))) ) { diff --git a/tbb-2.0-20070927-parallel-make.patch b/tbb-2.0-20070927-parallel-make.patch new file mode 100644 index 0000000..9a2cdb7 --- /dev/null +++ b/tbb-2.0-20070927-parallel-make.patch @@ -0,0 +1,57 @@ +diff -urp tbb20_20070927oss_src/Makefile tbb20_20070927oss_src.pm2/Makefile +--- tbb20_20070927oss_src/Makefile 2007-09-28 22:13:21.000000000 +0200 ++++ tbb20_20070927oss_src.pm2/Makefile 2007-12-19 19:46:26.000000000 +0100 +@@ -25,6 +25,7 @@ + # the GNU General Public License. + + tbb_root?=. ++orig_tbb_root:=$(tbb_root) + include $(tbb_root)/build/common.inc + .PHONY: all tbb tbbmalloc test debug examples clean + +@@ -47,6 +48,9 @@ examples: tbb tbbmalloc examples_debug c + clean: clean_release clean_debug clean_examples + @echo clean done + ++# Introduce explicit dependencies to aid parallel make. ++test_release: tbb_release ++tbbmalloc_test_release: tbbmalloc_release + + .PHONY: tbb_release tbb_debug test_release test_debug + +@@ -57,11 +60,15 @@ tbb_release: mkdir_release + tbb_debug: mkdir_debug + $(MAKE) -C "$(work_dir)_debug" -r -f $(tbb_root)/build/Makefile.tbb cfg=debug tbb_root=$(tbb_root) + +-test_release: mkdir_release tbb_release test_release_no_depends ++test_release: mkdir_release tbb_release ++ $(MAKE) cfg=release tbb_root=$(orig_tbb_root) test_release_no_depends ++ + test_release_no_depends: + -$(MAKE) -C "$(work_dir)_release" -r -f $(tbb_root)/build/Makefile.test cfg=release tbb_root=$(tbb_root) + +-test_debug: tbb_debug mkdir_debug test_debug_no_depends ++test_debug: tbb_debug mkdir_debug ++ $(MAKE) cfg=release tbb_root=$(orig_tbb_root) test_debug_no_depends ++ + test_debug_no_depends: + -$(MAKE) -C "$(work_dir)_debug" -r -f $(tbb_root)/build/Makefile.test cfg=debug tbb_root=$(tbb_root) + +@@ -73,11 +80,15 @@ tbbmalloc_release: mkdir_release + tbbmalloc_debug: mkdir_debug + $(MAKE) -C "$(work_dir)_debug" -r -f $(tbb_root)/build/Makefile.tbbmalloc cfg=debug malloc tbb_root=$(tbb_root) + +-tbbmalloc_test_release: tbb_release tbbmalloc_release mkdir_release tbbmalloc_test_release_no_depends ++tbbmalloc_test_release: tbb_release tbbmalloc_release mkdir_release ++ $(MAKE) cfg=release tbb_root=$(orig_tbb_root) tbbmalloc_test_release_no_depends ++ + tbbmalloc_test_release_no_depends: + -$(MAKE) -C "$(work_dir)_release" -r -f $(tbb_root)/build/Makefile.tbbmalloc cfg=release malloc_test tbb_root=$(tbb_root) + +-tbbmalloc_test_debug: tbb_debug tbbmalloc_debug mkdir_debug tbbmalloc_test_debug_no_depends ++tbbmalloc_test_debug: tbb_debug tbbmalloc_debug mkdir_debug ++ $(MAKE) cfg=release tbb_root=$(orig_tbb_root) tbbmalloc_test_debug_no_depends ++ + tbbmalloc_test_debug_no_depends: + -$(MAKE) -C "$(work_dir)_debug" -r -f $(tbb_root)/build/Makefile.tbbmalloc cfg=debug malloc_test tbb_root=$(tbb_root) + diff --git a/tbb-2.0-20070927-soname.patch b/tbb-2.0-20070927-soname.patch new file mode 100644 index 0000000..b7e799d --- /dev/null +++ b/tbb-2.0-20070927-soname.patch @@ -0,0 +1,52 @@ +diff -ur tbb-2.0r014/build/Makefile.tbb tbb-2.0r014.test/build/Makefile.tbb +--- tbb-2.0r014/build/Makefile.tbb 2007-09-21 21:16:34.000000000 -0400 ++++ tbb-2.0r014.test/build/Makefile.tbb 2007-12-15 17:28:09.000000000 -0500 +@@ -74,9 +74,12 @@ + + # Object files that gmake up TBB (TBB_ASM.OBJ is platform-specific) + TBB.OBJ = $(TBB_CPLUS.OBJ) $(TBB_ASM.OBJ) ++LIB_LINK_FLAGS += -Wl,-soname=$(TBB.DLL).$(SONAME_SUFFIX) + + $(TBB.DLL): $(TBB.OBJ) $(TBB.DEF) $(TBB.RES) tbbvars +- $(CPLUS) $(TBB.OBJ) $(TBB.RES) $(LIBS) $(PIC_KEY) $(OUTPUT_KEY)$(TBB.DLL) $(LIB_LINK_FLAGS) ++ $(CPLUS) $(TBB.OBJ) $(TBB.RES) $(LIBS) $(PIC_KEY) $(OUTPUT_KEY)$(TBB.DLL).$(VERSION) $(LIB_LINK_FLAGS) ++ ln -s $(TBB.DLL).$(VERSION) $(TBB.DLL).$(SONAME_SUFFIX) ++ ln -s $(TBB.DLL).$(VERSION) $(TBB.DLL) + + + #clean: +diff -ur tbb-2.0r014/build/Makefile.tbbmalloc tbb-2.0r014.test/build/Makefile.tbbmalloc +--- tbb-2.0r014/build/Makefile.tbbmalloc 2007-09-21 21:16:34.000000000 -0400 ++++ tbb-2.0r014.test/build/Makefile.tbbmalloc 2007-12-15 17:28:32.000000000 -0500 +@@ -58,6 +58,7 @@ + # 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) ++LIB_LINK_FLAGS += -Wl,-soname=$(MALLOC.DLL).$(SONAME_SUFFIX) + M_CPLUS_FLAGS := $(subst $(WARNING_KEY),,$(M_CPLUS_FLAGS)) + + $(MALLOC_CPLUS.OBJ): %.$(OBJ): %.cpp +@@ -69,7 +70,9 @@ + + $(MALLOC.DLL): TBB.DEF=$(MALLOC.DEF) + $(MALLOC.DLL): $(MALLOC.OBJ) $(MALLOC.DEF) $(TBBMALLOC.RES) +- $(CPLUS) $(MALLOC.OBJ) $(TBBMALLOC.RES) $(LIBS) $(PIC_KEY) $(OUTPUT_KEY)$(MALLOC.DLL) $(LIB_LINK_FLAGS) ++ $(CPLUS) $(MALLOC.OBJ) $(TBBMALLOC.RES) $(LIBS) $(PIC_KEY) $(OUTPUT_KEY)$(MALLOC.DLL).$(VERSION) $(LIB_LINK_FLAGS) ++ ln -s $(MALLOC.DLL).$(VERSION) $(MALLOC.DLL).$(SONAME_SUFFIX) ++ ln -s $(MALLOC.DLL).$(VERSION) $(MALLOC.DLL) + + malloc: $(MALLOC.DLL) + +diff -ur tbb-2.0r014/build/common.inc tbb-2.0r014.test/build/common.inc +--- tbb-2.0r014/build/common.inc 2007-09-21 21:16:34.000000000 -0400 ++++ tbb-2.0r014.test/build/common.inc 2007-12-15 16:43:10.000000000 -0500 +@@ -24,6 +24,9 @@ + # invalidate any other reasons why the executable file might be covered by + # the GNU General Public License. + ++VERSION=2.0.014 ++SONAME_SUFFIX=2 ++ + ifndef tbb_os + ifeq ($(OS), Windows_NT) + export tbb_os=windows diff --git a/tbb.spec b/tbb.spec new file mode 100644 index 0000000..b5ffd5e --- /dev/null +++ b/tbb.spec @@ -0,0 +1,142 @@ +%define releasedate 20070927 +%define sourcebasename tbb20_%{releasedate}oss_src +%define sourcefilename %{sourcebasename}.tar.gz + +Summary: The Threading Building Blocks library abstracts low-level threading details +Name: tbb +Version: 2.0 +Release: 4.%{releasedate}%{?dist} +License: GPLv2 with exceptions +Group: Development/Tools +URL: http://threadingbuildingblocks.org/ +Source: http://threadingbuildingblocks.org/uploads/77/84/2.0/%{sourcefilename} +Source2: http://cache-www.intel.com/cd/00/00/30/11/301111_301111.pdf +Source3: http://cache-www.intel.com/cd/00/00/30/11/301114_301114.pdf +Source4: http://cache-www.intel.com/cd/00/00/30/11/301132_301132.pdf +Source5: http://cache-www.intel.com/cd/00/00/31/26/312687_312687.pdf +Patch0: tbb-2.0-20070927-soname.patch +Patch1: tbb-2.0-20070927-cxxflags.patch +Patch2: tbb-2.0-20070927-parallel-make.patch +Patch3: tbb-2.0-20070927-gcc43.patch +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +BuildRequires: libstdc++-devel +# We need "arch" and "hostname" binaries: +BuildRequires: util-linux net-tools +ExclusiveArch: %{ix86} x86_64 ia64 + +%description +Threading Building Blocks (TBB) is a C++ runtime library that +abstracts the low-level threading details necessary for optimal +multi-core performance. It uses common C++ templates and coding style +to eliminate tedious threading implementation work. + +TBB requires fewer lines of code to achieve parallelism than other +threading models. The applications you write are portable across +platforms. Since the library is also inherently scalable, no code +maintenance is required as more processor cores become available. + + +%package devel +Summary: The Threading Building Blocks C++ headers and shared development libraries +Group: Development/Libraries +Requires: tbb = %{version}-%{release} + +%description devel +Header files and shared object symlinks for the Threading Building +Blocks (TBB) C++ libraries. + + +%package doc +Summary: The Threading Building Blocks documentation +Group: Documentation + +%description doc +PDF documentation for the user of the Threading Building Block (TBB) +C++ library. + + +%prep +%setup -q -n %{sourcebasename} +%patch0 -p1 +%patch1 -p1 +%patch2 -p1 +%patch3 -p1 + +%build +# Currently we build TBB in debug mode. This overrides some of the +# CXXFLAGS passed in, namely turns off optimizations. Either GCC 4.3 +# or TBB have a bug that prevents TBB to compile correctly on anything +# above -O0. As soon as upstream has this situation resolved, release +# builds can be reintroduced. +make %{?_smp_mflags} CXXFLAGS="$RPM_OPT_FLAGS" DEBUG_SUFFIX= tbb_build_prefix=obj debug + +cp -p %{SOURCE2} %{SOURCE3} %{SOURCE4} %{SOURCE5} . +ln -s `basename %{SOURCE2}` getting_started_guide.pdf +ln -s `basename %{SOURCE3}` reference_manual.pdf +ln -s `basename %{SOURCE4}` tutorial.pdf +ln -s `basename %{SOURCE5}` release_notes.pdf + +%install +rm -rf $RPM_BUILD_ROOT + +pushd build/obj_debug + for file in libtbb{,malloc}; do + install -p -D -m 755 ${file}.so $RPM_BUILD_ROOT/%{_libdir}/$file.so.2.0 + ln -s $file.so.2.0 $RPM_BUILD_ROOT/%{_libdir}/$file.so.2 + ln -s $file.so.2.0 $RPM_BUILD_ROOT/%{_libdir}/$file.so + done +popd + +pushd include + find tbb -type f -name \*.h -exec \ + install -p -D -m 644 {} $RPM_BUILD_ROOT/%{_includedir}/{} \ + \; +popd + +%post -p /sbin/ldconfig + +%postun -p /sbin/ldconfig + +%clean +rm -rf ${RPM_BUILD_ROOT} + +%files +%defattr(-,root,root,-) +%doc COPYING +%{_libdir}/*.so.2.0 +%{_libdir}/*.so.2 + +%files devel +%defattr(-,root,root,-) +%{_includedir}/tbb +%{_libdir}/*.so + +%files doc +%defattr(-,root,root,-) +%doc 301111_301111.pdf getting_started_guide.pdf +%doc 301114_301114.pdf reference_manual.pdf +%doc 301132_301132.pdf tutorial.pdf +%doc 312687_312687.pdf release_notes.pdf + +%changelog +* Wed Feb 13 2008 Petr Machata - 2.0-4.20070927 +- Review fixes + - Use updated URL + - More timestamp preservation +- Initial import into Fedora CVS + +* Mon Feb 11 2008 Petr Machata - 2.0-3.20070927 +- Review fixes + - Preserve timestamp of installed files + - Fix soname not to contain "debug" + +* Tue Feb 5 2008 Petr Machata - 2.0-2.20070927 +- Review fixes + - GCC 4.3 patchset + - Add BR util-linux net-tools + - Add full URL to Source0 + - Build in debug mode to work around problems with GCC 4.3 + +* Mon Dec 17 2007 Petr Machata - 2.0-1.20070927 +- Initial package. +- Using SONAME patch from Debian.