Open Xaldew opened 2 years ago
After some further research, I'm pretty confident that this is this bug: clangd/clangd#971, so perhaps it would be a good idea to upgrade the internal clangd binary to 14.0.0?
If anyone else is reading this, a quick workaround is the upgrade the local version, e.g.:
(use-package lsp-mode
:ensure t
:commands lsp
:init
(add-hook 'c-mode-hook #'lsp)
(add-hook 'c++-mode-hook #'lsp)
(setq lsp-clangd-version "14.0.0"))
And then calling M-x lsp-install-server
"clangd"
Using clangd-14 wasn't sufficient to workaround the missing headers for me. I also had to install libomp-14. The package name is libomp-14-dev if using LLVM Debian/Ubuntu nightlies.
Thank you for the bug report
lsp-mode
related packages.M-x lsp-start-plain
Bug description
Hello,
For some reason, I'm not able to get
lsp-mode
(usingclangd
) to find the OpenMP headers (omp.h
), despite the server being properly setup and thecompile_commands.json
containing the appropriate flags (-fopenmp
).Truthfully though, I'm not sure if this is a
lsp-mode
problem or aclangd
problem, so any assistance in narrowing this down would be appreciated!Steps to reproduce
The simplest way to reproduce it would be to create a small C/C++ project with CMake:
CMakeLists.txt:
main.cpp:
Then build the project, e.g.:
Expected behavior
OpenMP headers (omp.h) should be found.
Which Language Server did you use?
lsp-clangd
OS
Linux
Error callstack
Anything else?
N/A