ubuntu上vim配置YoucompleteMe时./install.sh --clang-completer出现错误

春起之苗 2014-06-05 10:20:33
我想在ubuntu上的vim中配置YouCompleteMe插件。
按照网上的介绍http://tieba.baidu.com/p/2672605209,我已经通过git安装了vundle插件,并安装好了YouComplete,同时也安装了python-dev,clang,cmake.但是当我进入到~/.vim/bundle/YoucompleteMe中,执行./install.sh --clang-completer时出现错误

lucien@Lucien-PC:~/.vim/bundle/YouCompleteMe$ ./install.sh --clang-completer
/tmp/ycm_build.hxAUrv ~/.vim/bundle/YouCompleteMe
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- 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.
CMake Error at /usr/local/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:70 (MESSAGE):
Could NOT find PythonLibs (missing: PYTHON_LIBRARIES PYTHON_INCLUDE_DIRS)
Call Stack (most recent call first):
/usr/local/share/cmake-2.8/Modules/FindPythonLibs.cmake:110 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
BoostParts/CMakeLists.txt:30 (find_package)


-- Configuring incomplete, errors occurred!


我看到错误提示,想当然的在~/.bashrc中声明了两个环境变量,

#Add for python
export PYTHON_LIBRARIES="/usr/lib/python2.7"
export PYTHON_INCLUDE_DIRS="/usr/include/python2.7"

发现这样还是出现同样的错误!
请教各位指点下,谢谢
...全文
4713 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
qt-长沙-小昊 2016-12-09
  • 打赏
  • 举报
回复
阅读:~/.vim/bundle/YouCompleteMe/下的:README.md

For those who want to use the system version of boost, you would pass
`-DUSE_SYSTEM_BOOST=ON` to cmake. This may be necessary on some systems
where the bundled version of boost doesn't compile out of the box.

With that in mind, run the following command in the `ycm_build` directory:
cmake -G "<generator>" -DPATH_TO_LLVM_ROOT=~/ycm_temp/llvm_root_dir . ~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp
where `<generator>` is replaced like above.

You could also force the use of a custom libclang library with
`-DEXTERNAL_LIBCLANG_PATH=/path/to/libclang.so` flag (the library would end
with `.dylib` on a Mac). Again, this flag would be used _instead of_ the
other flags. **If you compiled LLVM from source, this is the flag you should
be using.**

例子:
cmake -G "Unix Makefiles" -DUSE_SYSTEM_BOOST=ON -DEXTERNAL_LIBCLANG_PATH=/usr/lib/i386-linux-gnu/libclang-3.8.so.1 . ~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp
u010088932 2016-04-09
  • 打赏
  • 举报
回复
linux@linux:~$ sudo cmake -G "Unix Makefiles" . ~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp [sudo] linux 的密码: -- The C compiler identification is unknown -- The CXX compiler identification is unknown -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- broken CMake Error at /usr/share/cmake-3.2/Modules/CMakeTestCCompiler.cmake:61 (message): The C compiler "/usr/bin/cc" is not able to compile a simple test program. It fails with the following output: Change Dir: /home/linux/CMakeFiles/CMakeTmp Run Build Command:"/usr/bin/make" "cmTryCompileExec2035582679/fast" /usr/bin/make -f CMakeFiles/cmTryCompileExec2035582679.dir/build.make CMakeFiles/cmTryCompileExec2035582679.dir/build make[1]: Entering directory '/home/linux/CMakeFiles/CMakeTmp' /usr/bin/cmake -E cmake_progress_report /home/linux/CMakeFiles/CMakeTmp/CMakeFiles 1 Building C object CMakeFiles/cmTryCompileExec2035582679.dir/testCCompiler.c.o /usr/bin/cc -o CMakeFiles/cmTryCompileExec2035582679.dir/testCCompiler.c.o -c /home/linux/CMakeFiles/CMakeTmp/testCCompiler.c cc: error trying to exec 'as': execvp: 没有那个文件或目录 CMakeFiles/cmTryCompileExec2035582679.dir/build.make:57: recipe for target 'CMakeFiles/cmTryCompileExec2035582679.dir/testCCompiler.c.o' failed make[1]: Leaving directory '/home/linux/CMakeFiles/CMakeTmp' make[1]: *** [CMakeFiles/cmTryCompileExec2035582679.dir/testCCompiler.c.o] Error 1 Makefile:117: recipe for target 'cmTryCompileExec2035582679/fast' failed make: *** [cmTryCompileExec2035582679/fast] Error 2 CMake will not be able to correctly generate this project. Call Stack (most recent call first): CMakeLists.txt:32 (project) -- Configuring incomplete, errors occurred! See also "/home/linux/CMakeFiles/CMakeOutput.log". See also "/home/linux/CMakeFiles/CMakeError.log".
wiwiden123 2015-12-23
  • 打赏
  • 举报
回复
richard_wzj 2015-07-27
  • 打赏
  • 举报
回复
我是安装完成了 打开vim都是错误 处理 function youcompleteme#Enable..<SNR>65_SetUpPython 时发生错误: 第 34 行: Traceback (most recent call last): 请按 ENTER 或其它命令继续 处理 function youcompleteme#Enable..<SNR>65_SetUpPython 时发生错误: 第 34 行: File "<string>", line 15, in <module> 请按 ENTER 或其它命令继续 处理 function youcompleteme#Enable..<SNR>65_SetUpPython 时发生错误: 第 34 行: File "/home/richardwei/.vim/bundle/YouCompleteMe/autoload/../python/ycm/base.p y", line 20, in <module> 请按 ENTER 或其它命令继续 处理 function youcompleteme#Enable..<SNR>65_SetUpPython 时发生错误: 第 34 行: from ycm import vimsupport
chenhao890411 2014-12-15
  • 打赏
  • 举报
回复
需要安装python-devel
uestcjerry 2014-11-09
  • 打赏
  • 举报
回复
同求答案 楼上说的不行啊 安装了python2.7-dev 所有的cmake clang python依赖都装了 还是不行
就想叫yoko 2014-08-13
  • 打赏
  • 举报
回复
可以试试 clang_complete 效果还可以
浪漫茶 2014-08-13
  • 打赏
  • 举报
回复
你需要安装python2.7-dev sudo apt-get install python2.7-dev

742

社区成员

发帖
与我相关
我的任务
社区描述
该论坛主要探讨Linux系统在IBM Power平台的安装、部署、应用开发等话题,并为网友们提供自由交流的平台。
社区管理员
  • Power Linux社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧