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

#### 操作步骤

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

```
tar -zxvf netcdf-fortran-4.4.5.tar.gz
```


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

```
cd netcdf-fortran-4.4.5
```


4. 执行以下命令进行编译配置。

```
./configure --prefix=
/path/to/NETCDF
--enable-shared --with-pic --disable-doxygen --enable-largefile --enable-static CC=mpicc CXX=mpicxx FC=mpifort F77=mpifort F90=mpifort CFLAGS="-O3 -fPIC -Wno-incompatible-pointer-types-discards-qualifiers -Wno-non-literal-null-conversion" CXXFLAGS="-O3 -fPIC -Wno-incompatible-pointer-types-discards-qualifiers" FCFLAGS="-O3 -fPIC" FFLAGS="-O3 -fPIC"
```


5. 修改当前文件夹下的“libtool”文件。

  a. 打开“libtool”文件。

```
vi libtool
```


  b. 按“i”进入编辑模式，修改文件中所有的wl=""。

```
wl="-Wl,"
```


    执行5.a之后，按“Esc”键，输入“:set nu”，按“Enter”即可显示出行号。

  c. 按“Esc”键，输入:wq!，按“Enter”保存并退出编辑。
6. 执行以下命令进行编译安装。

```
make
make install
```
