编译安装cmake

编译安装cmake
下载cmake源码包cmake-2.8.4.tar.gz,mv到/usr/local/src目录下
[root@localhost ~]#  cd /usr/local/src/  
[root@localhost src]#  tar xzvf cmake-2.8.7.tar.gz   
[root@localhost src]#  cd cmake-2.8.7 
[root@localhost cmake-2.8.4]#  ./bootstrap   
---------------------------------------------  
CMake 2.8.4, Copyright 2000-2009 Kitware, Inc.  
---------------------------------------------  
Error when bootstrapping CMake:  
Cannot find appropriate C compiler on this system.  
Please specify one using environment variable CC.  
See cmake_bootstrap.log for compilers attempted.  
  
---------------------------------------------  
Log of errors: /usr/local/src/cmake-2.8.4/Bootstrap.cmk/cmake_bootstrap.log  
---------------------------------------------  
报错:缺少C的编译器。
 
安装gcc编译器
可以从Linux系统的安装盘中安装,也可以简单地用yum安装
 
[root@localhost ~]#  yum install gcc  
 
继续cmake的安装
 
[root@localhost cmake-2.8.4]#  ./bootstrap   
---------------------------------------------  
CMake 2.8.4, Copyright 2000-2009 Kitware, Inc.  
C compiler on this system is: cc   
---------------------------------------------  
Error when bootstrapping CMake:  
Cannot find appropriate C++ compiler on this system.  
Please specify one using environment variable CXX.  
See cmake_bootstrap.log for compilers attempted.  
---------------------------------------------  
Log of errors: /usr/local/src/cmake-2.8.4/Bootstrap.cmk/cmake_bootstrap.log  
---------------------------------------------  
再次报错:缺少C++编译器。
 
安装gcc-c++编译器
同样可以从Linux系统的安装盘中安装,或者简单地用yum安装
 
[root@localhost ~]#  yum install gcc-c++  
 
重复上面的操作
 
[root@localhost cmake-2.8.4]#  ./bootstrap   
 
没有报错后,编译安装
 
[root@localhost cmake-2.8.4]#  gmake  
[root@localhost cmake-2.8.4]#  gmake install  
 
开始正式安装Mysql
====================================================================
 
二. 安装 cmake
cd /usr/local/src
tar zxvf cmake-2.8.7.tar.gz
cd cmake-2.8.7
./bootstrap
gmake
gmake install

检查安装 which cmake看结果可知安装是否正确

你可能感兴趣的:(Make)