Intel® oneAPI DPC++/C++ Compiler
Talk to fellow users of Intel® oneAPI DPC++/C++ Compiler and companion tools like Intel® oneAPI DPC++ Library, Intel® DPC++ Compatibility Tool, and Intel® Distribution for GDB*

DPCPP clangd language server problem

yiwenxue
Beginner
1,048 Views

Hello brothers, I am new to the SYCL world, and I am suffering a problem with the dev environment.

 

I am a C++ developer on Linux platform. Usually, I use Vscode as the text editor, Cmake as the building system, and clangd as the C++ language server (not MS C++ intelli). I managed all my projects in that manner, and it worked very nicely. 

 

Recently I got my new A770 card, and installed oneapi-basekit on my Ubuntu desktop (I can use level 0 without any problem). After setting the env variables, I can compile simple projects smoothly. 

 

But, clangd failed to analyze the headers, you can find the simple example in the attachments.

I found that `CL/__spirv/spirv_ops.hpp` is 'include/sycl/CL/__spirv/spirv_ops.hpp'. This error disappeared after adding '${SYCL_INCLUDE_DIR}/sycl' to target include directories, but another problem comes (the third pic).

 

So I am wondering how to manage SYCL projects using cmake in the right way. Could someone please give me a hand? Thanks in advance.

 
Labels (1)
0 Kudos
1 Reply
jmyl
Beginner
751 Views

I'm neovim user and using clangd as my language server for c++, but I'm experiencing same problem as you.

I saw a article which says "the clangd built on intel/llvm can parse sycl headers, the others cannot", so I found clangd on /opt/intel/oneapi/compiler/latest/bin/compiler/ and used it but it even stops working while parsing sycl headers!

Can you try to use this version clangd, which is shipped with intel-basetoolkit?

0 Kudos
Reply