我要评分
获取效率
正确性
完整性
易理解

Upgrading CMake

The built-in CMake software on the OS does not meet the compilation requirements on the current database. Upgrade CMake to 3.4.3 or later. As an example, the following procedure describes how to upgrade CMake to 3.5.2.

  1. Download CMake 3.5.2 and upload it to the /home directory on the server.

    https://cmake.org/files/v3.5/cmake-3.5.2.tar.gz

    If the server is connected to the Internet, you can run the wget command to download the installation package.
    1
    2
    cd /home
    wget https://cmake.org/files/v3.5/cmake-3.5.2.tar.gz --no-check-certificate
    
  2. Decompress the package.
    1
    tar -zxvf cmake-3.5.2.tar.gz
    

  3. Go to the CMake directory decompressed.
    1
    cd cmake-3.5.2
    
  4. Upgrade CMake.
    1
    ./bootstrap
    

    1
    make -j 96
    

    In the command, -j 96 can make full use of the multi-core feature of the CPUs to accelerate the compilation. The number following -j indicates the number of CPU cores. You can run the cat /proc/cpuinfo | grep processor | wc -l command to query the number of CPU cores. The value specified must be less than or equal to the actual number of CPU cores.

    1
    make install
    

  5. Check whether the CMake version is 3.5.2.
    1
    2
    hash -r
    /usr/local/bin/cmake --version