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

#### 操作步骤

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

```
mkdir -p
/path/to/hdf-eos2
```


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

```
cd
/path/to/hdf-eos2
```


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

```
wget https://git.earthdata.nasa.gov/rest/git-lfs/storage/DAS/hdfeos/cb0f900d2732ab01e51284d6c9e90d0e852d61bba9bce3b43af0430ab5414903?response-content-disposition=attachment%3B%20filename%3D%22HDF-EOS2.20v1.00.tar.Z%22%3B%20filename*%3Dutf-8%27%27HDF-EOS2.20v1.00.tar.Z
```


5. 执行以下命令更改源码包名并解压。

```
cp -f cb0f900d2732ab01e51284d6c9e90d0e852d61bba9bce3b43af0430ab5414903* HDF-EOS2.20v1.00.tar
tar -xvf HDF-EOS2.20v1.00.tar
```


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

```
cd hdfeos/
```


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

```
export CC=gcc CXX=g++ FC=gfortran
export HDF4_PATH=
/path/to/hdf4
export LIBJPEG_PATH=
/path/to/libjpeg
ac_cv_func_malloc_0_nonnull=yes ac_cv_func_realloc_0_nonnull=yes ./configure --prefix=
/path/to/hdf-eos2
--with-hdf4=${HDF4_PATH} --with-jpeg=${LIBJPEG_PATH} --with-zlib=/usr/lib64  --build=aarch64-unknown-linux-gnu
```


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

```
make -j 16
```

```
make install
```

```
cp -r
include/
/path/to/hdf-eos2
```


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

```
export LIBRARY_PATH=
/path/to/hdf-eos2
/lib:$LIBRARY_PATH
export LD_LIBRARY_PATH=
/path/to/hdf-eos2
/lib:$LD_LIBRARY_PATH
export INCLUDE
=/path/to/hdf-eos2
/include:$INCLUDE
```
