ROCm / ROCm-OpenCL-Runtime

ROCm OpenOpenCL Runtime
168 stars 55 forks source link

Fails to compile with GCC 13 #152

Open xen0n opened 2 years ago

xen0n commented 2 years ago

According to the GCC 13 porting note apparently some #include <cstdint>'s should be added. This is going to be necessary when GCC 13 gets released so better get prepared early.

OS: Gentoo Linux amd64

$ gcc --version
gcc (Gentoo 13.0.0_pre20220918 p1) 13.0.0 20220918 (experimental)
Copyright (C) 2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Error looks like this:

/usr/bin/x86_64-pc-linux-gnu-g++ -Dcltrace_EXPORTS -I/tmp/portage/dev-libs/rocm-opencl-runtime-5.1.3/work/ROCm-OpenCL-Runtime-rocm-5.1.3 -I/tmp/portage/dev-libs/rocm-opencl-runtime-5.1.3/work/ROCm-OpenCL-Runtime-rocm-5.1.3/khronos/headers/opencl2.2 -I/tmp/portage/dev-libs/rocm-opencl-runtime-5.1.3/work/ROCclr-rocm-5.1.3/include  -march=native -mtune=znver2 -O3 -fgraphite-identity -floop-nest-optimize -fdevirtualize-at-ltrans -fipa-pta -fno-semantic-interposition -flto=128 -fuse-linker-plugin -pipe -ggdb -Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu -Wl,-z,pack-relative-relocs -fPIC -MD -MT tools/cltrace/CMakeFiles/cltrace.dir/cltrace.cpp.o -MF tools/cltrace/CMakeFiles/cltrace.dir/cltrace.cpp.o.d -o tools/cltrace/CMakeFiles/cltrace.dir/cltrace.cpp.o -c /tmp/portage/dev-libs/rocm-opencl-runtime-5.1.3/work/ROCm-OpenCL-Runtime-rocm-5.1.3/tools/cltrace/cltrace.cpp
In file included from /tmp/portage/dev-libs/rocm-opencl-runtime-5.1.3/work/ROCm-OpenCL-Runtime-rocm-5.1.3/khronos/headers/opencl2.2/CL/cl.h:32,
                 from /tmp/portage/dev-libs/rocm-opencl-runtime-5.1.3/work/ROCm-OpenCL-Runtime-rocm-5.1.3/khronos/headers/opencl2.2/CL/opencl.h:38,
                 from /tmp/portage/dev-libs/rocm-opencl-runtime-5.1.3/work/ROCm-OpenCL-Runtime-rocm-5.1.3/tools/cltrace/cltrace.cpp:5:
/tmp/portage/dev-libs/rocm-opencl-runtime-5.1.3/work/ROCm-OpenCL-Runtime-rocm-5.1.3/khronos/headers/opencl2.2/CL/cl_version.h:34:104: note: '#pragma message: cl_version.h: CL_TARGET_OPENCL_VERSION is not defined. Defaulting to 220 (OpenCL 2.2)'
   34 | #pragma message("cl_version.h: CL_TARGET_OPENCL_VERSION is not defined. Defaulting to 220 (OpenCL 2.2)")
      |                                                                                                        ^
In file included from /tmp/portage/dev-libs/rocm-opencl-runtime-5.1.3/work/ROCclr-rocm-5.1.3/include/vdi_agent_amd.h:25,
                 from /tmp/portage/dev-libs/rocm-opencl-runtime-5.1.3/work/ROCm-OpenCL-Runtime-rocm-5.1.3/tools/cltrace/cltrace.cpp:6:
/tmp/portage/dev-libs/rocm-opencl-runtime-5.1.3/work/ROCm-OpenCL-Runtime-rocm-5.1.3/amdocl/cl_icd_amd.h:718:33: warning: 'clGetKernelSubGroupInfoKHR_fn' is deprecated [-Wdeprecated-declarations]
  718 |   clGetKernelSubGroupInfoKHR_fn GetKernelSubGroupInfoKHR;
      |                                 ^~~~~~~~~~~~~~~~~~~~~~~~
/tmp/portage/dev-libs/rocm-opencl-runtime-5.1.3/work/ROCm-OpenCL-Runtime-rocm-5.1.3/amdocl/cl_icd_amd.h:552:29: note: declared here
  552 | typedef cl_int(CL_API_CALL* clGetKernelSubGroupInfoKHR_fn)(
      |                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/portage/dev-libs/rocm-opencl-runtime-5.1.3/work/ROCm-OpenCL-Runtime-rocm-5.1.3/amdocl/cl_icd_amd.h:726:33: warning: 'clGetKernelSubGroupInfoKHR_fn' is deprecated [-Wdeprecated-declarations]
  726 |   clGetKernelSubGroupInfoKHR_fn GetKernelSubGroupInfo;
      |                                 ^~~~~~~~~~~~~~~~~~~~~
/tmp/portage/dev-libs/rocm-opencl-runtime-5.1.3/work/ROCm-OpenCL-Runtime-rocm-5.1.3/amdocl/cl_icd_amd.h:552:29: note: declared here
  552 | typedef cl_int(CL_API_CALL* clGetKernelSubGroupInfoKHR_fn)(
      |                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/portage/dev-libs/rocm-opencl-runtime-5.1.3/work/ROCm-OpenCL-Runtime-rocm-5.1.3/tools/cltrace/cltrace.cpp: In function 'int32_t vdiAgent_OnLoad(vdi_agent*)':
/tmp/portage/dev-libs/rocm-opencl-runtime-5.1.3/work/ROCm-OpenCL-Runtime-rocm-5.1.3/tools/cltrace/cltrace.cpp:4383:24: error: 'int32_t' in namespace 'std' does not name a type
 4383 |             const std::int32_t pid = getpid();
      |                        ^~~~~~~
/tmp/portage/dev-libs/rocm-opencl-runtime-5.1.3/work/ROCm-OpenCL-Runtime-rocm-5.1.3/tools/cltrace/cltrace.cpp:4385:61: error: 'pid' was not declared in this scope
 4385 |             clTraceLogStr.replace(pidPos, 5, std::to_string(pid));
      |                                                             ^~~