Installation environment: CentOS-6.3
Installation method: source code compilation and installation
Software: cmake-2.8.10.2.tar.gz
Download link: http://www.cmake.org/cmake/resources/software.html
G++ and ncurses-devel have been installed in the system, if not installed, use the following command to install:
[ root@admin /]# yum install gcc-c++[root@admin /]# yum install ncurses-devel |
---|
Upload the cmake-2.8.10.2.tar.gz file to /usr/local and perform the following operations:
[ root@admin local]# cd /usr/local[root@admin local]# tar -zxv -f cmake-2.8.10.2.tar.gz // Unzip the compressed package [root@admin local]# rm -rf cmake-2.8 .10.2.tar.gz // Delete the compressed package [root@admin local]# cd cmake-2.8.10.2[root@localhost cmake-2.8.10.2]# ./configure[root@localhost cmake-2.8.10.2]# make [root@localhost cmake-2.8.10.2]# make install[root@admin local]# mv cmake-2.8.10.2 cmake // modify folder name |
---|
Use vi to add variables in the file /etc/profile to make it permanent:
[ root@admin local]# vi /etc/profile // Modify environment variables |
---|
Append the following two lines of code at the end of the file:
PATH=/usr/local/cmake/bin:$PATHexport PATH |
---|
Then do the following:
[ root@admin local]# source /etc/profile //Make the modification effective [root@admin local]# echo $PATH //View the PATH value |
---|
[ root@admin local]# cmake --versioncmake version 2.8.10.2 |
---|
Congratulations, the installation was successful.
Solution: (it seems to work too)
yum install cmake -y
Recommended Posts