Recently, I want to use TBB on a development board with an ARM multi-core processor. Although TBB is not officially announced to be ported on ARM architecture, I got a patch (written by Mr. Raf Schietekat) that seems to port TBB on ARM architecture.
My cross compilation environment is as follows:
Host: OpenSUSE Linux 11 64bit (IA64)
Target:Embedded Linux (ARM)
Cross Compiler:Sourcery G++ Lite 2009q1-203 for ARM GNU/Linux(http://www.codesourcery.com/sgpp/lite/arm/portal/release858)
TBB version: tbb21_20080825osstbb21_20081019osstbb21_20090511oss
TBB patch version: atomic.Raf_Schietekat.20090402
My cross compilation steps are as follows:
1. In Line 42 of linux.gcc.inc, I modified "CPLUS = g++" into "CPLUS = /home/sammmas/ARMCrossCompiler/bin/arm-none-linux-gnueabi-c++"
2. type "make arch=arm" (I know "arm" is not defined in the makefile)
However, when I cross-compiled the TBB source files (patched successfully), I got the following error messages.
cd "./build/linux_arm_gcc_cc4.3.2_libc2.9_kernel2.6.27.5_release" && sh ../../build/generate_tbbvars.sh linux_arm_gcc_cc4.3.2_libc2.9_kernel2.6.27.5_release
cd "./build/linux_arm_gcc_cc4.3.2_libc2.9_kernel2.6.27.5_debug" && sh ../../build/generate_tbbvars.sh linux_arm_gcc_cc4.3.2_libc2.9_kernel2.6.27.5_debug
make -C "./build/linux_arm_gcc_cc4.3.2_libc2.9_kernel2.6.27.5_debug" -r -f ../../build/Makefile.tbb cfg=debug tbb_root=../..
make[1]: Entering directory `/home/creteken/tbb/tbb21_20080605oss/build/linux_arm_gcc_cc4.3.2_libc2.9_kernel2.6.27.5_debug'
../../build/Makefile.tbb:39: CONFIG: cfg=debug arch=arm compiler=gcc os=linux runtime=cc4.3.2_libc2.9_kernel2.6.27.5
/home/creteken/CodeSourcery/Sourcery_G++_Lite/bin/arm-none-linux-gnueabi-g++ -c -MMD -DTBB_DO_ASSERT -DDO_ITT_NOTIFY -g -O0 -DUSE_PTHREAD -fPIC -D__TBB_BUILD=1 -Wall -Wno-parentheses -I../../src -I../../include ../../src/tbb/concurrent_hash_map.cpp
In file included from ../../include/tbb/tbb_machine.h:699,
from ../../include/tbb/atomic.h:102,
from ../../include/tbb/spin_rw_mutex.h:33,
from ../../include/tbb/concurrent_hash_map.h:40,
from ../../src/tbb/concurrent_hash_map.cpp:29:
../../include/tbb/machine/gcc_arm.h: In static member function 'static bool __TBB_CompareStore<1u, signed char, M>::op(volatile void*, int8_t&, int8_t)':
../../include/tbb/machine/gcc_arm.h:135: error: 'atomic_word' was not declared in this scope
../../include/tbb/machine/gcc_arm.h:135: error: '::unsignedword' has not been declared
../../include/tbb/machine/gcc_arm.h:135: error: expected `;' before 'ucm'
../../include/tbb/machine/gcc_arm.h:135: error: 'indended' was not declared in this scope
../../include/tbb/machine/gcc_arm.h:135: error: 'ucm' was not declared in this scope
../../include/tbb/machine/gcc_arm.h: In static member function 'static int8_t __TBB_CompareAndSwap<1u, signed char, M>::op(volatile void*, int8_t, int8_t)':
../../include/tbb/machine/gcc_arm.h:135: error: 'atomic_word' was not declared in this scope
../../include/tbb/machine/gcc_arm.h:135: error: '::unsignedword' has not been declared
../../include/tbb/machine/gcc_arm.h:135: error: expected `;' before 'ucm'
../../include/tbb/machine/gcc_arm.h:135: error: 'ucm' was not declared in this scope
../../include/tbb/machine/gcc_arm.h: In static member function 'static bool __TBB_CompareStore<2u, short int, M>::op(volatile void*, int16_t&, int16_t)':
../../include/tbb/machine/gcc_arm.h:136: error: 'atomic_word' was not declared in this scope
../../include/tbb/machine/gcc_arm.h:136: error: '::unsignedword' has not been declared
../../include/tbb/machine/gcc_arm.h:136: error: expected `;' before 'ucm'
../../include/tbb/machine/gcc_arm.h:136: error: 'indended' was not declared in this scope
../../include/tbb/machine/gcc_arm.h:136: error: 'ucm' was not declared in this scope
../../include/tbb/machine/gcc_arm.h: In static member function 'static int16_t __TBB_CompareAndSwap<2u, short int, M>::op(volatile void*, int16_t, int16_t)':
../../include/tbb/machine/gcc_arm.h:136: error: 'atomic_word' was not declared in this scope
../../include/tbb/machine/gcc_arm.h:136: error: '::unsignedword' has not been declared
../../include/tbb/machine/gcc_arm.h:136: error: expected `;' before 'ucm'
../../include/tbb/machine/gcc_arm.h:136: error: 'ucm' was not declared in this scope
../../include/tbb/machine/gcc_arm.h: In static member function 'static bool __TBB_CompareStore<4u, int, M>::op(volatile void*, int32_t&, int32_t)':
../../include/tbb/machine/gcc_arm.h:137: error: 'atomic_word' was not declared in this scope
../../include/tbb/machine/gcc_arm.h:137: error: '::unsignedword' has not been declared
../../include/tbb/machine/gcc_arm.h:137: error: expected `;' before 'ucm'
../../include/tbb/machine/gcc_arm.h:137: error: 'indended' was not declared in this scope
../../include/tbb/machine/gcc_arm.h:137: error: 'ucm' was not declared in this scope
../../include/tbb/machine/gcc_arm.h: In static member function 'static int32_t __TBB_CompareAndSwap<4u, int, M>::op(volatile void*, int32_t, int32_t)':
../../include/tbb/machine/gcc_arm.h:137: error: 'atomic_word' was not declared in this scope
../../include/tbb/machine/gcc_arm.h:137: error: '::unsignedword' has not been declared
../../include/tbb/machine/gcc_arm.h:137: error: expected `;' before 'ucm'
../../include/tbb/machine/gcc_arm.h:137: error: 'ucm' was not declared in this scope
make[1]: *** [concurrent_hash_map.o] Error 1
make[1]: Leaving directory `/home/creteken/tbb/tbb21_20080605oss/build/linux_arm_gcc_cc4.3.2_libc2.9_kernel2.6.27.5_debug'
make: *** [tbb] Error 2
The problem seems to be that the definitions are in wrong scopes.
Where should I put the definitions? In namespace tbb? Or in the global namespace?
I tried to move the definitions to the global namespace and the above error messages disappear, but other scope problems come!!
Can someone tell me how to get rid of the above error messages?
Thank you very much!!
