Search code examples
macosemacsclangspacemacsemacs-lsp

How to install clangd on Mac?


I am trying to use clangd with Spacemacs according to the c-cpp page. I have tried downloading the macOS binary for LLVM and I have followed this and this, but when I run which clangd, it says it cannot be found. I have also run brew install llvm, but that also doesn't show that clangd is in my path. I do have a binary under /usr/local/Cellar/llvm/9.0.0_1/bin, but my LSP doesn't do anything when I restart Emacs and open a C++ source file. I have /usr/local/bin in my path.


Solution

  • I added /usr/local/opt/llvm/bin/ to my PATH and that worked. Thanks to Mikael Springer. I wonder why it wasn't working with the other location (and why I have multiple copies of llvm binaries).