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

#### 操作步骤

1. 使用PuTTY工具，以root用户登录服务器。
2. （可选）用户根据实际情况选择是否配置虚拟环境。

```
pip install virtualenv
virtualenv phono3py
source phono3py/bin/activate
```


3. 执行以下命令，进入源码包目录并解压软件包。

```
cd
/path/to/PHONO3PY
&& tar -zxf v2.3.2.tar.gz
```


4. 执行以下命令安装Python依赖。

```
pip3 install numpy
pip3 install scipy
pip3 install phonopy
```


5. 执行以下命令添加配置文件。

```
cd phono3py-2.3.2/
echo "[phono3py]" > site.cfg
echo "extra_compile_args = -fopenmp" >> site.cfg
echo "extra_link_args = -lgomp" >> site.cfg
```


6. 执行以下命令引入OpenBLAS头文件配置。

```
export C_INCLUDE_PATH=
/path/to/OPENBLAS
/openblas
/include
export CPLUS_INCLUDE_PATH=
/path/to/OPENBLAS
/openblas
/include
```


7. 执行以下命令安装Phono3py。

```
python3 setup.py install
```
