You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[CUDA][HIP] improve error message for missing cmath (#122155)
One common error seen in CUDA/HIP compilation is:
fatal error: 'cmath' file not found
which is due to inproper installation of standard C++ libraries.
Since it happens with #include_next, users may feel confusing which
cmath is not found and how to fix it.
Add an error directive to help users resolve this issue.
Copy file name to clipboardExpand all lines: clang/lib/Headers/cuda_wrappers/cmath
+4Lines changed: 4 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -24,7 +24,11 @@
24
24
#ifndef __CLANG_CUDA_WRAPPERS_CMATH
25
25
#define __CLANG_CUDA_WRAPPERS_CMATH
26
26
27
+
#if __has_include_next(<cmath>)
27
28
#include_next <cmath>
29
+
#else
30
+
#error "Could not find standard C++ header 'cmath'. Add -v to your compilation command to check the include paths being searched. You may need to install the appropriate standard C++ library package corresponding to the search path."
0 commit comments