[Openmp-dev] Openmp Win32 build failed for KF_TRACE

Joseph Shen via Openmp-dev openmp-dev at lists.llvm.org
Tue Jan 26 05:36:15 PST 2021


Hi, Openmp devs:

When I compiled Openmp with clang-cl(self-build-from-v11.01), three errors
were triggered by the compiler.
These errors all happened in KF_TRACE, for *printf the flag value with type
std::atomic<unsigned int> *
*but using unnecessary `flag->get() then get pointer value`; *and for the
second error, *printf used format*
*%d for unsigned value*.

Patch is given in the attached file, and the compile error message is
listed below.

Thanks for your hard work.

Joseph Shen.

--------------------------------------------------------------------------------------------------------------------------------

[1/2] Building CXX object
projects\openmp\runtime\src\CMakeFiles\omp.dir\z_Windows_NT_util.cpp.obj
FAILED:
projects/openmp/runtime/src/CMakeFiles/omp.dir/z_Windows_NT_util.cpp.obj
T:\llvm_dist_s6\bin\clang-cl.exe  .... -c --
T:\llvm-project-11.0.1.src\openmp\runtime\src\z_Windows_NT_util.cpp

 ----  ERROR  1 ---

T:\llvm-project-11.0.1.src\openmp\runtime\src\z_Windows_NT_util.cpp(384,38):
error: call to deleted constructor of 'std::atomic<unsigned int>'
               th_gtid, flag->get(), *(flag->get())));
                                     ^~~~~~~~~~~~~~
T:\llvm-project-11.0.1.src\openmp\runtime\src/kmp_debug.h(103,24): note:
expanded from macro 'KF_TRACE'
    __kmp_debug_printf x;
   \
                       ^
T:\llvm-project-11.0.1.src\openmp\runtime\src\z_Windows_NT_util.cpp(446,3):
note: in instantiation of function template specialization
'__kmp_suspend_template<kmp_flag_32>' requested here
  __kmp_suspend_template(th_gtid, flag);
  ^
C:\Program Files (x86)\Microsoft Visual
Studio\2019\Community\VC\Tools\MSVC\14.28.29333\include\atomic(2165,5):
note: 'atomic' has been explicitly marked deleted here
    atomic(const atomic&) = delete;
    ^
   ----  ERROR  2 ---

T:\llvm-project-11.0.1.src\openmp\runtime\src\z_Windows_NT_util.cpp(244,41):
error: call to deleted constructor of 'std::atomic<unsigned int>'
                    flag->get(), old_f, *(flag->get())));
                                        ^~~~~~~~~~~~~~
T:\llvm-project-11.0.1.src\openmp\runtime\src/kmp_debug.h(103,24): note:
expanded from macro 'KF_TRACE'
    __kmp_debug_printf x;
   \
                       ^
T:\llvm-project-11.0.1.src\openmp\runtime\src\z_Windows_NT_util.cpp(414,9):
note: in instantiation of function template specialization
'__kmp_win32_cond_wait<kmp_flag_32>' requested here
        __kmp_win32_cond_wait(&th->th.th_suspend_cv, &th->th.th_suspend_mx,
th,
        ^
T:\llvm-project-11.0.1.src\openmp\runtime\src\z_Windows_NT_util.cpp(446,3):
note: in instantiation of function template specialization
'__kmp_suspend_template<kmp_flag_32>' requested here
  __kmp_suspend_template(th_gtid, flag);
  ^
C:\Program Files (x86)\Microsoft Visual
Studio\2019\Community\VC\Tools\MSVC\14.28.29333\include\atomic(2165,5):
note: 'atomic' has been explicitly marked deleted here
    atomic(const atomic&) = delete;
    ^
 ----  ERROR  3 ---

T:\llvm-project-11.0.1.src\openmp\runtime\src\z_Windows_NT_util.cpp(491,62):
error: call to deleted constructor of 'std::atomic<unsigned int>'
                   gtid, target_gtid, flag->get(), old_spin,
*(flag->get())));
                                                             ^~~~~~~~~~~~~~
T:\llvm-project-11.0.1.src\openmp\runtime\src/kmp_debug.h(103,24): note:
expanded from macro 'KF_TRACE'
    __kmp_debug_printf x;
   \
                       ^
C:\Program Files (x86)\Microsoft Visual
Studio\2019\Community\VC\Tools\MSVC\14.28.29333\include\atomic(2165,5):
note: 'atomic' has been explicitly marked deleted here
    atomic(const atomic&) = delete;
    ^

8 warnings and 3 errors generated.
ninja: build stopped: subcommand failed.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/openmp-dev/attachments/20210126/80256662/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-fix-openmp-windows-KT_TRACE-compile-error.patch
Type: application/octet-stream
Size: 1973 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-dev/attachments/20210126/80256662/attachment.obj>


More information about the Openmp-dev mailing list