Skip to content

Getting Error while compiling OneAPI sample codes #3246

@vibhad1509

Description

@vibhad1509

Describe the bug
/tmp/vector-add-usm-fb120e.o: In function VectorAdd(cl::sycl::queue&, int const*, int const*, int*, unsigned long)': vector-add-usm.cpp:(.text+0x75): undefined reference to cl::sycl::queue::submit_impl(std::__1::function<void (cl::sycl::handler&)>, cl::sycl::detail::code_location const&)'
/tmp/vector-add-usm-fb120e.o: In function main': vector-add-usm.cpp:(.text+0x320): undefined reference to cl::sycl::queue::queue(cl::sycl::device const&, std::__1::function<void (cl::sycl::exception_list)> const&, cl::sycl::property_list const&)'
clang-13: error: linker command failed with exit code 1 (use -v to see invocation)

To Reproduce
Please describe the steps to reproduce the behavior:

I get this error while compiling any of the oneapi sample codes. This is the command I ran:

/root/llvm-sycl/bin/bin/clang -O2 -std=c++17 -stdlib=libc++ -L/root/llvm-sycl/bin/lib/ -lpi_cuda -L/usr/local/lib/ -I /root/llvm-sycl/bin/include/sycl/ -lc++ -lc++abi -lm -lstdc++ -lsycl -o vector-add-usm src/vector-add-usm.cpp

Environment (please complete the following information):

  • OS: RHEL7
  • Target device and vendor: NVIDIA GPU
  • DPC++ version: clang 13
  • Dependencies version:

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    StalebugSomething isn't workingcompilerCompiler related issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions