---
title: 安装CMake
description: "1. 使用PuTTY工具，以root用户登录服务器。"
url: https://www.hikunpeng.com/document/detail/zh/kunpenghpcs/hpcindapp/prtg-osc/kunpengdiamond_02_0005.html
sourcePath: /source/zh/kunpenghpcs/hpcindapp/prtg-osc/kunpengdiamond_02_0005.html
indexId: d34703f8c0de5c8744c816c3cd7ec940f22a29b6b2363691cd7005e6953cc2d769
---
# 安装CMake

#### 操作步骤

1. 使用PuTTY工具，以root用户登录服务器。
2. 执行以下命令，解压CMake安装包。
  tar zxvf cmake-3.17.3.tar.gz

3. 执行以下命令，进入解压后的目录。
  cd cmake-3.17.3

4. 执行以下命令，进行配置。
  ./configure --prefix=/path/to/CMAKE

5. 执行以下命令，进行编译安装。
  make

  make install

6. 执行以下命令，设置CMake环境变量。
  export PATH=/path/to/CMAKE/bin:$PATH
