gpt4 book ai didi

python - 在非标准路径配置中编译具有静态链接 python 支持的 vim

转载 作者:行者123 更新时间:2023-12-01 03:36:26 24 4
gpt4 key购买 nike

我目前正在尝试在具有特别奇特设置的 Fedora 20 机器上编译 vim:

  • 没有 root 访问权限
  • python2python3 手动编译并安装在 ~/.local 中,可以正常工作(导出 PATH 后)和LD_LIBRARY_PATH)。
  • zsh 作为 shell
  • gcc 版本 4.8.3 20140911 (Red Hat 4.8.3-7) (GCC)

如果我将编译过程配置为:

./configure --with-features=huge --enable-pythoninterp --enable-python3interp --prefix=$HOME/.local

然后make && make installvim使用+python/dyn +python3/dyn正确编译。

vim --version | grep python
+cryptv +linebreak +python/dyn +vreplace
+cscope +lispindent +python3/dyn +wildignore

但是,在 vim 内部, :echo has('python') 返回 0 (事实上 MatchTagAlways 对此提示......)。

所以我告诉自己,让我们尝试强制静态链接安装:

export LDFLAGS=-static
./configure --with-features=huge --enable-pythoninterp --enable-python3interp --prefix=$HOME/.local

在配置命令后不久结束:

configure: creating cache auto/config.cache
checking whether make sets $(MAKE)... yes
checking for gcc... gcc
checking whether the C compiler works... no
configure: error: in `/students/rm_16_17/dibattista/build/vim/src':
configure: error: C compiler cannot create executables
See `config.log' for more details

Here完整的configure.log。相关行应该是:

configure:3027: gcc   -static conftest.c  >&5
/usr/bin/ld: cannot find -lc
collect2: error: ld returned 1 exit status

我无法真正解密。看来gcc没有-static标志。是这个问题吗?

最佳答案

最后我缺少的是编译 Python 时将其编译为共享库 --enable-shared 时的一个标志。

提醒一下:请务必阅读所有安装说明:)

关于python - 在非标准路径配置中编译具有静态链接 python 支持的 vim,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40311073/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com