Migrating to SYCL
One-stop forum for getting assistance migrating your existing code to SYCL
39 Discussions

c2s - fatal error: 'cmath' file not found

CABELO
Innovator
3,056 Views

When I went to run the c2s command on SUSE I got this error below:

$ c2s vectorAdd.cu  
NOTE: Could not auto-detect compilation database for file 'vectorAdd.cu' in '/dados/home/space_disk/Intel/exemplo' or any parent directory.
The directory "dpct_output" is used as "out-root"
Processing: /dados/home/space_disk/Intel/exemplo/vectorAdd.cu
In file included from <built-in>:1:
In file included from /opt/intel/oneapi/dpcpp-ct/2023.1.0/lib/clang/16/include/__clang_cuda_runtime_wrapper.h:42:
/opt/intel/oneapi/dpcpp-ct/2023.1.0/lib/clang/16/include/cuda_wrappers/cmath:27:15: fatal error: 'cmath' file not found
#include_next <cmath>
             ^~~~~~~
Processed 1 file(s) in -in-root folder "/dados/home/space_disk/Intel/exemplo"

See Diagnostics Reference to resolve warnings and complete the migration:
https://software.intel.com/content/www/us/en/develop/documentation/intel-dpcpp-compatibility-tool-user-guide/top/diagnostics-reference.html

0 Kudos
10 Replies
NoorjahanSk_Intel
Moderator
2,941 Views

Hi,

 

Thanks for posting in Intel Communities.

 

Could you please confirm whether the code you are trying (vecadd.cu)is the same as the sample code attached in the zip file?

 

We have the tried attached code with Intel DPC++ Compatibility Tool and it worked as expected.

Please refer to the below screenshot for more details:

NoorjahanSk_Intel_0-1683714906376.png

 

Please let us know if you have any issues with Intel DPCT.

Regarding c2s we suggest you to raise your issue in the below GitHub page.

https://github.com/oneapi-src/SYCLomatic/issues

 

Thanks & Regards

Noorjahan.

 

0 Kudos
CABELO
Innovator
2,910 Views

 

Hi Noorjahan.

 

I tested the example you sent above.(vecadd.cu) with c2s from github. I got this error below:

 

$ c2s vecAdd.cu  
NOTE: Could not auto-detect compilation database for file 'vecAdd.cu' in '/dados/home/space_disk/Intel/exemplo' or any parent directory.
The directory "dpct_output" is used as "out-root"
Processing: /dados/home/space_disk/Intel/exemplo/vecAdd.cu
In file included from <built-in>:1:
In file included from /dados/home/space_disk/Intel/c2s_install/lib/clang/17/include/__clang_cuda_runtime_wrapper.h:42:
/dados/home/space_disk/Intel/c2s_install/lib/clang/17/include/cuda_wrappers/cmath:27:15: fatal error: 'cmath' file not found
#include_next <cmath>
             ^~~~~~~
/dados/home/space_disk/Intel/exemplo/vecAdd.cu:49:5: warning: DPCT1049:0: The work-group size passed to the SYCL kernel may exceed the limit. To get the device limit, query info::device::max_work_group_size. Adju
st the work-group size if needed.
   vecAdd<<<gridSize, blockSize>>>(d_a, d_b, d_c, n);
   ^
Processed 1 file(s) in -in-root folder "/dados/home/space_disk/Intel/exemplo"


0 Kudos
NoorjahanSk_Intel
Moderator
2,845 Views

Hi,


This forum supports migrating Cuda to sycl using Intel DPC++ Compatibility Tool.


We request you to raise a issue on below Github page as you are unable to port simple program with c2s.

https://github.com/oneapi-src/SYCLomatic/issues


Could you please let us know if you have any issues related to Intel DPCT Tool? If not, can we go ahead and close this case?


Thanks & Regards,

Noorjahan.


0 Kudos
CABELO
Innovator
2,813 Views

Hi Noorjahan:

I tested it with dpct and the error was the same. See the evidence below:

 

$ dpct --in-root=. --cuda-include-path=/usr/local/cuda-11.8/include/ --enable-ctad --out-root=dpct_out vectorAdd.cu   
NOTE: Could not auto-detect compilation database for file 'vectorAdd.cu' in '/dados/home/space_disk/Intel/exemplo' or any parent directory.
Processing: /dados/home/space_disk/Intel/exemplo/vectorAdd.cu
In file included from <built-in>:1:
In file included from /opt/intel/oneapi/dpcpp-ct/2023.1.0/lib/clang/16/include/__clang_cuda_runtime_wrapper.h:42:
/opt/intel/oneapi/dpcpp-ct/2023.1.0/lib/clang/16/include/cuda_wrappers/cmath:27:15: fatal error: 'cmath' file not found
#include_next <cmath>
             ^~~~~~~
Processed 1 file(s) in -in-root folder "/dados/home/space_disk/Intel/exemplo"                                                                                                                                        

See Diagnostics Reference to resolve warnings and complete the migration:
https://software.intel.com/content/www/us/en/develop/documentation/intel-dpcpp-compatibility-tool-user-guide/top/diagnostics-reference.html


0 Kudos
NoorjahanSk_Intel
Moderator
2,736 Views

Hi,


Could you please provide the exact version of OS you are using to migrate your code?

Also please let us know the GCC version you are using.


Also please check whether you meet the system requirements of Intel DPC++ Compatibility Tool.

https://www.intel.com/content/www/us/en/developer/articles/system-requirements/intel-dpc-compatibility-tool-system-requirements.html


Thanks & Regards,

Noorjahan.


0 Kudos
CABELO
Innovator
2,564 Views

Hi Noorjahan

 

I was using SUSE Enterprise 15-SP3, when I upgraded to 15-SP4 everything worked. Thank you for your support and attention.

Everything is ok now.

 

 

0 Kudos
NoorjahanSk_Intel
Moderator
2,614 Views

Hi,


We haven't heard back from you. Could you please provide an update on your issue?


Thanks & Regards,

Noorjahan.


0 Kudos
CABELO
Innovator
2,548 Views

Hi Noorjahan

 

I was using SUSE Enterprise 15-SP3, when I upgraded to 15-SP4 everything worked. Thank you for your support and attention.

Everything is ok now.

0 Kudos
NoorjahanSk_Intel
Moderator
2,457 Views

Hi,


Glad to know that your issue is resolved. If you need any additional information, please post a new question as this thread will no longer be monitored by Intel.


Thanks & Regards,

Noorjahan.


0 Kudos
Rakshith_K_Intel
Employee
1,934 Views

I got this issue resolved on ubuntu 22.04 by running this :

sudo apt install libstdc++-12-dev

got this solution from:  https://stackoverflow.com/questions/22752000/clang-cmath-file-not-found

Reply