• centos7 中 升级cmake


    001、

    (base) [root@pc1 build]# cat /etc/redhat-release    ## 系统
    CentOS Linux release 7.6.1810 (Core)
    (base) [root@pc1 build]# cmake --version     ## 当前cmake版本
    cmake version 2.8.12.2

    002、卸载当前版本

     yum remove cmake -y

    003、安装需要的模块

    yum install -y libxml2 libxml2-devel bzip2 bzip2-devel libcurl libcurl-devel libjpeg libjpeg-devel zstd libzstd-devel curl libpng libpng-devel

    004、下载安装包

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

    005、解压、编译

    tar -xzvf cmake-3.24.1.tar.gz
    cd cmake-3.24.1/
    mkdir cmake-3.24.1-build
    cd cmake-3.24.1-build/
    ../configure --prefix=/usr/local/cmake-3.24.1
    gmake -j2
    gmake install

    006、配置环境变量

    touch /etc/profile.d/cmake.sh
    chmod 777 /etc/profile.d/cmake.sh
    echo -e '\nexport PATH=/usr/local/cmake-3.24.1/bin:$PATH\n' >> /etc/profile.d/cmake.sh
    source /etc/profile.d/cmake.sh

    007、测试配置效果

    (base) [root@pc1 bin]# cmake --version
    cmake version 3.24.1
    
    CMake suite maintained and supported by Kitware (kitware.com/cmake).
  • 相关阅读:
    bzoj3653: 谈笑风生
    bzoj1858: [Scoi2010]序列操作
    bzoj1857: [Scoi2010]传送带
    bzoj1856: [Scoi2010]字符串
    bzoj1855: [Scoi2010]股票交易
    bzoj1854: [Scoi2010]游戏
    bzoj1853: [Scoi2010]幸运数字
    斜堆,非旋转treap,替罪羊树
    NOI2003 文本编辑器
    A_star poj2449 k短路
  • 原文地址:https://www.cnblogs.com/liujiaxin2018/p/16791683.html
Copyright © 2020-2023  润新知