- 使用PuTTY工具,以root用户登录服务器。
- 执行以下命令解压NETCDF安装包。
tar -xvf netcdf-4.4.1.1.tar.gz
- 执行以下命令进入解压后的目录。
cd netcdf-4.4.1.1
- 设置编译前的环境变量。
export CPPFLAGS="-I/path/to/HDF5/include -I/path/to/PNETCDF/include"
export LDFLAGS="-L/path/to/HDF5/lib -L/path/to/PNETCDF/lib -Wl,-rpath=/path/to/HDF5/lib"
export CFLAGS="-L/path/to/HDF5/lib -L/path/to/PNETCDF/lib - I/path/to/HDF5/include"
- 执行以下命令进行配置。
./configure --prefix=/path/to/NETCDF --build=aarch64-unknown-linux-gnu --enable-shared --enable-netcdf-4 --enable-dap --with-pic --disable-doxygen --enable-static --enable-pnetcdf --enable-largefile
- 执行以下命令进行安装编译。
make -j 16
make install