oneTBB
oneTBB copied to clipboard
Builds under MinGW-w64 i686 fail with compiler error
I tried to build both oneTBB-2021.5.0 and the current snapshot (oneTBB-master) with i686 (i.e. 32-bit) versions of GCC under MinGW-w64. Compilers i686-posix-dwarf-gcc-12.1.0, i686-posix-dwarf-gcc-11.2.0, and i686-posix-dwarf-gcc-10.3.0 all failed with the same error:
C:\oneTBB-master\build>mingw32-make
[ 2%] Building CXX object src/tbb/CMakeFiles/tbb.dir/address_waiter.cpp.obj
[ 5%] Building CXX object src/tbb/CMakeFiles/tbb.dir/allocator.cpp.obj
[ 7%] Building CXX object src/tbb/CMakeFiles/tbb.dir/arena.cpp.obj
In file included from c:\mingw-w64\winlibs-i686-posix-dwarf-gcc-10.3.0-mingw-w64-9.0.0-r2\mingw32\lib\gcc\i686-w64-mingw32\10.3.0\include\immintrin.h:29,
from c:\mingw-w64\winlibs-i686-posix-dwarf-gcc-10.3.0-mingw-w64-9.0.0-r2\mingw32\lib\gcc\i686-w64-mingw32\10.3.0\include\x86intrin.h:32,
from c:\mingw-w64\winlibs-i686-posix-dwarf-gcc-10.3.0-mingw-w64-9.0.0-r2\mingw32\i686-w64-mingw32\include\intrin.h:69,
from c:\onetbb-master\include\oneapi\tbb\detail\_machine.h:29,
from c:\onetbb-master\include\oneapi\tbb\detail\_utils.h:26,
from C:\oneTBB-master\src\tbb\task_dispatcher.h:20,
from C:\oneTBB-master\src\tbb\arena.cpp:17:
c:\mingw-w64\winlibs-i686-posix-dwarf-gcc-10.3.0-mingw-w64-9.0.0-r2\mingw32\lib\gcc\i686-w64-mingw32\10.3.0\include\xmmintrin.h: In member function 'void tbb::detail::d1::cpu_ctl_env::get_env()':
c:\mingw-w64\winlibs-i686-posix-dwarf-gcc-10.3.0-mingw-w64-9.0.0-r2\mingw32\lib\gcc\i686-w64-mingw32\10.3.0\include\xmmintrin.h:821:1: error: inlining failed in call to 'always_inline' 'unsigned int _mm_getcsr()': target specific option mismatch
821 | _mm_getcsr (void)
| ^~~~~~~~~~
compilation terminated due to -Wfatal-errors.
mingw32-make[2]: *** [src\tbb\CMakeFiles\tbb.dir\build.make:106: src/tbb/CMakeFiles/tbb.dir/arena.cpp.obj] Error 1
mingw32-make[1]: *** [CMakeFiles\Makefile2:169: src/tbb/CMakeFiles/tbb.dir/all] Error 2
mingw32-make: *** [makefile:155: all] Error 2
Disabling TBB_STRICT did not change anything.
Notably, the x86_64 versions succeed in building when TBB_STRICT is disabled (oneTBB-2021.5.0 for GCC 10.3.0, and oneTBB-master for GCC 11.2.0 even when it is enabled). But I found no way to build 32-bit libraries under MinGW-w64.
I configured with CMake (cmake-gui) 3.24.0 and chose generator "MinGW Makefiles".
@xamidi, thank you for reporting the issue. Unfortunately, MinGW compiler is not currently the part of oneTBB support matrix. Some PRs from external customers were merged to the repo to fix some specific issues, but officially this compiler is not supported by the library. You can submit a PR to the oneTBB repo if you want this issue to be fixed in oneTBB product.
Ok, thanks for the clarification. I just would like to point out that there are now MinGW-w64 i686 binaries of the most recent oneTBB release (currently 2021.5.0) as MSYS2 packages at packages.msys2.org/package/mingw-w64-i686-tbb. [x86_64 version]
According to strings - *.dll | grep GCC, they were built by GCC: (Rev1, Built by MSYS2 project) 12.2.0.
I tested them with the previously mentioned GCC versions and it works. So my need is fulfilled.
Though, I found no information on how they successfully built these binaries. I don't know if that closes the issue. Feel free to do so if you think it does.
Seems like issue is resolved but wasn't closed. Closing it. Feel free to reopen if any questions are left.