zoukankan      html  css  js  c++  java
  • Centos7安装cmake3

    Centos7安装cmake3

    前期准备
    • openssl-devel已安装
    • cmake3.1以上已安装 下载地址

    下载方式说明:

    wget https://github.com/Kitware/CMake/releases/download/v3.20.2/cmake-3.20.2.tar.gz

    安装cmake(编译环境云安装):由于版本低不适合

    yum下载安装包

    [root@localhost cmake]# yum install --downloadonly --downloaddir=/home/tmp cmake
    

    rpm安装

    [root@localhost cmake]# rpm -qa | grep cmake
    [root@localhost cmake]# rpm -ivh cmake-2.8.12.2-2.el7.x86_64.rpm 
    warning: cmake-2.8.12.2-2.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID : NOKEY
    Preparing...                          ################################# [100%]
    Updating / installing...
       1:cmake-2.8.12.2-2.el7             ################################# [100%]
    [root@localhost cmake]# 
    

    查看安装版本

    [root@localhost cmake]# cmake --version
    cmake version 2.8.12.2
    [root@localhost cmake]# 
    

    安装openssl-devel(编译环境云安装)

    yum下载安装包

    [root@localhost openssl-devel]# rpm -qa | grep openssl-devel 
    [root@localhost openssl-devel]# yum install --downloadonly --downloaddir=/home/tmp openssl-devel
    [root@localhost openssl-devel]# ls
    e2fsprogs-1.42.9-19.el7.x86_64.rpm          krb5-workstation-1.15.1-50.el7.x86_64.rpm  libselinux-devel-2.5-15.el7.x86_64.rpm   libss-1.42.9-19.el7.x86_64.rpm            pcre-devel-8.32-17.el7.x86_64.rpm
    e2fsprogs-libs-1.42.9-19.el7.x86_64.rpm     libcom_err-1.42.9-19.el7.x86_64.rpm        libselinux-python-2.5-15.el7.x86_64.rpm  libverto-devel-0.2.5-4.el7.x86_64.rpm     zlib-1.2.7-19.el7_9.x86_64.rpm
    keyutils-libs-devel-1.5.8-3.el7.x86_64.rpm  libcom_err-devel-1.42.9-19.el7.x86_64.rpm  libselinux-utils-2.5-15.el7.x86_64.rpm   openssl-1.0.2k-21.el7_9.x86_64.rpm        zlib-devel-1.2.7-19.el7_9.x86_64.rpm
    krb5-devel-1.15.1-50.el7.x86_64.rpm         libkadm5-1.15.1-50.el7.x86_64.rpm          libsepol-2.5-10.el7.x86_64.rpm           openssl-devel-1.0.2k-21.el7_9.x86_64.rpm
    krb5-libs-1.15.1-50.el7.x86_64.rpm          libselinux-2.5-15.el7.x86_64.rpm           libsepol-devel-2.5-10.el7.x86_64.rpm     openssl-libs-1.0.2k-21.el7_9.x86_64.rpm
    [root@localhost openssl-devel]# 
    
    

    rpm安装

    [root@localhost openssl-devel]# rpm -iUvh *
    warning: e2fsprogs-1.42.9-19.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID : NOKEY
    Preparing...                          ################################# [100%]
    Updating / installing...
       1:libcom_err-1.42.9-19.el7         ################################# [  3%]
       2:zlib-1.2.7-19.el7_9              ################################# [  5%]
       3:libsepol-2.5-10.el7              ################################# [  8%]
       4:libselinux-2.5-15.el7            ################################# [ 11%]
       5:openssl-libs-1:1.0.2k-21.el7_9   ################################# [ 14%]
       6:krb5-libs-1.15.1-50.el7          ################################# [ 16%]
       7:libkadm5-1.15.1-50.el7           ################################# [ 19%]
       8:libss-1.42.9-19.el7              ################################# [ 22%]
       9:libsepol-devel-2.5-10.el7        ################################# [ 24%]
      10:zlib-devel-1.2.7-19.el7_9        ################################# [ 27%]
      11:e2fsprogs-libs-1.42.9-19.el7     ################################# [ 30%]
      12:libcom_err-devel-1.42.9-19.el7   ################################# [ 32%]
      13:pcre-devel-8.32-17.el7           ################################# [ 35%]
      14:libselinux-devel-2.5-15.el7      ################################# [ 38%]
      15:libverto-devel-0.2.5-4.el7       ################################# [ 41%]
      16:keyutils-libs-devel-1.5.8-3.el7  ################################# [ 43%]
      17:krb5-devel-1.15.1-50.el7         ################################# [ 46%]
      18:openssl-devel-1:1.0.2k-21.el7_9  ################################# [ 49%]
      19:e2fsprogs-1.42.9-19.el7          ################################# [ 51%]
      20:krb5-workstation-1.15.1-50.el7   ################################# [ 54%]
      21:openssl-1:1.0.2k-21.el7_9        ################################# [ 57%]
      22:libselinux-python-2.5-15.el7     ################################# [ 59%]
      23:libselinux-utils-2.5-15.el7      ################################# [ 62%]
    Cleaning up / removing...
      24:krb5-workstation-1.15.1-8.el7    ################################# [ 65%]
      25:openssl-1:1.0.2k-8.el7           ################################# [ 68%]
      26:e2fsprogs-1.42.9-10.el7          ################################# [ 70%]
      27:libkadm5-1.15.1-8.el7            ################################# [ 73%]
      28:openssl-libs-1:1.0.2k-8.el7      ################################# [ 76%]
      29:krb5-libs-1.15.1-8.el7           ################################# [ 78%]
      30:libselinux-utils-2.5-11.el7      ################################# [ 81%]
      31:e2fsprogs-libs-1.42.9-10.el7     ################################# [ 84%]
      32:libss-1.42.9-10.el7              ################################# [ 86%]
      33:libselinux-python-2.5-11.el7     ################################# [ 89%]
      34:libselinux-2.5-11.el7            ################################# [ 92%]
      35:libsepol-2.5-6.el7               ################################# [ 95%]
      36:libcom_err-1.42.9-10.el7         ################################# [ 97%]
      37:zlib-1.2.7-17.el7                ################################# [100%]
    [root@localhost openssl-devel]# 
    [root@localhost openssl-devel]# rpm -qa | grep openssl-devel 
    openssl-devel-1.0.2k-21.el7_9.x86_64
    [root@localhost openssl-devel]# 
    

    安装cmake(编译环境安装)

    解压

    [root@localhost cmake]# tar -xvf cmake-3.20.2.tar.gz
    

    指定安装路径

    默认安装在 /usr/local/bin 下面
    [root@localhost cmake]# cd cmake-3.20.2
    [root@localhost cmake]# ./bootstrap --prefix=/home/testuser/cmake/cmake
    

    若出现以下问题,需安装openssl-devel (Centos系统)或 libssl-dev(ubuntu系统)

    -- 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:511 (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 "/home/testuser/cmake/cmake-3.20.2/CMakeFiles/CMakeOutput.log".
    See also "/home/testuser/cmake/cmake-3.20.2/CMakeFiles/CMakeError.log".
    ---------------------------------------------
    Error when bootstrapping CMake:
    Problem while running initial CMake
    
    

    编译安装

    [root@localhost cmake]# gmake
    [root@localhost cmake]# gmake install
    

    建立软链接

    [root@localhost cmake]# ln -s /home/testuser/cmake/cmake/bin/cmake /usr/bin/cmake
    

    查看安装版本

    [root@localhost cmake-3.20.2]# cmake --version
    cmake version 3.20.2
    
    CMake suite maintained and supported by Kitware (kitware.com/cmake).
    [root@localhost cmake-3.20.2]# 
    
    
  • 相关阅读:
    第七周-学习进度条
    《梦断代码》阅读笔记01
    第六周-学习进度条
    构建之法阅读笔记03
    结对项目开发(石家庄地铁乘车系统)
    第五周-学习进度条
    第四周-学习进度条
    HDU--1272 小希的迷宫(并查集判环与联通)
    HDU--1856 More is better(简单带权并查集)
    HDU--3635 带权并查集
  • 原文地址:https://www.cnblogs.com/code-red-memory/p/14814248.html
Copyright © 2011-2022 走看看