我要评分
获取效率
正确性
完整性
易理解

Installing NetCDF

Procedure

  1. Use PuTTY to log in to the server as the root user.
  2. Download the NetCDF installation package and decompress it.
    cd /path/to
    wget https://codeload.github.com/Unidata/netcdf-fortran/tar.gz/refs/tags/v4.4.5 -O netcdf-fortran-4.4.5.tar.gz
    wget https://codeload.github.com/Unidata/netcdf-c/tar.gz/refs/tags/v4.7.0 -O netcdf-c-4.7.0.tar.gz
    tar xf netcdf-fortran-4.4.5.tar.gz
    tar xf netcdf-c-4.7.0.tar.gz
  3. Go to the NetCDF-C source package directory and perform the installation.
    export HDF5_DIR=/path/to/hdf5
    export PNETCDF_DIR=/path/to/pnetcdf
    cd netcdf-c-4.7.0
    CC=mpicc ./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 CPPFLAGS="-I${HDF5_DIR}/include -I${PNETCDF_DIR}/include" LDFLAGS="-L${HDF5_DIR}/lib -L${PNETCDF_DIR}/lib -Wl,-rpath=${HDF5_DIR}/lib -Wl,-rpath=${PNETCDF_DIR}/lib" CFLAGS="-L${HDF5_DIR}/lib -L${PNETCDF_DIR}/lib -I${HDF5_DIR}/include -I${PNETCDF_DIR}/include"
    make -j 64
    make install
  4. Go to the NetCDF-Fortran source package directory and perform the installation.
    export NETCDF=/path/to/netcdf
    export PATH=/path/to/netcdf/bin:$PATH
    export LD_LIBRARY_PATH=/path/to/netcdf/lib:$LD_LIBRARY_PATH
    cd ../netcdf-fortran-4.4.5
    CC=mpicc FC=mpif90 F77=mpif90 ./configure --prefix=${NETCDF} --build=aarch64-unknown-linux-gnu --enable-shared --with-pic --disable-doxygen --enable-largefile --enable-static CPPFLAGS="-I${HDF5_DIR}/include -I${NETCDF}/include" LDFLAGS="-L${HDF5_DIR}/lib -L${NETCDF}/lib -Wl,-rpath=${HDF5_DIR}/lib -Wl,-rpath=${NETCDF}/lib" CFLAGS="-L${HDF5_DIR}/lib -L${NETCDF}/lib -I${HDF5_DIR}/include -I${NETCDF}/include" CXXFLAGS="-L${HDF5_DIR}/lib -L${NETCDF}/lib -I${HDF5_DIR}/include -I${NETCDF}/include" FCFLAGS="-L${HDF5_DIR}/lib -L${NETCDF}/lib -I${HDF5_DIR}/include -I${NETCDF}/include"
    make -j 64
    make install
  5. Set the environment variables.
    export INCLUDE=/path/to/netcdf/include:$INCLUDE