To compile YCM, the python must be installed with
--enable-shared option enabled. By default, pyenv doesn’t install python with this option on, so you need to tell pyenv that we need it:
Before compiling you have to install
Here, we assume you installed YCM with
vim-plug, the default YCM directory is in
~/.config/nvim/plugged/YouCompleteMefor neovim users.
Create new folders for building YCM.123cd /tmpmkdir ycm_buildmkdir -p ycm_temp/llvm_root_dir
For support C-family languages autocomplete, you have to download the binary distribution of LLVM+Clang from llvm.org, and extract to
Then run the following command in
~/ycm_builddirectory:1234567cmake -G "Unix Makefiles" -DUSE_PYTHON2=OFF \-DPYTHON_INCLUDE_DIR=~/.pyenv/versions/3.6.0/include/python3.6m \-DPYTHON_LIBRARY=~/.pyenv/versions/3.6.0/lib/libpython3.6m.so \-DPATH_TO_LLVM_ROOT=/usr . \~/.config/nvim/plugged/YouCompleteMe/third_party/ycmd/cppcmake --build . --target ycm_core --config Release
Note: Use the latest version of cmake to bypass potential errors or abnormalities.
Share Link: http://d0u9.win/posts/1936695139.html