安装hdf4
操作步骤
- 使用PuTTY工具,以root用户登录服务器。
- 执行以下命令进入解压后的hdf4目录。
cd supplibs-2.2.1/src/hdf4
- 执行以下命令修改源码。
sed -i '1297c #if defined(__linux__) && defined __x86_64__ && !(defined SUN) || defined(__aarch64__)' hdf/src/hdfi.h
查看hdf/src/hdfi.h的第1297行,显示为如下内容即表示修改完成。
- 执行以下命令进行配置。
./configure --prefix=/path/to/hdf4 --build=aarch64-unknown-linux-gnu --enable-production --disable-fortran --enable-shared CFLAGS="-fPIC" CXXFLAGS="-fPIC -I/usr/include/tirpc" CPPFLAGS="-fPIC -I/usr/include/tirpc" LDFLAGS="-L/lib64 -ltirpc" --disable-netcdf
- 执行以下命令进行编译安装。
make clean make -j32 make install
- 执行以下命令配置环境变量。
export PATH=/path/to/hdf4/bin:$PATH export LD_LIBRARY_PATH=/path/to/hdf4/lib:$LD_LIBRARY_PATH export C_INCLUDE_PATH=/path/to/hdf4/include:$C_INCLUDE_PATH export CXX_INCLUDE_PATH=/path/to/hdf4/include:$CXX_INCLUDE_PATH
父主题: 配置编译环境