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

#### 操作步骤

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

```
tar -xvf cmake-3.8.1.tar.gz
```


3. 执行以下命令进入解压后的目录。

```
cd CMake-3.8.1
```


4. 执行以下命令进行编译安装。

```
./bootstrap --prefix=/path/to/CMAKE
make -j 16
make install
```


5. 执行以下命令设置CMake环境变量。

```
export PATH=/path/to/CMAKE/bin:$PATH
```
