- 使用PuTTY工具,以root用户登录服务器。
- 执行以下命令解压NETCDF-C安装包。
tar -zxvf netcdf-c-4.7.4.tar.gz
- 执行以下命令进入解压后的目录。
cd netcdf-c-4.7.4
export CPPFLAGS="-I/path/to/HDF5/include -I/path/to/PNETCDF/include -I/path/to/CURL/include"
export LDFLAGS="-L/path/to/HDF5/lib -L/path/to/PNETCDF/lib -L/path/to/CURL/lib -Wl,-rpath=/path/to/HDF5/lib -Wl,-rpath=/path/to/PNETCDF/lib -Wl,-rpath=/path/to/CURL/lib"
export CFLAGS="-O3 -fPIC -Wno-incompatible-pointer-types-discards-qualifiers -Wno-non-literal-null-conversion"
- 执行以下命令进行配置。
./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 CC=mpicc CXX=mpicxx FC=mpifort F77=mpifort F90=mpifort
- 执行以下命令进行编译安装。
make -j 64
make install
- 执行以下命令加载环境变量。
export PATH=/path/to/NETCDF/bin:$PATH
export LD_LIBRARY_PATH=/path/to/NETCDF/lib:$LD_LIBRARY_PATH