Intel® oneAPI Data Parallel C++
Support for Intel® oneAPI DPC++ Compiler, Intel® oneAPI DPC++ Library, Intel® DPC++ Compatibility Tool, and GDB*

_Quad type compile issue with Intel C++ 2021

handsomeforest
Beginner
1,481 Views

I have a small visual studio 2019 project that uses _Quad type of Intel C++ 2021 to compile.  The 64-bit target compiles successfully.  The 32-bit target fails to compile.  I got the following errors:

Severity Code Description Project File Line Suppression State
Error undefined symbol: ___addq double128Proj C:\Temp2\dev\cgiDouble128Sol_new\double128Proj\lld-link: 1
Error undefined symbol: ___ceilq double128Proj C:\Temp2\dev\cgiDouble128Sol_new\double128Proj\lld-link: 1
Error undefined symbol: ___divq double128Proj C:\Temp2\dev\cgiDouble128Sol_new\double128Proj\lld-link: 1
Error undefined symbol: ___dtoq double128Proj C:\Temp2\dev\cgiDouble128Sol_new\double128Proj\lld-link: 1 etc...

 

My visual studio 2019 version is 16.8.5.  The Intel C++ 2021 was downloaded and installed through oneAPI about a week ago.  Any ideas what might be the problem?

 

Thanks,

 

Junlin Xu

 

0 Kudos
13 Replies
handsomeforest
Beginner
1,456 Views

please see an example of the problem above

DitiD_Intel
Moderator
1,422 Views

Hi,

 

Thanks for posting in Intel Communities.

 

We have compiled the code provided by you on VS 2019 and it is working fine for 64 bit target.

We were also able to reproduce the issue that you are facing for 32 bit target.

 

We have checked for the same on Intel oneAPI command prompt and it is giving us the correct output for both 32 bit and 64 bit target. 

Please use the command mentioned below to compile your code.

 

icx dpcppsample.cpp -Qoption,cpp,--extended_float_types

 

Please refer to the attachments below for more details.

 

We suggest that you give it a try on Intel oneAPI command prompt once.

 

As for the issue with VS, we are investigating it at our end and we will get back to you soon.

 

Also, could you please let us know the oneAPI version you are using?

 

Thanks & Regards,

Ditipriya.

 

handsomeforest
Beginner
1,404 Views

Ditipriya:

 

Thank you for your reply.  My oneAPI version is Version: 2021.4 downloaded and installed on 2021/11/30.  I try the command line.  Here is the result:

C:\temp\dev\ConsoleApplication1>"C:\Program Files (x86)\Intel\oneAPI\compiler\2021.4.0\windows\bin\icx" ConsoleApplication1.cpp -Qoption,cpp,--extended_float_types
Intel(R) oneAPI DPC++/C++ Compiler for applications running on Intel(R) 64, Version 2021.4.0 Build 20210924
Copyright (C) 1985-2021 Intel Corporation. All rights reserved.

LINK : fatal error LNK1104: cannot open file 'libircmt.lib'
clang-cl: error: linker command failed with exit code 1104 (use -v to see invocation)

 

Also, I found another potential bug in the compiler

m = (int)(double)__log10q(n); // there is a bug in Intel 2021 compiler. need to do cast here
int mm = __log10q(n);
if (mm != m) {
printf("!!!!!!!!!!!!!!!!!!!!!!!!!!!!n = %g, m = %d, mm = %d\n", (double)n, m, mm);
}

for _Quad n = 23.1416, i got the following print out.

!!!!!!!!!!!!!!!!!!!!!!!!!!!!n = 23.1416, m = 1, mm = 2

Is the cast supposed to be required to use __log10q() function?  It seems to be me a fundamental bug.

 

Thanks,

 

Junlin Xu

 

handsomeforest
Beginner
1,355 Views

Any update on these two issues?

 

Junlin Xu

DitiD_Intel
Moderator
1,319 Views

Hi,


We are working on this issue and we will get back to you soon. 


Thanks and Regards,

Ditipriya.


Jie_L_Intel
Employee
1,280 Views

This IDE bug will be fixed in the coming release.


Jie_L_Intel
Employee
1,277 Views
Jie_L_Intel
Employee
1,277 Views

one workaround is to modify the library path manually as shown in above picture.

handsomeforest
Beginner
1,259 Views

Hello Jie_L_Intel:

 

Thanks for the workaround.  Now I can compile the code in Win32 mode.  

 

I do see the same bug in __log10q() math function.  The following code produces wrong results in both 32-bit and 64-bit.


_Quad nn = 23.1416Q;
int mm1 = (int)(double)__log10q(nn); // there is a bug in Intel 2021 compiler. need to do cast here
int mm2 = __log10q(nn);
if (mm1 != mm2) {
printf("!!!!!!!!!!!!!!!!!!!!!!!!!!!!nn = %g, mm1 = %d, mm2 = %d\n", (double)nn, mm1, mm2);
}

 

In 32-bit release, it prints: !!!!!!!!!!!!!!!!!!!!!!!!!!!!nn = 23.1416, mm1 = 1, mm2 = 2

In 32-bit debug, it prints: !!!!!!!!!!!!!!!!!!!!!!!!!!!!nn = 23.1416, mm1 = 4266, mm2 = 4267

IN 64-bit debug and release, it prints: !!!!!!!!!!!!!!!!!!!!!!!!!!!!nn = 23.1416, mm1 = 1, mm2 = 2

 

Can you confirm this is a bug?  I do not see this behavior in Intel C++ 16.

 

Thanks,

 

Junlin Xu

 

 

Jie_L_Intel
Employee
1,229 Views

i could not reproduce your errors, see below picture for both ia32 and x64 build.

log10.PNG

 

Here is my code, adding the (double) cast or not got the same result -

#include <stdio.h>

int main(){
_Quad n = 23.1416Q;
int m = (int)__log10q(n); // there is a bug in Intel 2021 compiler. need to do cast here
int mm = __log10q(n);
if (mm != m) {
printf("!!!!!!!!!!!!!!!!!!!!!!!!!!!!n = %g, m = %d, mm = %d\n", (double)n, m, mm);
}
return m;
}

 

handsomeforest
Beginner
1,072 Views

I downloaded and installed the latest intel oneAPI (w_BaseKit_p_2022.1.0.116_offline) .  Attached here is a sample project I made.  I was able to compile the project with Visual Studio 2022 using Intel C++ compiler 2022.  However, I got the following wrong errors:

debug x64: m = 2, mm = 2

release x64: m = 2, mm = 2

debug x86: m = -4859, mm = -4859

release x86: m = -4939, mm = -4939

Can you try to reproduce the problem on your end?  Thanks

 

Junlin Xu

Jie_L_Intel
Employee
1,066 Views

hi Junlin,

    i suggest you to close this ticket and open a new topic for your recent test case.  India TSE team will route your question to appropriate team if needed.

handsomeforest
Beginner
1,022 Views
Reply