vim-lsp-settings
vim-lsp-settings copied to clipboard
clangd install failed on debian 10 (./clangd: error while loading shared libraries: libz3.so.4.8: cannot open shared object file: No such file or directory)
I test install libz3-dev
, but it can't work also.
:LspInstallServer
mkdir: cannot create directory ‘../servers/clangd’: No such file or directory
2 Downloading clangd and LLVM...
3 % Total % Received % Xferd Average Speed Time Time Time Current
4 Dload Upload Total Spent Left Speed
5 100 383M 100 383M 0 0 1222k 0 0:05:21 0:05:21 --:--:-- 1330k
6 Extracting archive...
7 ./clangd: error while loading shared libraries: libz3.so.4.8: cannot open shared object file: No such file or directory
This seems to be known issue. You may want to install libz3.
https://github.com/mattn/vim-lsp-settings/pull/41
debian 10 only have libz3-4 libz3-cil libz3-dev
, I install both of them, still no work.
Thanks your useful informations.
@thomasfaingnaert can you handle this issue?
You can try something like:
sudo apt install -y libz3-4
sudo update-alternatives --install /lib/x86_64-linux-gnu/libz3.so.4.8 libz3.4.8 /lib/x86_64-linux-gnu/libz3.so.4 100
But I'm guessing that will shift the problem to another dependency.
cd /path/to/vim-lsp-settings/servers/clangd
ldd ./clangd
will display which dependencies you're still missing.
@mattn It's unfortunate that LLVM doesn't provide releases for generic Linux which include all required libs. Might be better to only enable clangd if the OS is Ubuntu/Mac OS?
What if just have a echo that says make sure your distro has the libz3 library installed in order to extract clang.
Another approach is something g like how unzip.exe is used. Ship a snap version of unzip that supports libz3.
libz3 seems different package. zlib1g-dev is right?
You can try something like:
sudo apt install -y libz3-4 sudo update-alternatives --install /lib/x86_64-linux-gnu/libz3.so.4.8 libz3.4.8 /lib/x86_64-linux-gnu/libz3.so.4 100
But I'm guessing that will shift the problem to another dependency.
cd /path/to/vim-lsp-settings/servers/clangd ldd ./clangd
will display which dependencies you're still missing.
@mattn It's unfortunate that LLVM doesn't provide releases for generic Linux which include all required libs. Might be better to only enable clangd if the OS is Ubuntu/Mac OS?
it also need GLIBC_2.29.
sudo update-alternatives --install /lib/x86_64-linux-gnu/libz3.so.4.8 libz3.4.8 /lib/x86_64-linux-gnu/libz3.so.4 100
ldd ./clangd
./clangd: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.29' not found (required by ./clangd)
I am using homebrew's clang now, it version also is clang9
How about to use clang+llvm-9.0.0-x86_64-pc-linux-gnu.tar.xz instead of tarball on ubuntu?
you need to install z3
on arch to pass this error.
I got same error on Debian 10. After I run
$ sudo apt install libz3-4 libz3-cil libz3-dev
$ sudo apt install -y libz3-4
$ sudo update-alternatives --install /lib/x86_64-linux-gnu/libz3.so.4.8 libz3.4.8 /lib/x86_64-linux-gnu/libz3.so.4 100
$ cd /path/to/clangd
$ ldd ./clangd
# No errors
Then :LspInstallServer
install without any problem
For arch linux I had to use the following command.
sudo pacman -Sy libz3
How about to use https://github.com/clangd/clangd? It don't have any dependencies.
sudo update-alternatives --install /lib/x86_64-linux-gnu/libz3.so.4.8 libz3.4.8 /lib/x86_64-linux-gnu/libz3.so.4 100
This worked for me. I ran :LspInstallServer
after running the code above, and the server was installed correctly. I knew that libz3.so.4
already existed on my system because I found it using sudo find / -xdev -name 'libz3*'
.
I'm using Debian 11 now.But it works for me.
/usr/lib/x86_64-linux-gnu$sudo ln -s libz3.so.4 libz3.so.4.8
Therefore,I think now filename cause this problem. Before,You should run $whereis libz3.so.4
and You should know where is libz3.so.4 in your computer.
I'm beginner in linux and I'm Japanese so I maybe wrote wrong.