- 使用PuTTY工具,以root用户登录服务器。
- 执行以下命令安装依赖包。
yum install -y curl libcurl-devel zlib-devel
- 执行以下命令解压NETCDF-C安装包。
tar -zxvf netcdf-c-4.7.0.tar.gz
- 执行以下命令进入解压后的目录。
cd netcdf-c-4.7.0
- 执行以下命令进行编译配置。
CC=mpicc CFLAGS="$optflags -I/path/to/HDF5/include -I/path/to/PNETCDF/include" LDFLAGS="$ldflags -L/opt/compiler/BS/bisheng-compiler-1.3.1-aarch64-linux/lib -L/path/to/HDF5/lib -L/path/to/PNETCDF/lib" ./configure --prefix=/path/to/NETCDF --build=aarch64-linux --enable-static --enable-shared --with-pic --enable-parallel-tests --enable-pnetcdf --enable-largefile --enable-large-file-tests --disable-dap

- 执行以下命令进行编译安装。
make -j$threads

make install

- 执行以下命令验证是否安装成功。
ls /path/to/NETCDF/bin
ls /path/to/NETCDF/lib

- 执行以下命令加载环境变量。
export PATH=/path/to/NETCDF/bin:$PATH
export LD_LIBRARY_PATH=/path/to/NETCDF/lib:$LD_LIBRARY_PATH