Intel® oneAPI Threading Building Blocks
Ask questions and share information about adding parallelism to your applications when using this threading library.
Announcements
Welcome to the Intel Community. If you get an answer you like, please mark it as an Accepted Solution to help others. Thank you!

TBB and MinGW-w64

bherd80
Beginner
275 Views
Hi,
does anyone have any experience with TBB and MinGW-w64?I'm using the TDM GCC compiler suite (http://tdm-gcc.tdragon.net/) because I need to write a 64 Bit application under Windows using GCC. When trying to compile TBB with "mingw32-make compiler=gcc arch=ia64" however, I'm getting the following errors:

Created .\\\\build\\\\windows_ia64_gcc_mingw_release and ..._debug directories
mingw32-make -C ".\\\\build\\\\windows_ia64_gcc_mingw_debug" -r -f ../../build/Makefile.tbb cfg=debug tbb_root=../..
mingw32-make[1]: Entering directory `C:/Users/ben/Documents/Tools/tbb/tbb30_src/build/windows_ia64_gcc_mingw_debug'
../../build/Makefile.tbb:39: CONFIG: cfg=debug arch=ia64 compiler=gcc os=windowsruntime=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
In file included from ../../include/tbb/tbb_machine.h:41:0,
from ../../include/tbb/spin_rw_mutex.h:33,
from ../../include/tbb/concurrent_hash_map.h:50,
from ../../src/tbb/concurrent_hash_map.cpp:29:
../../include/tbb/machine/linux_ia32.h: In function 'int64_t __TBB_machine_load8(const volatile void*)':
../../include/tbb/machine/linux_ia32.h:148:20: error: cast from 'const volatilevoid*' to 'uint32_t' loses precision
../../include/tbb/machine/linux_ia32.h: In function 'void __TBB_machine_store8(volatile void*, int64_t)':
../../include/tbb/machine/linux_ia32.h:165:20: error: cast from 'volatile void*'to 'uint32_t' loses precision
mingw32-make[1]: *** [concurrent_hash_map.o] Error 1
mingw32-make[1]: Leaving directory `C:/Users/ben/Documents/Tools/tbb/tbb30_src/build/windows_ia64_gcc_mingw_debug'
mingw32-make: *** [tbb] Error 2
Created .\\\\build\\\\windows_ia64_gcc_mingw_release and ..._debug directoriesmingw32-make -C ".\\\\build\\\\windows_ia64_gcc_mingw_debug" -r -f ../../build/Makefile.tbb cfg=debug tbb_root=../..mingw32-make[1]: Entering directory `C:/Users/ben/Documents/Tools/tbb/tbb30_src/build/windows_ia64_gcc_mingw_debug'../../build/Makefile.tbb:39: CONFIG: cfg=debug arch=ia64 compiler=gcc os=windowsruntime=mingwg++ -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
In file included from ../../include/tbb/tbb_machine.h:41:0,
from ../../include/tbb/spin_rw_mutex.h:33,
from ../../include/tbb/concurrent_hash_map.h:50,
from ../../src/tbb/concurrent_hash_map.cpp:29:../../include/tbb/machine/linux_ia32.h:
In function 'int64_t __TBB_machine_load8(const volatile void*)': ../../include/tbb/machine/linux_ia32.h:148:20: error: cast from 'const volatile void*' to 'uint32_t' loses precision
../../include/tbb/machine/linux_ia32.h: In function 'void __TBB_machine_store8(volatile void*, int64_t)': ../../include/tbb/machine/linux_ia32.h:165:20: error: cast from 'volatile void*'to 'uint32_t' loses precision
mingw32-make[1]: *** [concurrent_hash_map.o] Error 1
mingw32-make[1]: Leaving directory `C:/Users/ben/Documents/Tools/tbb/tbb30_src/build/windows_ia64_gcc_mingw_debug'mingw32-make: *** [tbb]
Error 2

Seems that MinGW32-w64 is setting the wrong preprocessor directives. Does anyone have any suggestions on how to solve this problem?
Thanks a lot!
Ben
0 Kudos
4 Replies
Alexey_K_Intel3
Employee
275 Views
First of all, you should use arch=intel64.
And please take the most recent commercial-aligned release (TBB 3.0 Update 2) if you use something older.
bherd80
Beginner
275 Views
Thanks for your quick response.

I followed your advice, downloaded TBB3.0 update2 and used arch=intel64. However I'm still getting the same error message.
Regards,
Ben
Alexey_K_Intel3
Employee
275 Views
I am sorry, my mistake -I forgot that the support for MinGW64 was not yet done in commercial-aligned updates. Could you please try the latest development release?
Vladimir_P_Intel2
275 Views
mingw64 support released...
Reply