YouCompleteMe unavailable: YCM support libs too old, PLEASE RECOMPILE

1,641 views
Skip to first unread message

Wei Xu

unread,
Mar 24, 2014, 4:35:41 AM3/24/14
to ycm-...@googlegroups.com
Hi Experts,

I build the ycm_core on Solaris with gcc 4.5 and Vim 7.4 sucessfully. But it fails to load with below message.
Is there a possible workaround for this?

Thanks.
Joshua

Error detected while processing function youcompleteme#Enable:
line   13:
Traceback (most recent call last):
Press ENTER or type command to continue
Error detected while processing function youcompleteme#Enable:
line   13:
  File "<string>", line 1, in <module>
Press ENTER or type command to continue
Error detected while processing function youcompleteme#Enable:
line   13:
  File "/root/.vim/bundle/YouCompleteMe/autoload/../python/ycm/base.py", line 24, in <module>
Press ENTER or type command to continue
Error detected while processing function youcompleteme#Enable:
line   13:
    import ycm_client_support
Press ENTER or type command to continue
Error detected while processing function youcompleteme#Enable:
line   13:
ImportError: No module named ycm_client_support
Press ENTER or type command to continue
Error detected while processing function youcompleteme#Enable:
line   14:
Traceback (most recent call last):
Press ENTER or type command to continue
Error detected while processing function youcompleteme#Enable:
line   14:
  File "<string>", line 1, in <module>
Press ENTER or type command to continue
Error detected while processing function youcompleteme#Enable:
line   14:
NameError: name 'base' is not defined
Press ENTER or type command to continue
Error detected while processing function youcompleteme#Enable:
line   17:
Traceback (most recent call last):
Press ENTER or type command to continue
Error detected while processing function youcompleteme#Enable:
line   17:NameError: name 'base' is not defined
Press ENTER or type command to continue
Error detected while processing function youcompleteme#Enable:
line   19:
Traceback (most recent call last):
Press ENTER or type command to continue
Error detected while processing function youcompleteme#Enable:
line   19:
  File "<string>", line 1, in <module>
Press ENTER or type command to continue
Error detected while processing function youcompleteme#Enable:
line   19:
NameError: name 'base' is not defined
Press ENTER or type command to continue
Error detected while processing function youcompleteme#Enable:
line   19:
E858: Eval did not return a valid python object
Press ENTER or type command to continue
YouCompleteMe unavailable: YCM support libs too old, PLEASE RECOMPILE
Press ENTER or type command to continue

  File "<string>", line 1, in <module>
Press ENTER or type command to continue


Will S

unread,
May 15, 2014, 1:02:58 PM5/15/14
to ycm-...@googlegroups.com
Well, it's not encouraging that Joshua's message has gotten no reply for two months, but I am experiencing the same behavior on RHEL6.4 and would really like to figure out what the issue is. I see all of the messages Joshua posted when first starting Vim after installing YouCompleteMe with Vundle and then following the build instructions in the readme. The messages appear sequentially when first starting Vim each time you hit enter and after all of the messages shown Vim starts without YouCompleteMe.

I'll just say at the outset that I have installed YouCompleteMe properly in OS X (unfortunately, I have to use RHEL at work).

Here is what I tried to compile YCM:

* Download Python 2.7.6 source, compile, and install locally with stow (in ~/root; I also have added ~/root/bin to PATH and ~/root/lib to LD_LIBRARY_PATH):
wget http://python.org/ftp/python/2.7.6/Python-2.7.6.tar.xz
tar xf
Python-2.7.6.tar.xz
cd
Python-2.7.6
./configure --prefix=$HOME/root --enable-shared
make PREFIX
=$HOME/root
make install prefix
=$HOME/root/stow/python2
* Download Vim 7.4 source, compile, and install locally with stow linked against the local Python:
wget ftp://ftp.vim.org/pub/vim/unix/vim-7.4.tar.bz2
tar xf vim
*
cd vim
*
./configure --enable-pythoninterp --with-python-config-dir=$HOME/root/lib/python2.7/config --prefix=$HOME/root --with-features=huge --enable-rubyinterp
make
make install prefix
=$HOME/root/stow/vim74
cd $HOME
/root/stow
stow vim74


* Downloaded the latest version of CMake (cmake-2.8.12.2.tar.gz) from http://www.cmake.org/cmake/resources/software.html to ~/src/cmake, unzipped it, and ran:
./bootstrap
make
(I tried to install CMake locally with stow but I couldn't work out what paths to adjust for it to find its Modules directory).
* Downloaded the latest version of LLVM (3.4.1) for Fedora (Clang for x86_64 Fedora 20) to ~/src/llvm and unzipped
* Download YouCompleteMe with Vundle by adding Plugin 'Valloric/YouCompleteMe' to .vimrc and running :PluginInstall in Vim
* From a temporary directory, I ran
~/src/cmake/cmake-2.8.12.2/bin/cmake -G "Unix Makefiles" -fPIC -DPATH_TO_LLVM_ROOT=~/src/llvm/clang+llvm-3.4.1-x86_64-fedora20 -DPYTHON_LIBRARY=~/root/lib/libpython2.7.so -DPYTHON_INCLUDE_DIRS=~/root/include/python2.7/ . ~/.vim/bundle/YouCompleteMe/cpp
which ran with no problem.
* Then I ran
make ycm_support_libs
* Finally, I started Vim and saw the messages quoted by Joshua.

I tried a few variations on the CMake command as well like using "-DUSE_SYSTEM_LIBCLANG=ON" instead of pointing to the LLVM directory I downloaded (system clang is 3.4) and not using the "-fPIC" flag.

Any idea what could be going wrong here? From the error messages it's hard to tell what needs to be adjusted.

Here are some links that seem relevant. I haven't tried using Vincent Liu's modified version of YCM because I'd like to understand what the issue is and how to address it so that I can keep using the most recent version of YouCompleteMe.

https://github.com/Valloric/YouCompleteMe/issues/131
http://blog.belgoat.com/?p=30
http://blog.vinceliu.com/2013/02/getting-youcompleteme-to-work-in-rhel-6.html
https://bitbucket.org/vincentliu/rhel6-vim-youcompleteme/commits/558f8bd955525330f89d59e236ebeec4f4c0799e

David Watson

unread,
May 15, 2014, 2:22:26 PM5/15/14
to ycm-...@googlegroups.com
Hi,
I don't know how to fix the first problem, but I believe that your problem may be caused by a location change of the compiled portion of ycm. Instead of
~/.vim/bundle/YouCompleteMe/cpp
try
~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp

I hope this helps.

Best,
David

Will S

unread,
May 16, 2014, 1:10:14 PM5/16/14
to ycm-...@googlegroups.com
Thanks for the responses David and Val! (Not sure why, but I don't see Val's response in the online forum, so I copied it in as a quote below my text).

I corrected the typo that David pointed out and still got the same results (not sure how it worked at all with that typo, but maybe I did something weird with copy and paste).

The Python API value in YouCompleteMe/python/ycm/base.py is 9. This is my first time trying to install YouCompleteMe on this system, so I would not think that an older version would be present. I searched the Python path returned by sys.path in Vim and only found the one copy of ycm_client_support.so in YouCompleteMe/third_party/ycmd. However, trying to check the API version of ycm_client_support.so with Python revealed one problem. When I tried to import ycm_client_support, I got the following error:

>>> import ycm_client_support
Traceback (most recent call last):

 
File "<stdin>", line 1, in <module>
ImportError: ./ycm_client_support.so: undefined symbol: PyUnicodeUCS4_FromEncodedObject

I recompiled Python with the "--enable-unicode=ucs4" option and now Vim does not show any errors when it starts. Also, I can now import ycm_client_support and ycm_client_support.YcmCoreVersion() returns 9.

However, when I recompiled with
~/src/cmake/cmake-2.8.12.2/bin/cmake -G "Unix Makefiles" -DPATH_TO_LLVM_ROOT=~/src/llvm/clang+llvm-3.4.1-x86_64-fedora20 -DPYTHON_LIBRARY=~/root/lib/libpython2.7.so -DPYTHON_INCLUDE_DIRS=~/root/include/python2.7/ . ~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/

I got the following error: "The ycmd server SHUT DOWN (restart with :YcmRestartServer). Stderr (last 30 lines):" Turning on the debug info as described at https://github.com/Valloric/YouCompleteMe/blob/master/CONTRIBUTING.md#writing-good-issue-reports, I found that I was getting the error "/lib64/libc.so.6: version `GLIBC_2.14' not found". I guess that's what I get for using a binary precompiled for Fedora rather than RHEL. Since RHEL's libclang is 3.4, I switched the cmake command to
~/src/cmake/cmake-2.8.12.2/bin/cmake -G "Unix Makefiles" -DUSE_SYSTEM_LIBCLANG=ON -DPYTHON_LIBRARY=~/root/lib/libpython2.7.so -DPYTHON_INCLUDE_DIRS=~/root/include/python2.7/ . ~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/
and now YouCompleteMe seems to be working. I guess I worry about trying to compile the most recent version of libclang.so later if it seems like it's necessary for some reason.

Thanks again for your help guys! Happy to get this working and hopefully these notes are useful for others.


On Thu, May 15, 2014 at 2:00 PM, Val wrote:
Are you sure the error message you are getting is "YouCompleteMe unavailable: YCM support libs too old, PLEASE RECOMPILE"? If that's the case, then you have a mismatch between the version of YCM libs you've compiled and the YCM python code. The C++ code has a hard-coded constant for the API version; same with the Python code. When the Python YCM client imports the YCM compiled libraries, it compares the two constants. If they match, everything is good. If they don't, you get the above error.

The check is there to ensure that if you update YCM with something like Vundle (thus updating the Python and C++ code which hasn't been recompiled and the C++ API has changed), you'll get an error message because the YCM C++ libs are too old now.

You can verify what the values for both are by hand: go into a directory that has ycm_client_support.so (that should be YouCompleteMe/third_party/ycmd with latest YCM) and do this:

$ python
>> import ycm_client_support
>> ycm_client_support.YcmCoreVersion()

With latest YCM, that should print out 9.

The Python API value is in YouCompleteMe/python/ycm/base.py (near the bottom of the file). That should be 9 as well. If both of these files match when you look at them manually but you still get the error message, that means you have another ycm_client_support.so somewhere on your PYTHONPATH that is being loaded instead of the one you intended. You can see the PYTHONPATH the YCM client uses with the following commands in Vim:

:py import sys
:py print sys.path


Val Markovic

unread,
May 15, 2014, 2:00:30 PM5/15/14
to Will S, ycm-...@googlegroups.com
Are you sure the error message you are getting is "YouCompleteMe unavailable: YCM support libs too old, PLEASE RECOMPILE"? If that's the case, then you have a mismatch between the version of YCM libs you've compiled and the YCM python code. The C++ code has a hard-coded constant for the API version; same with the Python code. When the Python YCM client imports the YCM compiled libraries, it compares the two constants. If they match, everything is good. If they don't, you get the above error.

The check is there to ensure that if you update YCM with something like Vundle (thus updating the Python and C++ code which hasn't been recompiled and the C++ API has changed), you'll get an error message because the YCM C++ libs are too old now.

You can verify what the values for both are by hand: go into a directory that has ycm_client_support.so (that should be YouCompleteMe/third_party/ycmd with latest YCM) and do this:

$ python
>> import ycm_client_support
>> ycm_client_support.YcmCoreVersion()

With latest YCM, that should print out 9.

The Python API value is in YouCompleteMe/python/ycm/base.py (near the bottom of the file). That should be 9 as well. If both of these files match when you look at them manually but you still get the error message, that means you have another ycm_client_support.so somewhere on your PYTHONPATH that is being loaded instead of the one you intended. You can see the PYTHONPATH the YCM client uses with the following commands in Vim:

:py import sys
:py print sys.path

--
You received this message because you are subscribed to the Google Groups "ycm-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ycm-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ycm-users/d19bea21-cf4b-42e2-ac7c-16cde212def8%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages