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

#### 操作步骤

1. 使用PuTTY工具，以root用户登录服务器。
2. 执行以下命令解压文件。

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


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

```
cd netcdf-fortran-4.4.1
```


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

```
./configure --prefix=
/path/to/NETCDF
CPPFLAGS="-I
/path/to/HDF5
/include -I
/path/to/NETCDF
/include" LDFLAGS="-L
/path/to/HDF5
/lib -L
/path/to/NETCDF
/lib" --build=aarch64-unknown-linux-gnu --enable-fortran --enable-static=yes --enable-parallel --enable-shared CFLAGS="-O3 -fPIC -Wno-incompatible-pointer-types-discards-qualifiers -Wno-non-literal-conversion" FCFLAGS="-O3 -fPIC" LDFLAGS="-Wl,--build-id" --enable-fortran --enable-parallel CC=mpicc FC=mpif90 CXX=mpicxx
```


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

  a. 打开“libtool”文件。

```
vi libtool
```


  b. 按“i”进入编辑模式，修改“libtool”文件中第11838行的内容。

```
wl='-Wl,'
```


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

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

```
make -j
make install
```
