繁体   English   中英

在 Ubuntu 上使用 python 支持编译 vim

[英]compiling vim with python support on Ubuntu

我正在尝试使用 Ubuntu 上的 python 解释器从源代码编译 vim。我已经安装了 vim 的依赖项,在 Ubuntu 上安装了 python2.7-devel 和 python2.7-dbg 包,并执行这样的配置步骤

./configure --enable-pythoninterp --with-python-config-dir=/usr/lib/python2.7/config

配置目录确实包含 config.c 文件。 make 步骤失败并出现以下错误。

...

objects/py_config.o:(.data+0xcc): undefined reference to `initcStringIO'
objects/py_config.o:(.data+0xd4): undefined reference to `initcPickle'
objects/py_config.o:(.data+0xdc): undefined reference to `initzlib'
collect2: ld returned 1 exit status
make: *** [vim] Error 1

我已经尝试过稳定的构建,围绕配置进行调整等。但没有找到明确的答案。 vim 也没有 python 解释器。

这里是完整的

output - http://paste.pocoo.org/show/577749/

错误 - http://paste.pocoo.org/show/577752/

Makefile - http://paste.pocoo.org/show/577751/

在进行大量研究后回答我自己的问题。 在某些Ubuntu安装中查找,vim正在寻找编译的文件可能会丢失

在意识到我继续自定义安装 Python 源代码( ./configure --prefix=/home/senthil/localpython; make; make install )然后继续进行 vim 编译反对这个。

  1. 设置您的路径,使python指向新的本地安装。

    PATH=/home/senthil/localpython/bin:$PATH

  2. 然后使用以下标志开始编译。

    ./configure --enable-pythoninterp --with-features=huge --with-python-config-dir=/home/senthil/localpython/lib/python2.7/config

您应该看到 vim 使用本地 python 解释器编译得很好。 正如各种消息来源所告知的那样,这增加了 vim 的大小,我也觉得速度明显变慢了。 刚完成这个练习(非常有耐心),我想,我想使用系统编译 vim 本身。

使用/usr/bin/python2.7-config --configdir获取配置目录

IE:

sudo apt-get build-dep vim 
hg clone https://vim.googlecode.com/hg/ vim
./configure --enable-pythoninterp --with-features=huge --prefix=$HOME/opt/vim --with-python-config-dir=$(/usr/bin/python2.7-config --configdir)
make && make install

在编译 Vim 之前,安装python-devpython2.7-dev (或任何与您的 python 版本匹配的开发)。 这两个包可能指向相同的文件,但它对我有用。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM