{"id":954,"date":"2014-02-28T02:46:58","date_gmt":"2014-02-27T18:46:58","guid":{"rendered":"https:\/\/cowman-chiang.no-ip.org\/wordpress\/?p=954"},"modified":"2019-06-20T10:25:08","modified_gmt":"2019-06-20T02:25:08","slug":"install-vim-plugin-youcompleteme-in-centos","status":"publish","type":"post","link":"https:\/\/cowmanchiang.me\/wp\/?p=954","title":{"rendered":"Install Vim Plugin: YouCompleteMe in CentOS"},"content":{"rendered":"<p>\u6700\u8fd1\u4e00\u5247fb\u9b27\u5f97\u6cb8\u6cb8\u63da\u63daXD<br \/>\n\u4e3b\u8981\u662f\u8aaa\u6211\u600e\u9ebc\u6703\u7528vim\u7de8\u8f2fphp\u7de8\u4e86\u5169\u5e74&#8230;<br \/>\n\u7136\u5f8c\u5c31\u5f88\u591a\u4eba\u958b\u59cb\u63d0\u4f9b\u8aaavim\u624d\u662f\u6700\u597d\u7528\u7684~\u56e0\u70ba\u6709\u8a31\u591aplugin\u53ef\u4ee5\u7528&#8230;.Orz<br \/>\n\u73fe\u5728\u5c31\u4f86\u5b89\u88dd\u4e00\u4e0b\u9084\u883b\u591a\u4eba\u63a8\u7684ycm<!--more--><\/p>\n<p>\u53c3\u8003\u6b64\u7bc7\u6587\u7ae0<a href=\"http:\/\/blog.csdn.net\/cloudresearch\/article\/details\/19170905\" target=\"_blank\" rel=\"noopener noreferrer\">Centos\u4e0b\u5b89\u88ddYouCompleteMe<\/a><br \/>\n\u9996\u5148\u8981\u5148\u78ba\u8a8dvim\u7248\u672c\u5fc5\u9808\u662f7.3.584\u4ee5\u4e0a<br \/>\n\u63a5\u8457\u5b89\u88ddvundle<\/p>\n<pre lang=\"bash\">\n[root@WP ~]# git clone https:\/\/github.com\/gmarik\/vundle.git ~\/.vim\/bundle\/vundle\nInitialized empty Git repository in \/root\/.vim\/bundle\/vundle\/.git\/\nremote: Reusing existing pack: 2586, done.\nReceiving objects: 100% (2586\/2586), 774.70 KiB | 304 KiB\/s, done.\nremote: Total 2586 (delta 0), reused 0 (delta 0)\nResolving deltas: 100% (844\/844), done.\n<\/pre>\n<p>\u63a5\u8457\u5728\/etc\/vimrc\u6a94\u6848\u4e2d\u6dfb\u52a0<br \/>\n<code>filetype off<br \/>\nset rtp+=~\/.vim\/bundle\/vundle\/<br \/>\ncall vundle#rc()<\/p>\n<p>Bundle 'Valloric\/YouCompleteMe'<\/p>\n<p>filetype plugin indent on <\/code><\/p>\n<p>\u63a5\u8457\u4e0b\u8f09YCM\u7684source<\/p>\n<pre lang=\"bash\">\n[root@WP ~]# git clone https:\/\/github.com\/Valloric\/YouCompleteMe.git ~\/.vim\/bundle\/YouCompleteMe\nInitialized empty Git repository in \/root\/.vim\/bundle\/YouCompleteMe\/.git\/\nremote: Counting objects: 28158, done.\nremote: Compressing objects: 100% (18973\/18973), done.\nremote: Total 28158 (delta 8444), reused 28148 (delta 8437)\nReceiving objects: 100% (28158\/28158), 27.91 MiB | 2.55 MiB\/s, done.\nResolving deltas: 100% (8444\/8444), done.\n<\/pre>\n<p>\u4e4b\u5f8c\u4fbf\u958b\u59cb\u5c0dycm\u9032\u884c\u7de8\u8b6f\uff0c\u4f46\u5728\u9019\u4e4b\u524d\u5148\u900f\u904eyum install\u5b89\u88ddcmake28\u3001python-devel\u3001gcc\u3001<\/p>\n<pre lang=\"bash\">\n[root@WP ~]# mkdir ycm_build\n[root@WP ~]# cd ycm_build\/\n[root@WP ycm_build]# cmake28 -G \"Unix Makefiles\" . ~\/.vim\/bundle\/YouCompleteMe\/cpp\n-- The C compiler identification is GNU 4.4.7\n-- The CXX compiler identification is GNU 4.4.7\n-- Check for working C compiler: \/usr\/bin\/cc\n-- Check for working C compiler: \/usr\/bin\/cc -- works\n-- Detecting C compiler ABI info\n-- Detecting C compiler ABI info - done\n-- Check for working CXX compiler: \/usr\/bin\/c++\n-- Check for working CXX compiler: \/usr\/bin\/c++ -- works\n-- Detecting CXX compiler ABI info\n-- Detecting CXX compiler ABI info - done\nYour C++ compiler does NOT support C++11, compiling in C++03 mode.\n-- Found PythonLibs: \/usr\/lib\/libpython2.6.so (found suitable version \"2.6.6\", minimum required is \"2.6\")\nNOT using libclang, no semantic completion for C\/C++\/ObjC will be available\n-- Found PythonInterp: \/usr\/bin\/python (found version \"2.6.6\")\n-- Looking for include file pthread.h\n-- Looking for include file pthread.h - found\n-- Looking for pthread_create\n-- Looking for pthread_create - not found\n-- Looking for pthread_create in pthreads\n-- Looking for pthread_create in pthreads - not found\n-- Looking for pthread_create in pthread\n-- Looking for pthread_create in pthread - found\n-- Found Threads: TRUE\n-- Configuring done\n-- Generating done\n-- Build files have been written to: \/root\/ycm_build\n\n[root@WP ycm_build]# cmake28 -G \"Unix Makefiles\" -DPATH_TO_LLVM_ROOT=~\/.vim\/bundle\/YouCompleteMe\/cpp\/llvm . ~\/.vim\/bundle\/YouCompleteMe\/cpp\n\nYour C++ compiler does NOT support C++11, compiling in C++03 mode.\nUsing libclang to provide semantic completion for C\/C++\/ObjC\n-- Configuring done\n-- Generating done\n-- Build files have been written to: \/root\/ycm_build\n\n[root@WP ycm_build]# make ycm_core\nScanning dependencies of target BoostParts\n[  0%] Building CXX object BoostParts\/CMakeFiles\/BoostParts.dir\/libs\/regex\/src\/w32_regex_traits.cpp.o\n[  1%] Building CXX object BoostParts\/CMakeFiles\/BoostParts.dir\/libs\/regex\/src\/cregex.cpp.o\n##\u7701\u7565##\n[ 96%] Building CXX object ycm\/CMakeFiles\/ycm_core.dir\/ycm_core.cpp.o\n[ 97%] Building CXX object ycm\/CMakeFiles\/ycm_core.dir\/Utils.cpp.o\n[ 98%] Building CXX object ycm\/CMakeFiles\/ycm_core.dir\/CandidateRepository.cpp.o\n[ 98%] Building CXX object ycm\/CMakeFiles\/ycm_core.dir\/Result.cpp.o\n[100%] Building CXX object ycm\/CMakeFiles\/ycm_core.dir\/LetterNode.cpp.o\n[100%] Building CXX object ycm\/CMakeFiles\/ycm_core.dir\/LetterNodeListMap.cpp.o\nLinking CXX shared library \/root\/.vim\/bundle\/YouCompleteMe\/python\/ycm_core.so\n[100%] Built target ycm_core\n\n[root@WP ycm_build]# make\n[ 66%] Built target BoostParts\nScanning dependencies of target ycm_client_support\n[ 66%] Building CXX object ycm\/CMakeFiles\/ycm_client_support.dir\/IdentifierUtils.cpp.o\n[ 67%] Building CXX object ycm\/CMakeFiles\/ycm_client_support.dir\/CustomAssert.cpp.o\n##\u7701\u7565##\ncollect2: ld \u56de\u50b3 1\nmake[2]: *** [ycm\/tests\/ycm_core_tests] Error 1\nmake[1]: *** [ycm\/tests\/CMakeFiles\/ycm_core_tests.dir\/all] Error 2\n<\/pre>\n<p>\u8a66\u4e86\u5169\u6b21\u9084\u662f\u4e00\u6a23\u7684error \u6158&#8230;.<br \/>\n\u4e0b\u6b21\u518d\u6230&#8230;..<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6700\u8fd1\u4e00\u5247fb\u9b27\u5f97\u6cb8\u6cb8\u63da\u63daXD \u4e3b\u8981\u662f\u8aaa\u6211\u600e\u9ebc\u6703\u7528vim\u7de8\u8f2fphp\u7de8\u4e86\u5169\u5e74&#8230; \u7136\u5f8c\u5c31\u5f88\u591a\u4eba\u958b\u59cb\u63d0\u4f9b\u8aaavim\u624d\u662f\u6700\u597d\u7528\u7684~\u56e0\u70ba\u6709\u8a31\u591aplugin\u53ef\u4ee5\u7528&#8230;.Orz \u73fe\u5728\u5c31\u4f86\u5b89\u88dd\u4e00\u4e0b\u9084\u883b\u591a\u4eba\u63a8\u7684ycm<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[58],"tags":[],"class_list":["post-954","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/cowmanchiang.me\/wp\/index.php?rest_route=\/wp\/v2\/posts\/954","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cowmanchiang.me\/wp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cowmanchiang.me\/wp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cowmanchiang.me\/wp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cowmanchiang.me\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=954"}],"version-history":[{"count":1,"href":"https:\/\/cowmanchiang.me\/wp\/index.php?rest_route=\/wp\/v2\/posts\/954\/revisions"}],"predecessor-version":[{"id":2053,"href":"https:\/\/cowmanchiang.me\/wp\/index.php?rest_route=\/wp\/v2\/posts\/954\/revisions\/2053"}],"wp:attachment":[{"href":"https:\/\/cowmanchiang.me\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=954"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cowmanchiang.me\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=954"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cowmanchiang.me\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=954"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}