Skip to content
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

Support --options-file for intelligence of included header #12553

Closed
Raphael-Hao opened this issue Aug 8, 2024 · 3 comments
Closed

Support --options-file for intelligence of included header #12553

Raphael-Hao opened this issue Aug 8, 2024 · 3 comments
Assignees
Labels
bug Feature: Configuration An issue related to configuring the extension or IntelliSense Feature: CUDA fixed Check the Milestone for the release in which the fix is or will be available. Language Service
Milestone

Comments

@Raphael-Hao
Copy link

Raphael-Hao commented Aug 8, 2024

Feature Request

CMake is storing the flags of include dirs for compiler like nvcc in a file ended with .rsp. You can see the related cmake configuration here. Then, the exported compile_commands.json will be something like this

{
    "directory": "/workspace/project/build",
    "command": "/usr/local/cuda/bin/nvcc -forward-unknown-to-host-compiler --options-file CMakeFiles/project.dir/includes_CUDA.rsp -gencode arch=compute_80,code=sm_80 -Xcudafe -O3 -DNDEBUG -std=c++17 -Xcompiler=-fPIC -D_GLIBCXX_USE_CXX11_ABI=0 -x cu -c /home/whcui/project/src/extension.cu -o CMakeFiles/extension.dir/src/extension.cu.o",
    "file": "/workspace/project/src/extension.cu",
    "output": "CMakeFiles/extension.dir/src/extension.cu.o"
  },

However, currently, the lsp cannot recognize this for intelligence of included header.

@sean-mcmanus sean-mcmanus self-assigned this Aug 8, 2024
@sean-mcmanus sean-mcmanus added bug Language Service Feature: Configuration An issue related to configuring the extension or IntelliSense labels Aug 8, 2024
@sean-mcmanus sean-mcmanus added this to the 1.22.0 milestone Aug 8, 2024
@sean-mcmanus sean-mcmanus removed their assignment Aug 15, 2024
@sean-mcmanus sean-mcmanus removed this from the 1.22.0 milestone Aug 15, 2024
@sean-mcmanus sean-mcmanus added this to the 1.22.0 milestone Aug 15, 2024
@sean-mcmanus sean-mcmanus moved this to Pull Request in cpptools Aug 15, 2024
@Colengms Colengms moved this from Pull Request to Done in cpptools Aug 16, 2024
@Colengms Colengms added the fixed Check the Milestone for the release in which the fix is or will be available. label Aug 16, 2024
@Colengms
Copy link
Contributor

Hi @Raphael-Hao . Thanks for reporting this. I can repro the issue and have made a fix, which should be available in our next release. (1.22.0)

Some background: To support CUDA IntelliSense, the C/C++ extension needs to 'query' the NVCC compiler to determine the gcc (or cl.exe) command line it will forward to. We then use that gcc/cl command line to configure IntelliSense. It looks like that first request to query NVCC was done using an incorrect working directory. So, any relative paths processed by NVCC (not just forward to GCC) wouldn't be properly located.

@sean-mcmanus
Copy link
Contributor

@Raphael-Hao
Copy link
Author

Thanks

@github-actions github-actions bot locked and limited conversation to collaborators Oct 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Feature: Configuration An issue related to configuring the extension or IntelliSense Feature: CUDA fixed Check the Milestone for the release in which the fix is or will be available. Language Service
Projects
Status: Done
Development

No branches or pull requests

3 participants