centos 安装编译时常见错误总结

转载:http://blog.csdn.net/u010719917/article/details/73945445

percona-xtrabackup-2.4.7.tar.gz 源码安装(source code)(centos7)
1,安装依懒包
yum install cmake gcc gcc-c++ libaio libaio-devel automake autoconf bzr
    bison libtool ncurses5-devel
    
2.cmake遇到的各种问题及解决办法
cmake -DBUILD_CONFIG=xtrabackup_release -DDOWNLOAD_BOOST=1   && make -j4
报如下错:
CMake Error at cmake/boost.cmake:81 (MESSAGE):
  You can download it with -DDOWNLOAD_BOOST=1 -DWITH_BOOST=<directory>

  This CMake script will look for boost in <directory>.  If it is not there,
  it will download and unpack it (in that directory) for you.

  If you are inside a firewall, you may need to use an http proxy:

  export http_proxy=http://example.com:80

Call Stack (most recent call first):
  cmake/boost.cmake:238 (COULD_NOT_FIND_BOOST)
  CMakeLists.txt:466 (INCLUDE)

解决办法:
    mkdir  /usr/local/boost 
    cd /usr/local/boost
    wget https://nchc.dl.sourceforge.net/project/boost/boost/1.59.0/boost_1_59_0.tar.gz
    cmake -DBUILD_CONFIG=xtrabackup_release -DDOWNLOAD_BOOST=1 -DWITH_BOOST=/usr/local/boost  && make -j4

CMake Error at cmake/gcrypt.cmake:25 (MESSAGE):
  Cannot find gcrypt.h in /usr/include;/usr/local/include;/opt/local/include.
  You can use libgcrypt-config --cflags to get the necessary path and pass it
  to CMake with -DGCRYPT_INCLUDE_PATH=<path>
Call Stack (most recent call first):
  storage/innobase/xtrabackup/src/CMakeLists.txt:26 (FIND_GCRYPT)

解决办法:  
  yum install crypt* ; yum install libgcrypt*
  
  
  
  CMake Error at cmake/curl.cmake:23 (MESSAGE):
  Could not find cURL on your system
Call Stack (most recent call first):
  storage/innobase/xtrabackup/src/CMakeLists.txt:27 (FIND_CURL)
解决办法:
yum -y install libcurl-devel

-- libev NOT found.
CMake Error at cmake/libev.cmake:23 (MESSAGE):
  Could not find libev on your system
Call Stack (most recent call first):
  storage/innobase/xtrabackup/src/CMakeLists.txt:28 (FIND_EV)
install vim-common
解决办法:
http://download.chinaunix.net/download/0013000/12657.shtml  
libev-3.7.tar.gz 
tar xvzf libev-4.22.tar.gz    
./configure  
make   
make install  


CMake Error at storage/innobase/xtrabackup/src/CMakeLists.txt:34 (MESSAGE):
  xxd not found.  Try to install vim-common.
解决办法:
yum -y install vim-common

[ 22%] /bin/sh: sphinx-build: command not found
make[2]: *** [storage/innobase/xtrabackup/doc/source/build/man] Error 127
Built target regex
make[1]: *** [storage/innobase/xtrabackup/doc/source/CMakeFiles/man.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
Built target GenVersionCheck
Built target archive_static
make: *** [all] Error 2

解决办法:
 yum -y install python-sphinx
-------------------------提示--------------------------
 Installed:
  python-sphinx.noarch 0:1.1.3-11.el7                                                                                                                                      

Dependency Installed:
  libwebp.x86_64 0:0.3.0-3.el7                                      python-babel.noarch 0:0.9.6-8.el7                            python-backports.x86_64 0:1.0-8.el7       
  python-backports-ssl_match_hostname.noarch 0:3.4.0.2-4.el7        python-docutils.noarch 0:0.11-0.2.20130715svn7687.el7        python-jinja2.noarch 0:2.7.2-2.el7        
  python-markupsafe.x86_64 0:0.11-10.el7                            python-pillow.x86_64 0:2.0.0-19.gitd1c6db8.el7               python-pygments.noarch 0:1.4-9.el7        
  python-setuptools.noarch 0:0.9.8-4.el7         



c++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://bugzilla.redhat.com/bugzilla> for instructions.
make[2]: *** [libmysqld/CMakeFiles/sql_embedded.dir/__/sql/item_geofunc.cc.o] Error 4
make[2]: *** Waiting for unfinished jobs....
[ 71%] Building CXX object sql/CMakeFiles/sql.dir/item_geofunc_internal.cc.o
[ 71%] Building CXX object sql/CMakeFiles/sql.dir/item_geofunc_relchecks.cc.o
[ 71%] Building CXX object sql/CMakeFiles/sql.dir/item_geofunc_relchecks_bgwrap.cc.o
[ 71%] Building CXX object sql/CMakeFiles/sql.dir/item_geofunc_setops.cc.o
c++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://bugzilla.redhat.com/bugzilla> for instructions.
make[2]: *** [sql/CMakeFiles/sql.dir/item_geofunc.cc.o] Error 4
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [libmysqld/CMakeFiles/sql_embedded.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
make[1]: *** [sql/CMakeFiles/sql.dir/all] Error 2
make: *** [all] Error 2
原因:
是内存不够
解决办法:
If this is the case, you are running out of memory. So run perhaps make -j 4 instead. This will mean fewer parallel jobs and will mean the compilation will take longer but hopefully will not exhaust your system memory. 
增大内存,或者减少并发安装
  
  
增大内存后,再次运行:
cmake -DBUILD_CONFIG=xtrabackup_release -DDOWNLOAD_BOOST=1 -DWITH_BOOST=/usr/local/boost  && make -j4
最终提示
[ 95%] Building CXX object sql/CMakeFiles/sql.dir/mysqld_daemon.cc.o
Linking CXX static library libsql.a
[100%] Built target sql
说明cmake 完成

3.最后一步:
make install 

原文地址:https://www.cnblogs.com/yangxiaochu/p/7741570.html