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

Upgrading CMake

The built-in CMake software on the OS does not meet the compilation requirements on ONNX Runtime 1.19.2. Upgrade CMake to 3.26.0 or later. The following uses CMake 3.30.0 as an example.

  1. Download CMake 3.30.0 and upload it to the /home directory on the server.
    URL: https://cmake.org/files/v3.30/cmake-3.30.0.tar.gz

    If the server is connected to the Internet, you can run the wget command to download the installation package.

    cd /home
    wget https://cmake.org/files/v3.30/cmake-3.30.0.tar.gz --no-check-certificate
  2. Decompress the package.
    tar -zxvf cmake-3.30.0.tar.gz
  3. Go to the decompressed CMake directory.
    cd cmake-3.30.0
  4. Upgrade CMake.
    ./bootstrap

    make -j 16

    The -j 16 option leverages the multiple cores of the CPU to accelerate the compilation. The number following -j indicates the number of CPU cores, which can be queried by running the following command. The parameter of -j must be less than or equal to the number of CPU cores.

    cat /proc/cpuinfo | grep processor | wc -l
    make install

  5. Clear the cache.
    hash -r
  6. Check whether the CMake version is 3.30.0.
    /usr/local/bin/cmake --version

    If the following information is displayed, the upgrade is successful.