安装NETCDF-C

操作步骤

  1. 获取NETCDF-C源码包。

    下载地址:https://github.com/Unidata/netcdf-c/archive/refs/tags/v4.7.4.tar.gz

  1. 将源码包上传至服务器NETCDF-C源码包安装目录,如“/path/to/download/netcdf-c”。
  2. 执行以下命令进入源码包安装目录。

    cd /path/to/download/netcdf-c

  3. 执行以下命令解压软件包。

    tar -zxvf netcdf-c-4.7.4.tar.gz

  4. 执行以下命令进入configure脚本所在目录。

    cd netcdf-c-4.7.4

  5. 执行以下命令进行NETCDF-C源码包安装。

    ./configure --prefix=/path/to/install/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/install/HDF5/include -I/path/to/install/PNETCDF/include" LDFLAGS="-L/path/to/install/HDF5/lib -L/path/to/install/PNETCDF/lib -Wl,-rpath=/path/to/install/HDF5/lib -Wl,-rpath=/path/to/install/PNETCDF/lib" CFLAGS="-L/path/to/install/HDF5/lib -L/path/to/install/PNETCDF/lib -I/path/to/install/HDF5/include -I/path/to/install/PNETCDF/include"

  6. 执行以下命令编译安装。

    make -j 16
    make install

  7. 执行以下命令设置的环境变量。

    export PATH=/path/to/install/NETCDF/bin:$PATH
    export LD_LIBRARY_PATH=/path/to/install/NETCDF/lib:$LD_LIBRARY_PATH