Once again a "How to install clangd on Mac" question.
What I have done so far is brew install llvm, so older answers (and the clangd website) say that clangd should already be installed.
But in the current version this seems to not be the case.
clangd is not in my path and none of the folders I looked into have that binary.
I found these answers (none of them work):
Put
/usr/local/opt/llvm/bin/in your path. I assume installing llvm should have created that directory, but it does not exist. (Link to stackoverflow question)Find clangd in other folders (run
find /usr/local/ -name 'clangd'). This has no results (Link to superuser question)Use the
--with-toolchainflag for homebrew while installing llvm.Error: invalid option: --with-toolchain
Use the
--with-clangflag for homebrew while installing llvmError: invalid option: --with-clang
So my questions are:
- As of August 2021, how do I install clangd on a macbook?
- Do I really have to manually build everything from sources?
Further information:
This is a M1 Macbook
I found a clangd executable at
/opt//homebrew/Cellar/llvm/12.0.1/bin/clangdRunning
brew info llvmresults in a message containingIf you need to have llvm first in your PATH, run:
echo 'export PATH="/opt/homebrew/opt/llvm/bin:$PATH"' >> ~/.zshrcIn that folder I found a clangd executable too, so I guess I should add this to my path instead of
/usr/local/opt/llvm/bin?