rocm-arch / rocm-arch

A collection of Arch Linux PKGBUILDS for the ROCm platform
359 stars 52 forks source link

[rocm-opencl-runtime] Missing rocclr headers #602

Closed marco44 closed 3 years ago

marco44 commented 3 years ago

First, I think elfio should be a dependency. I had to install it to compile.

Then, I'm still blocked trying to compile:

In file included from /opt/rocm/include/device/device.hpp:34,
                 from /opt/rocm/include/platform/context.hpp:25,
                 from /opt/rocm/include/platform/command.hpp:36,
                 from /opt/rocm/include/vdi_common.hpp:26,
                 from /tmp/trizen-marc/rocm-opencl-runtime/src/ROCm-OpenCL-Runtime-rocm-4.1.0/amdocl/cl_common.hpp:32,
                 from /tmp/trizen-marc/rocm-opencl-runtime/src/ROCm-OpenCL-Runtime-rocm-4.1.0/amdocl/cl_program.cpp:21:
/opt/rocm/include/device/devprogram.hpp:23:10: fatal error: aclTypes.h: No such file or directory
   23 | #include "aclTypes.h"
      |          ^~~~~~~~~~~~

This header is in rocclr, but got installed in /opt/rocm/include/compiler/lib/include/aclTypes.h, which isn't in the -isystem provided.

But even still, trying to add this path to the -isystem, I then got

In file included from /opt/rocm/include/elf/elf.hpp:31,
                 from /opt/rocm/include/device/device.hpp:32,
                 from /opt/rocm/include/platform/context.hpp:25,
                 from /opt/rocm/include/platform/command.hpp:36,
                 from /opt/rocm/include/vdi_common.hpp:26,
                 from /tmp/trizen-marc/rocm-opencl-runtime/src/ROCm-OpenCL-Runtime-rocm-4.1.0/amdocl/cl_common.hpp:32,
                 from /tmp/trizen-marc/rocm-opencl-runtime/src/ROCm-OpenCL-Runtime-rocm-4.1.0/amdocl/cl_memobj.cpp:21:
/opt/rocm/include/elf/elfio/elfio.hpp:200:5: error: ‘Elf_Word’ does not name a type; did you mean ‘Elf64_Word’?
  200 |     ELFIO_HEADER_ACCESS_GET( Elf_Word,      version            );

So I feel there is something more fundamental missing, but I can't find what...

tpkessler commented 3 years ago

Hi Marc, thanks for your bug report. I changed the rocclr install path to align it with the ubuntu packages but forgot to adjust the include paths in the build script for rocm-opencl-runtime. I've pushed a new version to the AUR (and this repo) that resolves that issue. Could you please try to build again?

Torsten

marco44 commented 3 years ago

Still not working. That's weird: the compilation command produced by make is :

/usr/bin/c++ -DATI_ARCH_X86 -DATI_BITS_64 -DATI_COMP_GCC -DATI_OS_LINUX -DCL_TARGET_OPENCL_VERSION=220 -DCL_USE_DEPRECATED_OPENCL_1_0_APIS -DCL_USE_DEPRECATED_OPENCL_1_1_APIS -DCL_USE_DEPRECATED_OPENCL_1_2_APIS -DCL_USE_DEPRECATED_OPENCL_2_0_APIS -DCOMGR_DYN_DLL -DLINUX -DLITTLEENDIAN_CPU -DOPENCL_EXPORTS -DOPENCL_MAJOR=2 -DOPENCL_MINOR=0 -DUNIX_OS -DUSE_COMGR_LIBRARY -DVEGA10_ONLY=false -DWITH_AQL -DWITH_HSA_DEVICE -DWITH_LIGHTNING_COMPILER -DWITH_ONLINE_COMPILER -DWITH_TARGET_AMDGCN -D__AMD64__ -D__x86_64__ -Damdocl64_EXPORTS -DqLittleEndian -I/tmp/trizen-marc/rocm-opencl-runtime/src/ROCm-OpenCL-Runtime-rocm-4.1.0/amdocl/.. -I/tmp/trizen-marc/rocm-opencl-runtime/src/ROCm-OpenCL-Runtime-rocm-4.1.0/amdocl/../khronos -I/tmp/trizen-marc/rocm-opencl-runtime/src/ROCm-OpenCL-Runtime-rocm-4.1.0/amdocl/../khronos/headers -I/tmp/trizen-marc/rocm-opencl-runtime/src/ROCm-OpenCL-Runtime-rocm-4.1.0/amdocl/../khronos/headers/opencl2.2 -isystem /opt/rocm/include -D_FORTIFY_SOURCE=2 -march=znver2 -O3 -pipe -fno-plt -isystem /opt/rocm/rocclr/include/include -isystem /opt/rocm/rocclr/include/compiler/lib -isystem /opt/rocm/rocclr/include/compiler/lib/include -isystem /opt/rocm/rocclr/include/elf -fPIC   -Wall -Wno-unused-variable -Wno-unused-function -pthread -std=c++11 -MD -MT amdocl/CMakeFiles/amdocl64.dir/cl_memobj.cpp.o -MF CMakeFiles/amdocl64.dir/cl_memobj.cpp.o.d -o CMakeFiles/amdocl64.dir/cl_memobj.cpp.o -c /tmp/trizen-marc/rocm-opencl-runtime/src/ROCm-OpenCL-Runtime-rocm-4.1.0/amdocl/cl_memobj.cpp

So it's like it's not inheriting from the PKGBUILD (I double-checked it, it's good):

    CFLAGS="$CFLAGS -isystem /opt/rocm/include/compiler/lib -isystem /opt/rocm/include/compiler/lib/include -isystem /opt/rocm/include/elf" \
    CXXFLAGS="$CXXFLAGS -isystem /opt/rocm/include/compiler/lib -isystem /opt/rocm/include/compiler/lib/include -isystem /opt/rocm/include/elf" \
marco44 commented 3 years ago

Forget it, I forgot to clean my build environment :)