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

#### 操作步骤

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

```
cd /path/to
wget http://cucis.ece.northwestern.edu/projects/PnetCDF/Release/pnetcdf-1.11.2.tar.gz
tar xf pnetcdf-1.11.2.tar.gz
```


3. 执行以下命令进入源码目录并安装。

```
cd pnetcdf-1.11.2
CC=mpicc CXX=mpicxx FC=mpif90 F77=mpif90 ./configure --prefix=/path/to/pnetcdf --enable-shared --enable-fortran --enable-large-file-test
make -j 64
make install
```


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

```
export PATH=/path/to/pnetcdf/bin:$PATH
export LD_LIBRARY_PATH=/path/to/pnetcdf/lib:$LD_LIBRARY_PATH
export INCLUDE=/path/to/pnetcdf/include:$INCLUDE
```
