在CentOS 6.3中安裝與配置cmake

來源:互聯網
上載者:User

標籤:style   http   os   io   使用   ar   檔案   div   sp   

安裝說明
安裝環境:CentOS-6.3
安裝方式:源碼編譯安裝
軟體:cmake-2.8.10.2.tar.gz
:http://www.cmake.org/cmake/resources/software.html

安裝前提
系統中已經安裝了g++和ncurses-devel,如果沒有安裝使用下面的命令安裝:

 

複製代碼代碼如下:
[[email protected] /]# yum install gcc-c++
[[email protected] /]# yum install ncurses-devel

 

安裝cmake
將cmake-2.8.10.2.tar.gz檔案上傳到/usr/local中執行以下操作:

 

複製代碼代碼如下:
[[email protected]]# cd /usr/local
[[email protected]]# tar -zxv -f cmake-2.8.10.2.tar.gz // 解壓壓縮包
[[email protected]]# rm -rf cmake-2.8.10.2.tar.gz // 刪除壓縮包
[[email protected]]# cd cmake-2.8.10.2
[[email protected] cmake-2.8.10.2]# ./configure
[[email protected] cmake-2.8.10.2]# make
[[email protected] cmake-2.8.10.2]# make install
[[email protected]]# mv cmake-2.8.10.2 cmake // 修改檔案夾名

 

添加環境變數
用vi在檔案/etc/profile檔案中增加變數,使其永久有效:
[[email protected]]# vi /etc/profile   // 修改環境變數

在檔案末尾追加以下兩行代碼:

複製代碼代碼如下:
PATH=/usr/local/cmake/bin:$PATH
export PATH

 

然後執行以下操作:

複製代碼代碼如下:
[[email protected]]# source /etc/profile //使修改生效
[[email protected]]# echo $PATH //查看PATH值

 

檢驗cmake安裝

複製代碼代碼如下:
[[email protected]]# cmake --version
cmake version 2.8.10.2


出現以上提示資訊,說明安裝成功了。

在CentOS 6.3中安裝與配置cmake

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.