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