AdaptiveCpp: clang 9 incompatible with ROCm 3.9 directory layout for bitcode libraries

I am building 46bc9bde22056900f18b725776c6f6c660355e9a on Ubuntu 20.02 Hades Canyon NUC.

I installed ROCm using Apt and it works fine.

I installed LLVM and hipSYCL into /opt/hipSYCL using the scripts:

bash ./install/scripts/install-llvm.sh 
bash ./install/scripts/install-hipsycl.sh 

This is how it fails:

Scanning dependencies of target hipSYCL_rocm
[ 34%] Building CXX object src/sycl/CMakeFiles/hipSYCL_rocm.dir/application.cpp.o
clang-9: error: no such file or directory: 'hip.amdgcn.bc'
clang-9: error: no such file or directory: 'opencl.amdgcn.bc'
clang-9: error: no such file or directory: 'ocml.amdgcn.bc'
clang-9: error: no such file or directory: 'ockl.amdgcn.bc'
clang-9: error: no such file or directory: 'oclc_finite_only_off.amdgcn.bc'
clang-9: error: no such file or directory: 'oclc_daz_opt_off.amdgcn.bc'
clang-9: error: no such file or directory: 'oclc_correctly_rounded_sqrt_on.amdgcn.bc'
clang-9: error: no such file or directory: 'oclc_unsafe_math_off.amdgcn.bc'
clang-9: error: no such file or directory: 'oclc_isa_version_900.amdgcn.bc'
clang-9: error: no such file or directory: 'oclc_wavefrontsize64_on.amdgcn.bc'
make[2]: *** [src/sycl/CMakeFiles/hipSYCL_rocm.dir/build.make:63: src/sycl/CMakeFiles/hipSYCL_rocm.dir/application.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:192: src/sycl/CMakeFiles/hipSYCL_rocm.dir/all] Error 2
make: *** [Makefile:130: all] Error 2

These files are present:

$ locate hip.amdgcn.bc
/home/jrhammon/git/llvm-vanilla/clang/test/Driver/Inputs/hip_dev_lib/hip.amdgcn.bc

About this issue

  • Original URL
  • State: open
  • Created 4 years ago
  • Comments: 28 (9 by maintainers)

Most upvoted comments

I’ve had a look at the apt ROCm 3.9 package; it seems they have changed the naming scheme - these files no longer have amdgcn in their names and are now located in amdgcn/bitcode/ instead of lib/ as before. A simple workaround might be to symlink them inside lib with amdgcn.bc suffix.

@illuhad got it, thanks!) at least i know now that it’s working nicely under the hood =)

The easiest way might be to just install ROCm 3.8 in the meantime which should work out of the box. AMD also provides binary Ubuntu packages for 3.8: http://repo.radeon.com/rocm/apt/3.8/