[英]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 編譯反對這個。
設置您的路徑,使python
指向新的本地安裝。
PATH=/home/senthil/localpython/bin:$PATH
然后使用以下標志開始編譯。
./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-dev
和python2.7-dev
(或任何與您的 python 版本匹配的開發)。 這兩個包可能指向相同的文件,但它對我有用。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.