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

#### 操作步骤

1. 使用PuTTY工具，以root用户登录服务器。
2. 执行以下命令创建安装目录。

```
mkdir -p
/path/to/pnetcdf
```


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

```
cd
/path/to/pnetcdf
```


4. 执行以下命令获取pnetcdf源码包。

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


5. 执行以下命令解压源码并进入源码目录。

```
tar -zxvf
pnetcdf-1.11.2.tar.gz
cd
pnetcdf-1.11.2/
```


6. 执行以下命令配置。

```
export CC=mpicc CXX=mpicxx FC=mpifort
./configure --prefix=
/path/to/pnetcdf
--enable-shared --enable-fortran --enable-large-file-test
FFLAGS="-fallow-argument-mismatch"
FCFLAGS="-fallow-argument-mismatch"
```


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

```
make -j16
make install
```


8. 执行以下命令配置环境变量。

```
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
```
