Disclaimer: There may be many errors and unneccesary parts in this post. But the command works, at least on my machine.
Background #
Somewhat old system. No sudo. Want awesome Vim8 +Python3.8
Quick Answer #
LDFLAGS=-rdynamic ./configure \
--with-features=huge \
--enable-fail-if-missing \
--enable-largefile \
--enable-multibyte \
--enable-python3interp \
--with-python3-command=python3.8 \
--with-python3-config-dir=$HOME/.pyenv/versions/3.8.5/lib/python3.8/config-3.8-x86_64-linux-gnu \
--prefix=$HOME
make
make installbash
Break Down #
Clean before try again #
It is not a good news that the second run is very fast.
make clean distcleanbash
Options v.s. Env vars #
Both are important. For example, do not pass vi_cv_path_python as an option, although it's in lower case 😄
User install #
--prefix=$HOMEbash
What is python3-config-dir
#
https://vi.stackexchange.com/a/18509
A directory containing config.c
-rdynamic?
It just solves undefined symbol: PyTuple_Type: https://github.com/vim/vim/issues/5509#issuecomment-650468467
Also, just go dynamic (with +python3/dyn) is fine:
./configure \
--enable-python3interp=dynamic \
--with-python3-command=python3.8 \
--with-python3-config-dir=$HOME/.pyenv/versions/3.8.5/lib/python3.8/config-3.8-x86_64-linux-gnu \
--prefix=$HOMEbash
Thank YOU!
You save me. Compiling Vim on RHEL 7 with python support has been killing me for weeks.
LDFLAGS=-rdynamicis my saver!If someone else will be searching for this:
--enable-python3interp=dynamicdid not work for me but--enable-python3interpworks.