---
title: 编译和安装
description: "1. 执行以下命令解压安装包。"
url: https://www.hikunpeng.com/document/detail/zh/kunpenghpcs/hpcindapp/prtg-osc/kylin_kunpeng_darshan_342_02_0006.html
sourcePath: /source/zh/kunpenghpcs/hpcindapp/prtg-osc/kylin_kunpeng_darshan_342_02_0006.html
indexId: 90dee17a5485e036b5fa592a067180ea59c822b2da4e9bab74a05e2eeb4933c880
---
# 编译和安装

#### 操作步骤

1. 执行以下命令解压安装包。

```
cd
/path/to/Darshan
tar xf
darshan-3.4.2.tar.gz
c
d darshan-3.4.2
```


2. 执行以下命令生成makefile。

```
./prepare.sh
cd darshan-runtime
./configure --with-log-path=./darshan-logs --enable-group-readable-logs --with-jobid-env=PBS_JOBID --prefix=
/path/to/Darshan
CC=mpicc
```


3. 执行以下命令编译安装darshan-runtime。

```
make
make install
```


4. 执行以下命令编译安装darshan-util。

```
cd ../
darshan-util
./configure --enable-shared --prefix=
/path/to/Darshan
CC=mpicc
make
make install
```


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

```
export PATH=
/path/to/Darshan
/bin:$PATH
export LD_LIBRARY_PATH=
/path/to/Darshan
/lib:$LD_LIBRARY_PATH
```
