安装NETCDF-C

操作步骤

  1. 使用PuTTY工具,以root用户登录服务器。
  2. 执行以下命令安装NETCDF-C。

    export PATH=/path/to/GNU/bin:/path/to/OPENMPI/bin:$PATH
    export LD_LIBRARY_PATH=/path/to/GNU/lib64:/path/to/OPENMPI/lib:$LD_LIBRARY_PATH
    tar -xvf netcdf-c-4.4.1.1.tar.gz
    cd netcdf-c-4.4.1.1
    mkdir -p /path/to/NETCDF
    ./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 CPPFLAGS="-I/path/to/HDF5/include -I/path/to/PNETCDF/include" LDFLAGS="-L/path/to/HDF5/lib -L/path/to/PNETCDF/lib -Wl,-rpath=/path/to/HDF5/lib -Wl,-rpath=/path/to/PNETCDF/lib" CFLAGS="-L/path/to/HDF5/lib -L/path/to/PNETCDF/lib -I/path/to/HDF5/include -I/path/to/PNETCDF/include"
    make -j 16
    make install

    如果此前已经声明过编译器和MPI的环境变量,本步骤前两条声明环境变量的命令可省略。