编译安装Cmake ;
- 首先下载CMAKE
[[email protected] src]# wget https://cmake.org/files/v3.3/cmake-3.3.2.tar.gz
[[email protected] src]# ls
cmake-3.3.2.tar.gz mysql-5.6.10.tar.gz
如果没有安装wget 工具,先 yum install wget -y 安装;
2.安装Cmake ;
[[email protected] src]# tar zxvf cmake-3.3.2.tar.gz #解压
[[email protected] src]# cd cmake-3.3.2 #进入解压目录
[[email protected] cmake-3.3.2]# ./bootstrap #执行安装脚本
---------------------------------------------
CMake 3.3.2, Copyright 2000-2015 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: /root/cmake-3.3.2/Bootstrap.cmk/cmake_bootstrap.log
---------------------------------------------
以上报错是缺少C语言编辑器;
安装gcc
[[email protected] cmake-3.3.2]# yum install gcc gcc-c++ -y
再继续安装
[[email protected] cmake-3.3.2]# ./bootstrap
此处省略 N 。。。。
-- Performing Test run_pic_test - Success
-- Performing Test run_inlines_hidden_test
-- Performing Test run_inlines_hidden_test - Success
-- Configuring done
-- Generating done
-- Build files have been written to: /root/cmake-3.3.2
---------------------------------------------
CMake has bootstrapped. Now run gmake.
[[email protected] cmake-3.3.2]# gmake
[[email protected] cmake-3.3.2]# gmake install
3.检查 ;
使用 which cmake 检查是否安装成功
[[email protected] cmake-3.3.2]# which cmake
/usr/local/bin/cmake
[[email protected] cmake-3.3.2]#
至此,Cmake 已安装完成;