oneTBB icon indicating copy to clipboard operation
oneTBB copied to clipboard

Build failed with GCC >=9.2

Open fdiedler opened this issue 2 years ago • 2 comments

Hi,

I was unabled to build the last version with GCC 9.2 or higher. There is a problem in the mutex source file...

`$ mingw32-make.exe compiler=gcc arch=intel64

[ 0%] Building CXX object src/tbb/CMakeFiles/tbb.dir/address_waiter.cpp.obj In file included from C:\build_oneTBB\oneapi-tbb-2021.5.0\src\tbb\concurrent_monitor_mutex.h:22, from C:\build_oneTBB\oneapi-tbb-2021.5.0\src\tbb\concurrent_monitor.h:23, from C:\build_oneTBB\oneapi-tbb-2021.5.0\src\tbb\address_waiter.cpp:19: C:\build_oneTBB\oneapi-tbb-2021.5.0\src\tbb\semaphore.h: In member function 'void tbb::detail::r1::semaphore::init_semaphore(size_t)': C:\build_oneTBB\oneapi-tbb-2021.5.0\src\tbb\semaphore.h:145:15: error: 'CreateSemaphoreEx' was not declared in this scope; did you mean 'CreateSemaphoreA'? 145 | sem = CreateSemaphoreEx( NULL, LONG(start_cnt_), max_semaphore_cnt, NULL, 0, SEMAPHORE_ALL_ACCESS ); | ^~~~~~~~~~~~~~~~~ | CreateSemaphoreA compilation terminated due to -Wfatal-errors. mingw32-make[2]: *** [src\tbb\CMakeFiles\tbb.dir\build.make:76: src/tbb/CMakeFiles/tbb.dir/address_waiter.cpp.obj] Error 1 mingw32-make[1]: *** [CMakeFiles\Makefile2:458: src/tbb/CMakeFiles/tbb.dir/all] Error 2 mingw32-make: *** [Makefile:165: all] Error 2 `

Do you have an idea ?

Thanks,

fdiedler avatar May 26 '22 17:05 fdiedler

Recent builds with GCC 9.4 on Linux do not show this issue (see for example the test results in here). Building with the gcc compiler on Windows is outside of our support matrix, so its not something we regularly test. Can you post the cmake options you used to create your makefiles so we can see if we can reproduce this issue? Thanks.

vossmjp avatar Jun 02 '22 16:06 vossmjp

@vossmjp Just use the default settings of Cmake and try to build it on Windows 10 with GCC 9.2

The error with function "CreateSemaphoreA" is specific on Windows, so you should not have this issue on Linux. Perhaps, a define is missing for windows target ? I don't know.

If you want to have the exact compiler I used, download the version 17.1 of Nuwen https://nuwen.net/mingw.html

And you should have : $ ./gcc.exe -v Using built-in specs. COLLECT_GCC=C:\nuwen-17.1\bin\gcc.exe COLLECT_LTO_WRAPPER=c:/nuwen-17.1/bin/../libexec/gcc/x86_64-w64-mingw32/9.2.0/lto-wrapper.exe Target: x86_64-w64-mingw32 Configured with: ../src/configure --enable-languages=c,c++ --build=x86_64-w64-mingw32 --host=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --disable-multilib --prefix=/c/temp/gcc/dest --with-sysroot=/c/temp/gcc/dest --disable-libstdcxx-pch --disable-libstdcxx-verbose --disable-nls --disable-shared --disable-win32-registry --with-tune=haswell --enable-threads=posix --enable-libgomp Thread model: posix gcc version 9.2.0 (GCC)

For now, I was not able to use oneTBB... :(

Maybe; you can provide binaries for Windows and GCC (there is only binaries for Visual studio for Windows)

Thanks,

fdiedler avatar Jun 03 '22 10:06 fdiedler

Hi @fdiedler, Is this issue still relevant no you? If yes could you please refer to issue#863.

pavelkumbrasev avatar Nov 10 '22 08:11 pavelkumbrasev

@pavelkumbrasev Hi, I don't know I switch to another GCC version and it works fine. I think you can close the issue, people need to use GCC >= 10 with the last version of oneTBB.

fdiedler avatar Nov 12 '22 10:11 fdiedler

Closing this issue as it was solved by switching to newer version.

pavelkumbrasev avatar Nov 14 '22 08:11 pavelkumbrasev