Install and configure the latest cmake tool in centos 6.5

Source: Internet
Author: User

Install and configure the latest cmake tool in centos 6.5

1. What is cmake?

CMake is a cross-platform installation (Compilation) tool. You can use simple statements to describe the installation (compilation process) of all platforms ). He can output a variety of makefiles or project files and test the C ++ features supported by the compiler, similar to automake in UNIX. CMake can compile source code, create a program library, generate an adapter (wrapper), and construct an execution file in any order. CMake supports in-place Construction (the binary file and the source code are in the same directory tree) and out-of-place Construction (the binary file is in another directory ), therefore, it is easy to construct multiple binary files from the same source code directory tree. CMake also supports static and dynamic library construction.

"CMake" is short for "cross platform make. Although the name contains "make", the common "make" systems on CMake and Unix are separated and higher.

Ii. Install the cmake tool:

0. Use the yum command to install the GCC development kit and Development Library

Yum-y groupinstall "Development Tools"

1. Download the source code installation package: cmake-3.6.0.tar.gz (: https://cmake.org/files/v3.6/cmake-3.6.0.tar.gz)

Or run the command wgethttps: // cmake.org/files/v3.6/cmake-3.6.0.tar.gz.

2. Create a user name and group

Groupadd-g 501 train

Useradd-gtrain-u 501-m operation

3. Switch to the operation user and create the bak file directory

Su-operation

Mkdir bak

Paths] to the/home/operation/bak directory

Cd back

Rz

5. Use the exit command to exit as the root user, and then run the cd command to enter the bak directory. [Here we use the root user to install the cmake tool]

Exit

Cd bak

6.decompress the cmake-3.6.0.tar.gz source code package using the tarcommand.

Tar-xzvf cmake-3.6.0.tar.gz

6. Use the cd command to enter the cmake-3.6.0 directory, and then use the ll command to view the file content under the cmake-3.6.0 directory

Cd cmake-3.6.0

Ll

7. Configure, compile, and install cmake

// The first step of source code installation is to configure the software to be installed and check whether the current environment meets the dependency of the software to be installed, however, not all tar packages are source code packages. You can use ls to check if there is any configure file. Maybe you have a binary package. If it is a binary package, decompress the package and use it directly.

./Configure

// Compile according to the content specified in Makefile. The generated executable file is stored in the current directory or a subdirectory.

Make

// Install the file generated by make in the system directory

Make install

8. Use the vi command to add a variable to the/etc/profile file to make it permanently valid.

Vi/etc/profile

9. Add three lines of code at the end of the file.

# Cmake tools

PATH =/home/Opera/cmake-3.6.0/bin: $ PATH

Export PATH

10. Run the source command to make the modified file take effect. Then run the echo command to view the PATH value.

Source/etc/profile

Echo $ PATH

11. Check whether cmake is successfully installed. If the following information is displayed, congratulations. cmake has been installed successfully!

Cmake -- version

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.