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

标签 python c gcc vim

我目前正在尝试在具有特别奇特设置的 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/

相关文章:

python - 为什么我的 json 中是 '/'

python - 在远程服务器上运行 Selenium Python 脚本

python - 将 View 链接到 Django 链接

c - 洪水游戏,尝试几次后崩溃

c - 如何使用 u-boot 为 ARM 处理器加载应用程序

gcc - 如何让 GCC 在使用内部函数时使用两个以上的 SIMD 寄存器?

Python:Sqlalchemy 搞砸了 pyinstaller?

您可以对 C_INCLUDE_PATH 使用通配符吗

c - 在 C 中打印 UTF-8 字符串的字节

c - 抑制 "ISO C99 requires rest arguments to be used"