zoukankan      html  css  js  c++  java
  • 源码安装vim8

    背景

    突然想要试用youcompleteme插件,但是yum安装的vim版本太低了,于是索性直接从源码编译vim8来使用,中间遇到了一些问题,记录一下以备后续查阅。

    安装

    下载源码

    git clone https://github.com/vim/vim.git
    

    编译、安装

    cd vim/src
    make
    make install
    

    默认安装在/usr/local/bin/vim,由于之前的vim还没卸载,于是直接使用绝对路径打开新的vim8,报错:

    YouCompleteMe unavailable: requires Vim compiled with Python (3.6.0+) support
    

    提示没有添加python3支持,于是重新编译

    ./configure --enable-python3interp=yes
    make
    make install
    

    重新使用绝对路径打开vim,报错消失了,成功打开。

    配置youcompleteme

    参考官方文档:https://github.com/ycm-core/YouCompleteMe#full-installation-guide
    执行python3 install.py --all时报错:

    Searching Python 3.7 libraries...
    ERROR: found static Python library (/usr/local/lib/python3.7/config-3.7m-x86_64-linux-gnu/libpython3.7m.a) but a dynamic one is required. You must use a Python compiled with the --enable-shared flag. If using pyenv, you need to run the command:
      export PYTHON_CONFIGURE_OPTS="--enable-shared"
    before installing a Python version.
    

    原因:源码编译python3.7时没有添加--enable-shared选项,重新编译python3.7

    make distclean
    ./configure --enable-shared --enable-optimizations
    make 
    make install
    

    再执行python3 install.py --all成功。

    安装好YCM之后,打开vim试一下,报错:

    OSError: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found
    

    需要升级gcc版本,参考:https://blog.csdn.net/GUI1259802368/article/details/84934075

    yum provides libstdc++.so.6
    Loaded plugins: auto-update-debuginfo, fastestmirror
    Loading mirror speeds from cached hostfile
    libstdc++-4.8.5-4.el7.i686 : GNU Standard C++ Library
    Repo        : base
    Matched from:
    Provides    : libstdc++.so.6
    
    
    
    libstdc++-4.8.5-5.tl2.i686 : GNU Standard C++ Library
    Repo        : tlinux
    Matched from:
    Provides    : libstdc++.so.6
    
    
    
    libstdc++-4.8.5-39.tl2.i686 : GNU Standard C++ Library
    Repo        : tlinux
    Matched from:
    Provides    : libstdc++.so.6
    
    
    
    libstdc++-4.8.5-39.tl2.1.i686 : GNU Standard C++ Library
    Repo        : tlinux
    Matched from:
    Provides    : libstdc++.so.6
    
    
    
    libstdc++-4.8.5-39.tl2.1.i686 : GNU Standard C++ Library
    Repo        : @tlinux
    Matched from:
    Provides    : libstdc++.so.6
    
    

    安装最新版本:

    yum install libstdc++-4.8.5-39.tl2.1.i686
    

    新版本是安装在/usr/loca/lib64/目录下,需要将其拷贝到/usr/lib64目录下

    cp /usr/local/lib64/libstdc++.so.6.0.28 /usr/lib64/
    ln -sf /usr/lib64/libstdc++.so.6.0.28 /usr/lib64/
    

    重新打开vim,报错消失,终于完成了。

    参考:
    https://github.com/ycm-core/YouCompleteMe/wiki/Building-Vim-from-source

  • 相关阅读:
    js-YDUI 移动端解决方案
    js 关于网易淘宝移动端适配的学习
    JavaScript--数据结构与算法之排序
    《致橡树》
    JavaScript--Module模式
    js-轮播图的总结
    flex布局:
    JavaScript--模块化 JavaScript module designer
    JavaScript--数据结构之队列
    剑指offer——数组中的逆序对
  • 原文地址:https://www.cnblogs.com/lit10050528/p/13388769.html
Copyright © 2011-2022 走看看