HIP-Examples
HIP-Examples copied to clipboard
missing '#include <cmath>'
Hi folks
I've got a ubuntu 20.04.3 machine with rocm-5.1.1 installed. I've got an MI25 card, and I'm attempting to build the example code in this repository. The test_all.sh script runs, though on most of the compilations, I get something like this
joe@hermes:~/build/HIP-Examples/cuda-stream$ make
/opt/rocm/hip/bin/hipcc -std=c++11 -O3 -o stream stream.cpp
In file included from <built-in>:1:
/opt/rocm-5.1.1/llvm/lib/clang/14.0.0/include/__clang_hip_runtime_wrapper.h:50:10: fatal error: 'cmath' file not found
#include <cmath>
^~~~~~~
1 error generated when compiling for gfx900.
make: *** [Makefile:11: stream] Error 1
I'm seeing this on other systems as well with the same repo. I can move it past that error if I change the compilation to this
joe@hermes:~/build/HIP-Examples/cuda-stream$ /opt/rocm-5.1.1/hip/bin/hipcc -std=c++11 -O3 -D__HIPCC_RTC__ -o stream stream.cpp
stream.cpp:25:10: fatal error: 'string' file not found
#include <string>
^~~~~~~~
1 error generated when compiling for gfx900.
Is there a missing define in the test script/environment? hipconfig --check reports all good.
Same with rocm 6.0.2
user@debian:~/HIP-Examples/cuda-stream$ make
/opt/rocm/bin/hipcc -std=c++11 -O3 -o stream stream.cpp
In file included from <built-in>:1:
In file included from /opt/rocm-6.0.2/lib/llvm/lib/clang/17.0.0/include/__clang_hip_runtime_wrapper.h:50:
/opt/rocm-6.0.2/lib/llvm/lib/clang/17.0.0/include/cuda_wrappers/cmath:27:15: fatal error: 'cmath' file not found
#include_next <cmath>
^~~~~~~
1 error generated when compiling for gfx1030.
make: *** [Makefile:9: stream] Error 1
user@debian:~/HIP-Examples/cuda-stream$