centos下cmake下安装

2015/07/25 12:49
阅读数 2.9K
编译安装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 src]# mkdir /usr/local/cmake

[root @localhost cmake-2.8.4]#  ./bootstrap     --prefix=/usr/local/cmake
---------------------------------------------  
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     --prefix=/usr/local/cmake
---------------------------------------------  
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    --prefix=/usr/local/cmake

还需要安装make        

  [root@localhost cmake-2.8.4]# yum install make

 [root@localhost cmake-2.8.4]#  ./bootstrap    --prefix=/usr/local/cmake


  没有报错后,编译安装


[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看结果可知安装是否正确
展开阅读全文
打赏
0
0 收藏
分享
加载中
更多评论
打赏
0 评论
0 收藏
0
分享
返回顶部
顶部