Intel® oneAPI DPC++/C++ Compiler
Talk to fellow users of Intel® oneAPI DPC++/C++ Compiler and companion tools like Intel® oneAPI DPC++ Library, Intel® DPC++ Compatibility Tool, and Intel® Distribution for GDB*

_DEBUG issues.

ChoonHo
Einsteiger
2.826Aufrufe
OS

Windows 10

IDE

Visual Studio 19

Compiler

Intel(R) oneAPI DPC++ compiler

Toolkit

oneAPI Base Toolkit version 2021.1-beta09

Problem

By default, the toolkit doesn't define _DEBUG macro in debug mode. However, upon defining it, the linker will fail due to missing debug CRT symbols.

I can bypass this by using /MDd or /MTd as a command line argument. However, this would lead to erroneous SYCL runtime probably due to ABI issues with mismatching CRTs.

I can force the linker to link against sycld.lib and everything would work just fine.

I believe this is a tooling bug in debug mode.

0 Kudos
1 Lösung
AbhishekD_Intel
Moderator
2.807Aufrufe

Hi,


Thanks for reaching out to us.

I tried the way you have described and yes you are right by default toolkit doesn't define _DEBUG micro.

And one thing I wanted you to suggest that when you define _DEBUG as 1 we have to set /LDd, /MDd, or /MTd compiler options. Otherwise, it will be undefined.

But when I tried enabling DEBUG feature I was able to compile the project but was failing at run time and when I give the sycld.lib path at the linking stage it was executing with correct results.


I can very much able to reproduce your issue and I also feel that it's a bug. So I am forwarding this issue to the concerned team.

Thank you for posting it to us.



Warm Regards,

Abhishek


Lösung in ursprünglichem Beitrag anzeigen

4 Antworten
AbhishekD_Intel
Moderator
2.808Aufrufe

Hi,


Thanks for reaching out to us.

I tried the way you have described and yes you are right by default toolkit doesn't define _DEBUG micro.

And one thing I wanted you to suggest that when you define _DEBUG as 1 we have to set /LDd, /MDd, or /MTd compiler options. Otherwise, it will be undefined.

But when I tried enabling DEBUG feature I was able to compile the project but was failing at run time and when I give the sycld.lib path at the linking stage it was executing with correct results.


I can very much able to reproduce your issue and I also feel that it's a bug. So I am forwarding this issue to the concerned team.

Thank you for posting it to us.



Warm Regards,

Abhishek


ChoonHo
Einsteiger
2.800Aufrufe
ChoonHo
Einsteiger
2.744Aufrufe

Update for beta10.

Properly links to sycld.lib when _DEBUG is defined.

However, I still have to specify to use a debug version of the runtime library /MDd or /MTd as a compiler argument.

 

Sravani_K_Intel
Moderator
2.718Aufrufe

Hi,


Yes, using /MDd should set everything you need, that's the expected behavior.


Antworten