Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

-DUSE_SYSTEM_LIBCLANG=ON fails #11

Closed
wting opened this issue Feb 5, 2013 · 7 comments
Closed

-DUSE_SYSTEM_LIBCLANG=ON fails #11

wting opened this issue Feb 5, 2013 · 7 comments

Comments

@wting
Copy link

wting commented Feb 5, 2013

I'm on Arch with LLVM v3.2.5. Using system clang fails, but using path_to_llvm_root to point at system clang works.

╭─ting@noa ~/build ‹python-2.7.3› ‹ruby-1.9.3› 
╰─➤  cmake -G "Unix Makefiles" -DUSE_SYSTEM_LIBCLANG=ON . ~/.vim/bundle/YouCompleteMe/cpp                                                       2013.02.05 00:05:50 CST 
-- The C compiler identification is GNU 4.7.2
-- The CXX compiler identification is GNU 4.7.2
-- Check for working C compiler: /usr/lib/ccache/bin/cc
-- Check for working C compiler: /usr/lib/ccache/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/lib/ccache/bin/c++
-- Check for working CXX compiler: /usr/lib/ccache/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
Your C++ compiler supports C++11, compiling in that mode.
-- Found PythonLibs: /usr/lib64/libpython2.7.so (found suitable version "2.7.3", minimum required is "2") 
Using libclang to provide semantic completion for C/C++/ObjC
Using external libclang: TEMP-NOTFOUND
-- Found PythonInterp: /usr/bin/python (found version "2.7.3") 
-- Looking for include file pthread.h
-- Looking for include file pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
TEMP
    linked by target "ycm_core" in directory /home/ting/.vim/bundle/YouCompleteMe/cpp/ycm

-- Configuring incomplete, errors occurred!
╭─ting@noa ~/build ‹python-2.7.3› ‹ruby-1.9.3› 
╰─➤  ..                                                                                                                                     1 ↵ 2013.02.05 00:05:56 CST 
╭─ting@noa ~ ‹python-2.7.3› ‹ruby-1.9.3› 
╰─➤  rm -fr build                                                                                                                               2013.02.05 00:06:35 CST 
╭─ting@noa ~ ‹python-2.7.3› ‹ruby-1.9.3› 
╰─➤  mkdir build                                                                                                                                2013.02.05 00:06:37 CST 
╭─ting@noa ~ ‹python-2.7.3› ‹ruby-1.9.3› 
╰─➤  cd build                                                                                                                                   2013.02.05 00:06:39 CST 
╭─ting@noa ~/build ‹python-2.7.3› ‹ruby-1.9.3› 
╰─➤  cmake -G "Unix Makefiles" -DPATH_TO_LLVM_ROOT=/usr/lib/llvm . ~/.vim/bundle/YouCompleteMe/cpp                                              2013.02.05 00:06:45 CST 
-- The C compiler identification is GNU 4.7.2
-- The CXX compiler identification is GNU 4.7.2
-- Check for working C compiler: /usr/lib/ccache/bin/cc
-- Check for working C compiler: /usr/lib/ccache/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/lib/ccache/bin/c++
-- Check for working CXX compiler: /usr/lib/ccache/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
Your C++ compiler supports C++11, compiling in that mode.
-- Found PythonLibs: /usr/lib64/libpython2.7.so (found suitable version "2.7.3", minimum required is "2") 
Using libclang to provide semantic completion for C/C++/ObjC
-- Found PythonInterp: /usr/bin/python (found version "2.7.3") 
-- Looking for include file pthread.h
-- Looking for include file pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Configuring done
-- Generating done
-- Build files have been written to: /home/ting/build
╭─ting@noa ~/build ‹python-2.7.3› ‹ruby-1.9.3› 
╰─➤                                                                                                                                             2013.02.05 00:06:53 CST 

@Valloric
Copy link
Member

Valloric commented Feb 5, 2013

There's not much I can say. CMake fails to locate a libclang.so by itself. It's in your output: Using external libclang: TEMP-NOTFOUND.

That is either an issue with CMake or with the location where your system libclang.so is placed. Not much for YCM to change.

Still, you got it working, that's good. Don't forget to copy that libclang.so to the YouCompleteMe/python directory though.

@Ivoz
Copy link

Ivoz commented Feb 9, 2013

Perhaps looking for libclang.so as well as llvm/libclang.so would solve this?

Also, wouldn't it be more helpful to symlink libclang rather than copy it, so you continue to use the system's version?

Is there a good reason it needs to be copied, rather than a user providing a path to where it is on their system?

@meh
Copy link
Contributor

meh commented Feb 9, 2013

+1 @Ivoz, that would be better indeed.

@Valloric
Copy link
Member

Valloric commented Feb 9, 2013

@Ivoz ycm_core.so has an RPATH set making it first look in its own directory for libclang.so. This is done so that the user can override the use of the system libclang.so if need (say, it's too old, like it is on my machine).

You can certainly skip the copy-libclang-to-python folder step if you wish. If you have a system libclang.so in the right place, ycm_core.so will find it.

The install guide recommends copying it over to YouCompleteMe/python for the sake of simplicity; I've also had issues where the system libclang is good, but the loader was having issues finding it. Putting the library right next to ycm_core.so eliminates a whole set of potential issues (and issue reports).

Valloric added a commit that referenced this issue Feb 9, 2013
@Valloric
Copy link
Member

Valloric commented Feb 9, 2013

I just pushed a commit for the can't-find-system-libclang-on-Arch issue; if someone with an Arch system could test this out, that would be great.

@nevar
Copy link

nevar commented Feb 10, 2013

This works. Thanks.

v.yurin@hell:~/.vim/bundle/YouCompleteMe$ ./install.sh --clang-completer
/tmp/ycm_build.j4cX ~/.vim/bundle/YouCompleteMe
-- The C compiler identification is GNU 4.7.2
-- The CXX compiler identification is GNU 4.7.2
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
Your C++ compiler supports C++11, compiling in that mode.
-- Found PythonLibs: /usr/lib64/libpython2.7.so (found suitable version "2.7.3", minimum required is "2.5") 
System libclang seems good enough, using it.
Using libclang to provide semantic completion for C/C++/ObjC
Using external libclang: /usr/lib64/llvm/libclang.so
-- Found PythonInterp: /usr/bin/python (found version "3.3") 
-- Looking for include file pthread.h
-- Looking for include file pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Configuring done
[snip]
[100%] Building CXX object ycm/CMakeFiles/ycm_core.dir/ycm_core.cpp.o
[100%] Building CXX object ycm/CMakeFiles/ycm_core.dir/IdentifierUtils.cpp.o
Linking CXX shared library /home/v.yurin/.vim/bundle/YouCompleteMe/python/ycm_core.so
[100%] Built target ycm_core
~/.vim/bundle/YouCompleteMe
v.yurin@hell:~$ uname -a
Linux hell 3.7.5-1-ARCH #1 SMP PREEMPT Mon Jan 28 10:03:32 CET 2013 x86_64 GNU/Linux

Grimy pushed a commit to Grimy/YouCompleteMe that referenced this issue Dec 22, 2014
Allow '*' in ycm_filetype_specific_completion_to_disable.
@hardboydu hardboydu mentioned this issue Jul 4, 2016
limbolily pushed a commit to limbolily/YouCompleteMe that referenced this issue Aug 9, 2016
These flags are redundant for the Linux kernel (*.tmp and /dev/null are
also present in all relevant cases), but some projects use them for all
files.

Fixes ycm-core#11
@jiezinaxumi
Copy link

first, install libclang: apt-get install clang.
second, use --system-libclang, eg:
./install.py --clang-completer --gocode-completer --system-libclang

root@ubuntu:~/.vim/bundle/YouCompleteMe# ./install.py --clang-completer --gocode-completer --system-libclang
Searching Python 2.7 libraries...
Found Python library: /usr/lib/python2.7/config-x86_64-linux-gnu/libpython2.7.so
Found Python headers folder: /usr/include/python2.7
-- The C compiler identification is GNU 4.8.4
-- The CXX compiler identification is GNU 4.8.4
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found PythonLibs: /usr/lib/python2.7/config-x86_64-linux-gnu/libpython2.7.so (found suitable version "2.7.6", minimum required is "2.6")
Using libclang to provide semantic completion for C/C++/ObjC
Using external libclang: /usr/lib/x86_64-linux-gnu/libclang-3.4.so.1
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/ycm_build_X3w4ys
Scanning dependencies of target BoostParts
[ 1%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/filesystem/src/codecvt_error_category.cpp.o
[ 2%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/filesystem/src/operations.cpp.o
[ 3%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/filesystem/src/path.cpp.o
[ 5%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/filesystem/src/path_traits.cpp.o
...
[ 94%] Building CXX object ycm/CMakeFiles/ycm_core.dir/Result.cpp.o
[ 96%] Building CXX object ycm/CMakeFiles/ycm_core.dir/Utils.cpp.o
[ 97%] Building CXX object ycm/CMakeFiles/ycm_core.dir/versioning.cpp.o
[ 98%] Building CXX object ycm/CMakeFiles/ycm_core.dir/ycm_core.cpp.o
[100%] Linking CXX shared library /root/.vim/bundle/YouCompleteMe/third_party/ycmd/ycm_core.so
[100%] Built target ycm_core

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants