Centos下升级cmake的版本

在CentOS上利用cmake编译时提示版本过低,在利用yum remove cmake -y移除原来版本后,现将安装指定版本cmake的方法整理如下:

  • 输入指定版本的cmake
wget https://github.com/Kitware/CMake/releases/download/v3.17.1/cmake-3.17.1.tar.gz

  • 解压
tar -xvf cmake-3.17.1.tar.gz

  • 进行配置(./bootstrap 等同于 ./configure)
./bootstrap
---------------------------------------------
CMake 3.17.1, Copyright 2000-2020 Kitware, Inc. and Contributors
---------------------------------------------
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: /home/centos/cmake-3.17.1/Bootstrap.cmk/cmake_bootstrap.log
---------------------------------------------

提示缺少gcc

sudo yum install gcc

再次配置提示缺少gcc-c++,同样的解决方法

---------------------------------------------
CMake 3.17.1, Copyright 2000-2020 Kitware, Inc. and Contributors
C compiler on this system is: cc   
---------------------------------------------
Error when bootstrapping CMake:
Cannot find a C++ compiler that supports both C++11 and the specified C++ flags.
Please specify one using environment variable CXX.
The C++ flags are "".
They can be changed using the environment variable CXXFLAGS.
See cmake_bootstrap.log for compilers attempted.
---------------------------------------------
Log of errors: /usr/local/LevelDB/cmake-3.17.1/Bootstrap.cmk/cmake_bootstrap.log
---------------------------------------------
sudo yum install gcc-c++

  再次配置提示缺少make

---------------------------------------------
CMake 3.17.1, Copyright 2000-2020 Kitware, Inc. and Contributors
Found GNU toolchain
C compiler on this system is: gcc   
C++ compiler on this system is: g++  -std=gnu++1y  
---------------------------------------------
Error when bootstrapping CMake:
Cannot find appropriate Makefile processor on this system.
Please specify one using environment variable MAKE.
---------------------------------------------
Log of errors: /usr/local/LevelDB/cmake-3.17.1/Bootstrap.cmk/cmake_bootstrap.log
---------------------------------------------

  再次配置提示缺少OpenSSL

---------------------------------------------
gmake: “cmake”是最新的。
loading initial cache file /usr/local/LevelDB/cmake-3.17.1/Bootstrap.cmk/InitialCacheFlags.cmake
-- Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR (missing: OPENSSL_CRYPTO_LIBRARY OPENSSL_INCLUDE_DIR) 
CMake Error at Utilities/cmcurl/CMakeLists.txt:454 (message):
  Could not find OpenSSL.  Install an OpenSSL development package or
  configure CMake with -DCMAKE_USE_OPENSSL=OFF to build without OpenSSL.


-- Configuring incomplete, errors occurred!
See also "/usr/local/LevelDB/cmake-3.17.1/CMakeFiles/CMakeOutput.log".
See also "/usr/local/LevelDB/cmake-3.17.1/CMakeFiles/CMakeError.log".
---------------------------------------------
Error when bootstrapping CMake:
Problem while running initial CMake
---------------------------------------------

 

  通过gmake 编译安装

sudo gmake

  最后一步

sudo gmake install

  • 查看当前cmake版本 
 cmake -version

 

 

  • 2
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值