1

I'm having trouble installing the clang_complete plugin for vim on Ubuntu. I built vim from source to enable python support, and I used vim --version to confirm that it has the following features enabled:

+python/dyn
+python3/dyn

I have my ~/.vim/vimrc setup as follows (nothing omitted):

syntax on
let g:clang_library_path='/usr/local/lib'

Here is the exact error output on vim startup when I try to edit a .cpp file:

Error detected while processing function
<SNR>6_ClangCompleteInit..<SNR>6_initClangCompletePython:

line    2:
clang_complete: No python support available.

line    3: Cannot use
clang library

line    4: Compile vim with python support to use
libclang

Can anyone with clang_complete experience help me out? Thanks!

djwbrown
  • 1,091
  • 1
  • 11
  • 15
  • note that clang_completer realizes only `libclang.[dll/so/dylib]`, so anything like `libclang3.4.so | libclang1.so` is invalid. You may have to create a symbolic link to overcome this issue. A remark ... u don't have to mention standard include paths. – DOOM Apr 20 '14 at 02:57
  • I just removed my clang-3.4 dpkg and installed clang-3.5 from source. That made `libclang.so` available in /usr/local/lib. I changed my vimrc to reflect that and removed the standard include path per your suggestions. Thanks! However, this did not solve the issue. – djwbrown Apr 20 '14 at 06:36
  • Its a bit difficult to be precise with your problem. (the debug messages is not very clear--its because of the plugin not u!!!). I would suggest u to clear all configurations of `clang_complete` and start adding one config at a time. Hopefully u can find something very specific and could be easy to solve. I personally faced the same prob. in the start. I used the [wiki](https://vtluug.org/wiki/Clang_Complete) link its very brief but helpful. Also this is my [clang-config](http://pastelink.me/dl/a2cb0a). Hope this helps u.. – DOOM Apr 20 '14 at 07:27
  • 1
    It says "No python support available", is it? I mean, you compiled vim from source, but are you sure that the version you're using is the one you compiled? First, try `:echo has('python')` in vim or just `vim --version` on command-line. If you don't see `+python` there, try to search for vim in `/usr/local/bin`, it's the default installation path. – xaizek Apr 20 '14 at 18:08
  • Thanks for the `:echo has('python')` hint. `vim --version` lies! (vim can't find the dynamic library at runtime, but the --version text is set at compile time). `:help python-dynamic` seems to indicate that this is a MS-Windows only feature. I will recompile vim without dynamic loading. – djwbrown Apr 21 '14 at 05:59

1 Answers1

1

OK, found a solution!

Pull down a fresh vim, or run sudo make uninstall and sudo make distclean in the vim and vim/src directory. Once you're ready at the root directory of the source:

cd src
sudo ./configure --enable-pythoninterp=yes --enable-python3interp=yes --with-python-config-dir=/usr/lib/python2.7/config-x86_64-linux-gnu --with-python3-config-dir=/usr/lib/python3.4/config-x86_64-linux-gnu
sudo make install

You may need to adjust the version numbers and path to your config-dir, but this finally worked for me in Ubuntu 14.04. For some strange reason vim --version still shows +python/dyn and +python3/dyn. If you look at the vim docs this appears to be a Windows only feature, but the true test is running :echo has('python') at the vim command line. You should get a 1 for true. Otherwise your build is still lacking python.

Make sure your ~/.vimrc or ~/.vim/vimrc is set up like I have above. Then use vim to open a .cpp file. Good luck!

djwbrown
  • 1,091
  • 1
  • 11
  • 15