0
votes

I'm trying to install YouCompleteMe for Vim 7.4 with included patches 1-712 on Ubuntu 15.10.

I have compiled YouCompleteMe by hand since I encountered an error looking like this:

/usr/bin/ld: /usr/local/lib/libpython2.7.a(abstract.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC

As stated in the FAQ Section, adding -DPYTHON_LIBRARY=/usr/lib/libpython2.7.so will solve it. Therefore, compliled it with this instead:

cmake -G "Unix Makefiles" -DPYTHON_LIBRARY=/usr/lib/libpython2.7.so . ~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp

then:

cmake --build . --target ycm_support_libs --config Release

I did not encountered any error while compiling this time but when I open Vim I, I see this instead:

   import ycm_client_support
                            ImportError: /home/austin/.vim/bundle/YouCompleteMe/third_party/ycmd/ycm_client_support.so: undefined symbol: PyUnicodeUCS2_AsWideChar















Error detected while processing function youcompleteme#Enable..<SNR>64_SetUpPython:
line   33:
Traceback (most recent call last):
Press ENTER or type command to continue
Error detected while processing function youcompleteme#Enable..<SNR>64_SetUpPython:
line   33:
  File "<string>", line 29, in <module>
Press ENTER or type command to continue
Error detected while processing function youcompleteme#Enable..<SNR>64_SetUpPython:
line   33:
  File "/home/austin/.vim/bundle/YouCompleteMe/autoload/../python/ycm/youcompleteme.py", line 32, in <module>
Press ENTER or type command to continue
Error detected while processing function youcompleteme#Enable..<SNR>64_SetUpPython:
line   33:
    from ycm.omni_completer import OmniCompleter
Press ENTER or type command to continue
Error detected while processing function youcompleteme#Enable..<SNR>64_SetUpPython:
line   33:
  File "/home/austin/.vim/bundle/YouCompleteMe/autoload/../python/ycm/omni_completer.py", line 22, in <module>
Press ENTER or type command to continue
Error detected while processing function youcompleteme#Enable..<SNR>64_SetUpPython:
line   33:
    from ycmd.completers.completer import Completer
Press ENTER or type command to continue
Error detected while processing function youcompleteme#Enable..<SNR>64_SetUpPyth
on:
line   33:
  File "/home/austin/.vim/bundle/YouCompleteMe/autoload/../third_party/ycmd/ycmd
/completers/completer.py", line 25, in <module>
Press ENTER or type command to continue
Error detected while processing function youcompleteme#Enable..<SNR>64_SetUpPyth
on:
line   33:
    from ycm_client_support import FilterAndSortCandidates
Error detected while processing function youcompleteme#Enable..<SNR>64_SetUpPyth
on:
line   33:
ImportError: /home/austin/.vim/bundle/YouCompleteMe/third_party/ycmd/ycm_client_
support.so: undefined symbol: PyUnicodeUCS2_AsWideChar

Does anyone know how to fix this?

1

1 Answers

0
votes

This looks like an issue described in the Python FAQ => https://docs.python.org/2/faq/extending.html#when-importing-module-x-why-do-i-get-undefined-symbol-pyunicodeucs2

"The only way to solve this problem is to use extension modules compiled with a Python binary built using the same size for Unicode characters."

It's possible for you to test the size of unicode character of your python with that:

import sys
if sys.maxunicode > 65535:
  print 'UCS4 build'
else:
  print 'UCS2 build'