Since tars needs to be installed, CMake support is required, and the default version of CMake under Centos7 is too old and needs to be uninstalled and re-installed.

  1. Uninstall CMake
yum -y remove cmake
Copy the code
  1. Go to the official website to download the required version

    I downloaded the latest version 3.19.2

Wget HTTP: / / https://github.com/Kitware/CMake/releases/download/v3.19.2/cmake-3.19.2.tar.gzCopy the code
  1. Unzip the download
The tar XVF cmake - 3.19.2. Tar. GzCopy the code
  1. After decompressing, go to the directory and execute bootstarp, which takes three or four minutes
./bootstrap
Copy the code

This command may cause errors. Could not find OpenSSL. Install an OpenSSL development package or configure CMake with -dcmake_use_openssl =OFF to build without OpenSSL.

At this point, we just need to follow the prompts to install the required plug-ins

Yum -y install ncurses-devel yum install openssl-develCopy the code
  1. Run the gmake command

An error may occur when executing the gmake command: gmake: *** No target is specified and the makefile cannot be found. Stop.

The reason for my appearance is that the GCC version is too old. The default GCC version for centos7 is 4.8. Delete GCC and reinstall the new version.

You can use the wget command to download it from the official website, but it is slow. Here’s a recommended website.

https://blog.csdn.net/zhangpeterx/article/details/96141900
Copy the code

I will directly install the version of GCC9

Yum install centos-release-scl yum install devtoolset-9-gcc* / --versionCopy the code

After the installation is complete, gmake can be executed. You need to wait for a while.

  1. Run the gmake install command
gmake install
Copy the code
  1. Checking the Installed Version

Run the cmake-version command to check the version and determine whether the installation is successful.