Intel® oneAPI Threading Building Blocks
Ask questions and share information about adding parallelism to your applications when using this threading library.

Install on Windows with gcc

inddzen
Beginner
752 Views
Hi all,

I mainly work using Code::Blocks so I tried to build TBB using gcc-mingw instead of Visual Studio.
I dowloaded the src pack, however during the make I'm getting the some errors in thread_monitor.h. (I've copy pasted bellow).
Just in case I installed the pthread library for win32, but still have the same errors.
Does anyone have an idea about the issue and how to fix it?

Thanks in advance!


C:\Program Files\Intel\TBB\2.2>make arch=ia64 compiler=gcc
cd ".\\build\\windows_ia64_gcc_mingw_release" && cmd /C "..\..\build\generate_tbbvars.bat" windows_ia64_gcc_mingw_release
Generating tbbvars.bat
Generating tbbvars.sh
Generating tbbvars.csh
cd ".\\build\\windows_ia64_gcc_mingw_debug" && cmd /C "..\..\build\generate_tbbvars.bat" windows_ia64_gcc_mingw_debug
Generating tbbvars.bat
Generating tbbvars.sh
Generating tbbvars.csh
make -C ".\\build\\windows_ia64_gcc_mingw_debug" -r -f ../../build/Makefile.tbb cfg=debug tbb_root=../..
make[1]: entrant dans le rpertoire C:/Program Files/Intel/TBB/2.2/build/windows_ia64_gcc_mingw_debug
../../build/Makefile.tbb:39: CONFIG: cfg=debug arch=ia64 compiler=gcc os=windows runtime=mingw
g++ -c -MMD -g -O0 -DTBB_USE_DEBUG -DUSE_WINTHREAD -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -D__TBB_BUILD=1 -Wall -Wno-uninitialized -Wno-parentheses
-I../../src -I../../src/rml/include -I../../include ../../src/tbb/concurrent_hash_map.cpp
g++ -c -MMD -g -O0 -DTBB_USE_DEBUG -DUSE_WINTHREAD -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -D__TBB_BUILD=1 -Wall -Wno-uninitialized -Wno-parentheses
-I../../src -I../../src/rml/include -I../../include ../../src/tbb/concurrent_queue.cpp
g++ -c -MMD -g -O0 -DTBB_USE_DEBUG -DUSE_WINTHREAD -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -D__TBB_BUILD=1 -Wall -Wno-uninitialized -Wno-parentheses
-I../../src -I../../src/rml/include -I../../include ../../src/tbb/concurrent_vector.cpp
g++ -c -MMD -g -O0 -DTBB_USE_DEBUG -DUSE_WINTHREAD -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -D__TBB_BUILD=1 -Wall -Wno-uninitialized -Wno-parentheses
-I../../src -I../../src/rml/include -I../../include ../../src/tbb/dynamic_link.cpp
g++ -c -MMD -g -O0 -DTBB_USE_DEBUG -DUSE_WINTHREAD -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -D__TBB_BUILD=1 -Wall -Wno-uninitialized -Wno-parentheses
-I../../src -I../../src/rml/include -I../../include ../../src/tbb/itt_notify.cpp
g++ -c -MMD -g -O0 -DTBB_USE_DEBUG -DUSE_WINTHREAD -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -D__TBB_BUILD=1 -Wall -Wno-uninitialized -Wno-parentheses
-I../../src -I../../src/rml/include -I../../include ../../src/tbb/cache_aligned_allocator.cpp
g++ -c -MMD -g -O0 -DTBB_USE_DEBUG -DUSE_WINTHREAD -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -D__TBB_BUILD=1 -Wall -Wno-uninitialized -Wno-parentheses
-I../../src -I../../src/rml/include -I../../include ../../src/tbb/pipeline.cpp
g++ -c -MMD -g -O0 -DTBB_USE_DEBUG -DUSE_WINTHREAD -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -D__TBB_BUILD=1 -Wall -Wno-uninitialized -Wno-parentheses
-I../../src -I../../src/rml/include -I../../include ../../src/tbb/queuing_mutex.cpp
g++ -c -MMD -g -O0 -DTBB_USE_DEBUG -DUSE_WINTHREAD -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -D__TBB_BUILD=1 -Wall -Wno-uninitialized -Wno-parentheses
-I../../src -I../../src/rml/include -I../../include ../../src/tbb/queuing_rw_mutex.cpp
g++ -c -MMD -g -O0 -DTBB_USE_DEBUG -DUSE_WINTHREAD -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -D__TBB_BUILD=1 -Wall -Wno-uninitialized -Wno-parentheses
-I../../src -I../../src/rml/include -I../../include ../../src/tbb/spin_rw_mutex.cpp
g++ -c -MMD -g -O0 -DTBB_USE_DEBUG -DUSE_WINTHREAD -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -D__TBB_BUILD=1 -Wall -Wno-uninitialized -Wno-parentheses
-I../../src -I../../src/rml/include -I../../include ../../src/tbb/spin_mutex.cpp
g++ -c -MMD -g -O0 -DTBB_USE_DEBUG -DUSE_WINTHREAD -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -D__TBB_BUILD=1 -Wall -Wno-uninitialized -Wno-parentheses
-I../../src -I../../src/rml/include -I../../include ../../src/tbb/task.cpp
cmd /C cscript /nologo /E:jscript ../../build/version_info_windows.js gcc ia64 "g++ -g -O0 -DTBB_USE_DEBUG -DUSE_WINTHREAD -D__MSVCRT_VERSION__=0x0700 -ms
se -mthreads -D__TBB_BUILD=1 -Wall -Wno-uninitialized -Wno-parentheses -I../../src -I../../src/rml/include -I../../include" > version_string.tmp
g++ -c -MMD -g -O0 -DTBB_USE_DEBUG -DUSE_WINTHREAD -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -D__TBB_BUILD=1 -Wall -Wno-uninitialized -Wno-parentheses
-I. -I../../src -I../../src/rml/include -I../../include ../../src/tbb/tbb_misc.cpp
g++ -c -MMD -g -O0 -DTBB_USE_DEBUG -DUSE_WINTHREAD -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -D__TBB_BUILD=1 -Wall -Wno-uninitialized -Wno-parentheses
-I../../src -I../../src/rml/include -I../../include ../../src/tbb/mutex.cpp
g++ -c -MMD -g -O0 -DTBB_USE_DEBUG -DUSE_WINTHREAD -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -D__TBB_BUILD=1 -Wall -Wno-uninitialized -Wno-parentheses
-I../../src -I../../src/rml/include -I../../include ../../src/tbb/recursive_mutex.cpp
g++ -c -MMD -g -O0 -DTBB_USE_DEBUG -DUSE_WINTHREAD -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -D__TBB_BUILD=1 -Wall -Wno-uninitialized -Wno-parentheses
-I../../src -I../../src/rml/include -I../../include ../../src/tbb/tbb_thread.cpp
gcc -c -MMD -g -O0 -DTBB_USE_DEBUG -DUSE_WINTHREAD -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -D__TBB_BUILD=1 -Wall -Wno-uninitialized -Wno-parentheses
-I../../src -I../../src/rml/include -I../../include ../../src/tbb/itt_notify_proxy.c
g++ -c -MMD -g -O0 -DTBB_USE_DEBUG -DUSE_WINTHREAD -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -D__TBB_BUILD=1 -Wall -Wno-uninitialized -Wno-parentheses
-I../../src -I../../src/rml/include -I../../include ../../src/tbb/private_server.cpp
In file included from ../../src/tbb/private_server.cpp:30:
../../src/rml/include/../server/thread_monitor.h: In static member function `static void rml::internal::thread_monitor::launch(unsigned int (*)(void*), voi
d*, size_t)':
../../src/rml/include/../server/thread_monitor.h:129: error: `uintptr_t' was not declared in this scope
../../src/rml/include/../server/thread_monitor.h:129: error: expected `;' before "status"
../../src/rml/include/../server/thread_monitor.h:130: error: `status' was not declared in this scope
../../src/rml/include/../server/thread_monitor.h:128: warning: unused variable 'thread_id'
../../src/rml/include/../server/thread_monitor.h:129: warning: unused variable 'uintptr_t'
../../src/tbb/private_server.cpp: In static member function `static unsigned int tbb::internal::rml::private_worker::thread_routine(void*)':
../../src/tbb/private_server.cpp:201: warning: converting to non-pointer type `unsigned int' from NULL
make[1]: *** [private_server.o] Erreur 1
make[1]: quittant le rpertoire C:/Program Files/Intel/TBB/2.2/build/windows_ia64_gcc_mingw_debug
make: *** [tbb] Erreur 2


0 Kudos
4 Replies
RafSchietekat
Valued Contributor III
752 Views
Difficult to say without knowing any version details...
0 Kudos
inddzen
Beginner
752 Views
Quoting - Raf Schietekat
Difficult to say without knowing any version details...

Well, I just managed to resolve the problem by building from the stable release sourcetbb22_20090809oss_src.tgz instead of theCommercial Aligned Release "tbb22_009oss_src.tgz"

However, I'm not getting any library file, just the dlls. SoI create them using dlltool.

To test I picked up the "sub_string_finder".
I linked the libraries to my project and tried to run, but I got the errors listing bellow.

Obviously there's something wrong with the libraries, maybeoriginallyfrom the dlls, but what?

F:tbbtestmain.cpp|48|undefined reference to `tbb::task_group_context::~task_group_context()'|
F:tbbtestmain.cpp|48|undefined reference to `tbb::task_group_context::~task_group_context()'|
objDebugmain.o||In function `_ZN3tbb10empty_task7executeEv':|
)]+0x14)||undefined reference to `tbb::internal::allocate_root_with_context_proxy::free(tbb::task&) const'|
)]+0x14)||undefined reference to `tbb::internal::allocate_root_with_context_proxy::allocate(unsigned int) const'|
unsigned int)]+0x2f)||undefined reference to `tbb::task_group_context::init()'|
C:Program FilesCodeBlocksMinGWbin..libgccmingw323.4.5........includetbbblocked_range.h:
(.text$_ZN3tbb4taskD2Ev[tbb::task::~task()]+0xb)||undefined reference to `vtable for tbb::task'|
)]+0x16)||undefined reference to `tbb::internal::get_initial_auto_partitioner_divisor()'|
C:Program FilesCodeBlocksMinGWbin..libgccmingw323.4.5........includetbbblocked_range.h:
(.text$_ZN3tbb4taskC2Ev[tbb::task::task()]+0x16)||undefined reference to `vtable for tbb::task'|
)]+0x14)||undefined reference to `tbb::internal::allocate_child_proxy::free(tbb::task&) const'|
)]+0x14)||undefined reference to `tbb::internal::allocate_child_proxy::allocate(unsigned int) const'|
)]+0x14)||undefined reference to `tbb::internal::allocate_continuation_proxy::allocate(unsigned int) const'|
C:Program FilesCodeBlocksMinGWbin..libgccmingw323.4.5........includetbbblocked_range.h:
(.rdata$_ZTVN3tbb10empty_taskE[vtable for tbb::empty_task]+0x14)||undefined reference to `tbb::task::note_affinity(unsigned short)'|
||=== Build finished: 12 errors, 0 warnings ===|

0 Kudos
Alexey-Kukanov
Employee
752 Views
Quoting - inddzen
Well, I just managed to resolve the problem by building from the stable release sourcetbb22_20090809oss_src.tgz instead of theCommercial Aligned Release "tbb22_009oss_src.tgz"

However, I'm not getting any library file, just the dlls. SoI create them using dlltool.

To test I picked up the "sub_string_finder".
I linked the libraries to my project and tried to run, but I got the errors listing bellow.

Obviously there's something wrong with the libraries, maybeoriginallyfrom the dlls, but what?

(Edited) If somebody has seen what I wrote here initially, I guessed there is an issue in our recent com-aligned package. A quick check, however, showed that it is not necessarily true, as I just successfully built TBB with minGW on my laptop. So it might be the problem of a particular version (or my luck to use a version without the problem). Here is what I have:
C:>gcc --version
gcc (4.3.3-tdm-1 mingw32) 4.3.3
My another concern is the specification of arch=ia64 in the command line to build TBB. What do you expect from it? And what is your environment in general?

As for the library files being absent: I believe that they are unnecessary, as the DLLs are created with --enable-auto-import option (see windows.gcc.inc) which should make them usable directly instead of lib files. So could you please check if your app will work linked with DLLs directly (instead of libs)? And of course let us know if there are problems with that.
0 Kudos
vu64
Beginner
752 Views
The gcc compiler that comes with Code::Blocks is rather old. And the VisualC++ compiler (not the visual studio)is completely free and quite good. You can still use Code::Blocks with it.

0 Kudos
Reply