Open ks-zealot opened 6 years ago
Seems strange. I can't reproduce the problem with your example on my machine. Can you please attach the yavide
log? Location of log file is /tmp/<yavide_instance>_server.log
where <yavide_instance>
is YAVIDE
, YAVIDE1
, YAVIDE2
, etc. Depends how many yavide
instances you are running at the time ...
Looks like yavide missed lib.
[INFO] [yavide_server.py:124] yavide_server_run(): Starting a Yavide server ...
[INFO] [yavide_service.py:17] __init__(): Yavide instance: YAVIDE
[INFO] [yavide_service.py:18] __init__(): Actions: {0: <bound method SourceCodeModel.__startup_request of <services.source_code_model_service.SourceCodeModel instance at 0x7fe13b632f80>>, 1: <bound method SourceCodeModel.__shutdown_request of <services.source_code_model_service.SourceCodeModel instance at 0x7fe13b632f80>>, 2: <bound method SourceCodeModel.__request of <services.source_code_model_service.SourceCodeModel instance at 0x7fe13b632f80>>}
[CRITICAL] [yavide_server.py:99] handle_exception(): Uncaught exception
Traceback (most recent call last):
File "/opt/yavide/core/server/yavide_server.py", line 128, in yavide_server_run
YavideServer(msg_queue, yavide_instance).listen()
File "/opt/yavide/core/server/yavide_server.py", line 16, in __init__
0x0 : SourceCodeModel(self.msg_queue, self.yavide_instance),
File "/opt/yavide/core/services/source_code_model_service.py", line 14, in __init__
self.parser = ClangParser()
File "/opt/yavide/core/services/parser/clang_parser.py", line 71, in __init__
self.index = clang.cindex.Index.create()
File "/usr/local/lib/python2.7/dist-packages/clang/cindex.py", line 2427, in create
return Index(conf.lib.clang_createIndex(excludeDecls, 0))
File "/usr/local/lib/python2.7/dist-packages/clang/cindex.py", line 141, in __get__
value = self.wrapped(instance)
File "/usr/local/lib/python2.7/dist-packages/clang/cindex.py", line 3839, in lib
lib = self.get_cindex_library()
File "/usr/local/lib/python2.7/dist-packages/clang/cindex.py", line 3870, in get_cindex_library
raise LibclangError(msg)
LibclangError: libclang.so: невозможно открыть разделяемый объектный файл: Нет такого файла или каталога. To provide a path to libclang use Config.set_library_path() or Config.set_library_file().
My libclang.so located here
zealot@zealot:~/Projects/mtum$ ls -lh /usr/lib/x86_64-linux-gnu/libclang-3.8.so lrwxrwxrwx 1 root root 17 июн 2 16:11 /usr/lib/x86_64-linux-gnu/libclang-3.8.so -> libclang-3.8.so.1
Yes, it seems that is the case. If you look at the attached installation log, you will see that the libclang
path selected by yavide
is /usr/lib/llvm-3.8/lib/libclang.so
. yavide
tries to make its best guess during the installation where the libclang
library is installed on your system and to do that it traverses the /usr/lib*
directories. In your case, libclang.so
is first found in /usr/lib/llvm-3.8/
directory and therefore selected.
To override that setting you should simply edit your local g:libclang_location
to contain the correct path. That variable is set in .user_settings.vimrc file.
This should fix your problem.
Nope, error still here. I edit config file, reopen yavide project and get same error. So, I check libclang from llvm and yes, its here.
zealot@zealot:~/Projects/mtum$ ls -lh /usr/lib/llvm-3.8/lib/libclang.so
lrwxrwxrwx 1 root root 40 июн 2 16:11 /usr/lib/llvm-3.8/lib/libclang.so -> ../../x86_64-linux-gnu/libclang-3.8.so.1
Alright, now I realized there is something from installation log I can actually understand :)
LibclangError: libclang.so: невозможно открыть разделяемый объектный файл: Нет такого файла или каталога. To provide a path to libclang use Config.set_library_path() or Config.set_library_file().
Can you run the following on your machine and c/p the output here:
ldconfig -p | grep libclang.so
No output lol. When I set less specified filter
zealot@zealot:~/Projects/mtum$ sudo /sbin/ldconfig -p | grep libclang
libclang-3.8.so.1 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libclang-3.8.so.1
libclang-3.8.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libclang-3.8.so
Well, then that seems to be the problem as far as I can tell. libclang
Python bindings cannot find the libclang.so
because it is not in the path of the configuration of your dynamic linker/loader (ld
).
Try to get this symbolic link into the correct path by i.e. reinstalling the libclang devel package (or some other step which is relevant to this problem for your distro) or create that symbolic link yourself. I would prefer to do in a right way, i.e. something on a track of the first option but if you want to a quick hack you can do the second one (which will break once you update the version of your libclang
).
Well, looks like symlinks is only way now. After creating symlink, I get the few different stacktrace
[CRITICAL] [yavide_server.py:99] handle_exception(): Uncaught exception
Traceback (most recent call last):
File "/opt/yavide/core/server/yavide_server.py", line 128, in yavide_server_run
YavideServer(msg_queue, yavide_instance).listen()
File "/opt/yavide/core/server/yavide_server.py", line 16, in __init__
0x0 : SourceCodeModel(self.msg_queue, self.yavide_instance),
File "/opt/yavide/core/services/source_code_model_service.py", line 14, in __init__
self.parser = ClangParser()
File "/opt/yavide/core/services/parser/clang_parser.py", line 71, in __init__
self.index = clang.cindex.Index.create()
File "/usr/local/lib/python2.7/dist-packages/clang/cindex.py", line 2427, in create
return Index(conf.lib.clang_createIndex(excludeDecls, 0))
File "/usr/local/lib/python2.7/dist-packages/clang/cindex.py", line 141, in __get__
value = self.wrapped(instance)
File "/usr/local/lib/python2.7/dist-packages/clang/cindex.py", line 3840, in lib
register_functions(lib, not Config.compatibility_check)
File "/usr/local/lib/python2.7/dist-packages/clang/cindex.py", line 3787, in register_functions
map(register, functionList)
File "/usr/local/lib/python2.7/dist-packages/clang/cindex.py", line 3785, in register
return register_function(lib, item, ignore_errors)
File "/usr/local/lib/python2.7/dist-packages/clang/cindex.py", line 3766, in register_function
raise LibclangError(msg)
LibclangError: /usr/lib/libclang.so: undefined symbol: clang_CXXConstructor_isConvertingConstructor. Please ensure that your python bindings are compatible with your libclang.so version.
This looks like your Python bindings for libclang
are not compatible with the version of libclang
which you created a symlink for. In order to get this correct, you really need to install this dependency via your system package manager. Remove this newly created symlink and try to google around a bit how to install libclang
dependencies for your system.
Libclang deps on debian installed by command
sudo apt-get install libclang-dev
But, this package doesnt contains file libclang.so
Could you provide information about libclang lib's version I needed for? For example from your desktop.
I am not sure why is that so that you are missing libclang.so
. That feels really strange. Version of libclang
should not really matter until it is installed correctly. This is a problem very specific to your distro so I would try to google around to see if someone else had similar issues. I.e. here
Maybe installing Python bindings for libclang will help?
Nope. Looks like its impossible make it work, sorry .(
That's unfortunate but there must be a way to do it. Sorry that I can't help you more than this, I haven't got a Debian system at my place.
Had the same issue. By manually downgrading python binding for clang to the version 3.8 fixed the problem:
sudo pip install https://pypi.python.org/packages/source/c/clang/clang-3.8.tar.gz
and creating symbolic link as well:
cd /usr/lib/x86_64-linux-gnu
sudo ln -s libclang-3.8.so.1 libclang.so
Yes, I could approve it, everything look fine
Just installed fresh instance of yavide. Clang autoformat doesnt working. For example, here my project scheme.
.clang-format file was created with command
clang-format -style=llvm -dump-config > .clang-format
And in yavide my test.cpp looks like thisand doesnt change after saving. When I manually run command, the file is properly formatted
zealot@zealot:~/test1/src$ clang-format -i test.cpp
How could I fix the problem? My installation log in attach. log.txt