Skip to content

Couldn`t find the 'libspirv' #19339

Open
Open

Description

@ziyang22

Describe the bug

when I use the self-build-compiler to compile the sycl code , it brought the error :

clang++: error: cannot find 'remangled-l64-signed_char.libspirv-amdgcn-amd-amdhsa.bc'; provide path to libspirv library via '-fsycl-libspirv-path', or pass '-fno-sycl-libspirv' to build without linking with libspirv


The detail for the self-build-compiler

My toolkit is not in the default installation directory.
The record of commands are as follows:

cd path_to_buildbot CC=gcc CXX=g++ python configure.py --cuda -DCUDA_Toolkit_ROOT= /home/spack/spack/opt/spack/linux-debian12-sapphirerapids/gcc-12.2.0/cuda-12.1.1-bym4wirbkm4ipizrw5xt6wtghdbm2 jvi/bin CC=gcc CXX=g++ python compile.py

**The detail for the compile **

/home/zhwh/sycl_workspace/llvm-sycl/build/bin/clang++ \ -std=c++17 -O3 -fsycl \ -fsycl-targets=amdgcn-amd-amdhsa \ --rocm-path=/opt/rocm \ -Xsycl-target-backend --offload-arch=gfx1030 \ code.cpp -o kernel \ -L/home/zhwh/sycl_workspace/llvm-sycl/build/lib -lur_loader

When I run the commands , the error pop up.

clang++: error: cannot find 'remangled-l64-signed_char.libspirv-amdgcn-amd-amdhsa.bc'; provide path to libspirv library via '-fsycl-libspirv-path', or pass '-fno-sycl-libspirv' to build without linking with libspirv

To reproduce

  1. Include code snippet as short as possible
  2. Specify the command which should be used to compile the program
  3. Specify the command which should be used to launch the program
  4. Indicate what is wrong and what was expected

Environment

  • OS: [e.g Windows/Linux]
  • Target device and vendor: [e.g. AMD GPU]
  • DPC++ version: [e.g. commit hash or output of clang++ --version]
  • Dependencies version: [e.g. the output of rocm-smi and sycl-ls --verbose]

Additional context

No response

Activity

  1. added
    bug
    hip
    on Jul 8, 2025
  2. npmiller commented on Jul 9, 2025

    @npmiller
    Contributor

    It looks like you haven't built the toolchain for AMD, you need to add --hip to configure.py. Without this it likely just hasn't built remangled-l64-signed_char.libspirv-amdgcn-amd-amdhsa.bc even if the AMDGPU LLVM backend was enabled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bughip

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions