在Ubuntu上使用python支持编译vim [英] compiling vim with python support on Ubuntu

查看:414
本文介绍了在Ubuntu上使用python支持编译vim的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在Ubuntu上使用python解释器从源代码编译vim。我已经安装了vim的依赖,在Ubuntu上安装了python2.7-devel和python2.7-dbg软件包,然后进行配置步骤。

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

config目录包含config.c文件。 make步骤失败,出现以下错误。

  ... 

objects / py_config.o: (.data + 0xcc):未定义引用`initcStringIO'
objects / py_config.o :(。data + 0xd4):未定义引用`initcPickle'
objects / py_config.o :(。 0xdc):未定义引用`initzlib'
collect2:ld返回1退出状态
make:*** [vim]错误1

我已经尝试稳定版本,调整配置等。但没有找到确定的答案。



输出 - 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. p>设置路径,使 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本身。


I am trying to compile vim from source with python interpreter on Ubuntu. I have installed the dependencies for vim, installed python2.7-devel and python2.7-dbg packages on Ubuntu and do the configure step like this

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

The config directory does contain the config.c file. The make step fails with the following error.

...

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

I have tried stable builds, tweaked around configure etc. But do not find a definitive answer. Also vim builds without the python-interpreter.

Here the complete

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

error - http://paste.pocoo.org/show/577752/

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

解决方案

Answering my own question after doing significant research. Looks in certain Ubuntu installs, the files which vim is looking for compilation may be missing.

After realizing that I went ahead with custom install of Python source (./configure --prefix=/home/senthil/localpython; make; make install) and then proceeded with vim compilation aginst this one.

  1. Set your path so that python points to the new local install.

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

  2. Then start the compilation with the following flags.

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

You should see that vim compiles fine with using the local python interpreter. As has been informed by various sources, this increases the size of vim and I also felt that the speed had significant become slower. Just after finishing this exercise (in a really way with patience), I think, I would like to use the system compiled vim itself.

这篇关于在Ubuntu上使用python支持编译vim的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆