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

Installing NetCDF-Fortran

Procedure

  1. Use PuTTY to log in to the server as the root user.
  2. Run the following command to decompress the NetCDF-Fortran installation package:
    tar -xvf netcdf-fortran-4.4.1.tar.gz
  3. Run the following command to switch to the directory generated after the package is decompressed:
    cd netcdf-fortran-4.4.1
  4. Run the following commands to configure the environment before compilation:
    export MPICC=mpicc
    export MPICXX=mpicxx
    export MPIFC=mpifort
    export CPPFLAGS="-I/path/to/HDF5/include -I/path/to/NETCDF/include"
    export LDFLAGS="-L/path/to/HDF5/lib -L/path/to/NETCDF/lib -Wl,-rpath=/path/to/HDF5/lib -Wl,-rpath=/path/to/NETCDF/lib"
    export CFLAGS="-L/path/to/HDF5/lib -L/path/to/NETCDF/lib -I/path/to/HDF5/include -I/path/to/NETCDF/include"
    export CXXFLAGS="-L/path/to/HDF5/lib -L/path/to/NETCDF/lib -I/path/to/HDF5/include -I/path/to/NETCDF/include"
    export FCFLAGS="-L/path/to/HDF5/lib -L/path/to/NETCDF/lib -I/path/to/HDF5/include -I/path/to/NETCDF/include"
  5. Run the following command to perform configuration:
    ./configure --prefix=/path/to/NETCDF  --build=aarch64-unknown-linux-gnu --enable-shared --with-pic --disable-doxygen --enable-largefile --enable-static CC=$MPICC CXX=$MPICXX FC=$MPIFC F77=$MPIFC
  6. Run the following commands to perform compilation and installation:
    make -j 16
    make install
  7. Run the following command to clear compilation parameters:
    unset CC CXX FC F77 CPPFLAGS LDFLAGS CFLAGS CXXFLAGS FCFLAGS