Vim compilation YCM compilation error? Seek a solution?

  question, vim

My operating system environment centos 6.6 encountered an error when installing vim’s YCM plug-in.
Vim compiled for itself and has added corresponding interpretation language support.
The python version of the system is 2.6. I compiled and added versions 2.7 and 3.4, so I have these three versions in my environment.
When entering YCM directory and executing command installation, the following error occurred:

[ 90%] Building CXX object ycm/CMakeFiles/ycm_client_support.dir/Result.cpp.o
Linking CXX shared library /home/xuanyuan/k-vim/bundle/YouCompleteMe/third_party/ycmd/ycm_client_support.so
/usr/bin/ld: /usr/local/lib/libpython2.7.a(abstract.o): relocation R_X86_64_32S against `_Py_NotImplementedStruct’ can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libpython2.7.a: could not read symbols: Bad value
Collect2: error: ld returned 1
gmake[3]:*[/home/xuanyuan/k-vim/bundle/youcompleteme/third _ party/ycmd/ycm _ client _ support.so] error 1
gmake[2]:*[ycm/cmakefiles/ycm _ client _ support.dir/all] error 2
gmake[1]:*[ycm/cmakefiles/ycm _ support _ libs.dir/rule] error 2
gmake:*[ycm_support_libs] Error 2
Traceback (most recent call last):
File “/home/xuanyuan/k-vim/bundle/YouCompleteMe/third_party/ycmd/build.py”, line 327, in <module>

Main()

File “/home/xuanyuan/k-vim/bundle/YouCompleteMe/third_party/ycmd/build.py”, line 316, in Main

BuildYcmdLibs( args )

File “/home/xuanyuan/k-vim/bundle/YouCompleteMe/third_party/ycmd/build.py”, line 261, in BuildYcmdLibs

subprocess.check_call( build_command )

File “/usr/local/lib/python2.7/subprocess.py”, line 540, in check_call

raise CalledProcessError(retcode, cmd)

subprocess.CalledProcessError: Command ‘[‘cmake’, ‘–build’, ‘.’, ‘–target’, ‘ycm_support_libs’, ‘–‘, ‘-j’, ‘1’]’ returned non-zero exit status 2
Traceback (most recent call last):
File “./install.py”, line 32, in <module>

Main()

File “./install.py”, line 21, in Main

subprocess.check_call( [ python_binary, build_file ] + sys.argv[1:] )

File “/usr/local/lib/python2.7/subprocess.py”, line 540, in check_call

raise CalledProcessError(retcode, cmd)

subprocess.CalledProcessError: Command ‘[‘/usr/local/bin/python’, ‘/home/xuanyuan/k-vim/bundle/YouCompleteMe/third_party/ycmd/build.py’]’ returned non-zero exit status 1

Seek a solution?

Resolved:
Step 1: Lack of python2.7 shared library, recompile and install python2.7 and add the compile option –enable-shared.
If the problem is solved, the following steps do not need to be performed, if the following error occurs:
The following error may be caused by multiple versions of python:
python: error while loading shared libraries: libpython2.7.so.1.0: cannot open shared object file: No such file or directory
The solution to this mistake:
Step 2:
Edit the /etc/ld.so.conf file, add the following content /usr/local/lib, and directly add a new line.
After saving, execute the following command (-> is a command prompt, and everyone can set it as needed):
—> /sbin/ldconfig
—> /sbin/ldconfig –v