-
-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cuda 项目生成的compile_commands貌似无法正常提示 #249
Comments
compile_commands 为啥会在 build 下。。vscode-xmake 插件默认生成的 compile_commands 应该在 .vscode 目录下。。 另外,光生成 compile_commands.json 不够,还得配置 cpptools/clangd ,去绑定 compile_commands.json 才能生效,确定绑关联对了路径? |
clangd插件支持cuda吗?cpptools是可以正常提示cuda的,clangd我也没成功过,后面放弃了 |
支持的,需要
除此之外文件第一行会依然会报一些错,比如 Unknown argument: '-rdc=true',但不影响写代码。 |
我也是遇见相同的问题,使用compile_commands.json生成的编译clangd就无法正确识别,但是去配置发现fallbackFlags语法提示补全等都是ok的。 {
"clangd.fallbackFlags": [
"-std=c++17",
"--cuda-path=${env:CUDA_PATH}",
"-I${env:CUDA_PATH}/include"
],
} 感觉是是对应的compile_commands.json ,clangd识别除了些许问题?我生成的compile_commands.json [
{
"directory": "f:\\Cuda",
"arguments": [
"C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v12.6\\bin\\nvcc.exe",
"-c",
"-g",
"-Xcompiler",
"-FS -Zi -Fdbuild\\windows\\x64\\debug\\compile.cuda.pdb",
"-O0",
"-I\"C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v12.6\\include\"",
"-m64",
"-rdc=true",
"-gencode",
"arch=compute_86,code=sm_86",
"-G",
"-o",
"build\\.objs\\cuda\\windows\\x64\\debug\\src\\main.cu.obj",
"src\\main.cu",
"-imsvc",
"C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.22621.0\\cppwinrt",
"-imsvc",
"C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.22621.0\\shared",
"-imsvc",
"C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.22621.0\\ucrt",
"-imsvc",
"C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.22621.0\\um",
"-imsvc",
"C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.22621.0\\winrt",
"-imsvc",
"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.42.34433\\include"
],
"file": "src\\main.cu"
}
] 因为我是最近cmake转xmake我发现构建相同的项目,cmake构建cuda(同样工具链)是8s左右,xmake是30s左右不知道是为什么。感觉是额外增加的参数问题? |
Xmake Version
v2.8.6+master.8545a9301
Operating System Version and Architecture
windows 11 23h2 22631.3007
Describe Bug
直接使用生成的compile_commands文件会报如下错误:
生成的compile_commands文件:
怀疑是
-I
参数和后面的目录应该分开写,但是分开写后会报如下错误:Expected Behavior
vscode不报错误
Project Configuration
Additional Information and Error Logs
none
The text was updated successfully, but these errors were encountered: