Rate This Document
Findability
Accuracy
Completeness
Readability

Installing NetCDF-Fortran

Procedure

  1. Use PuTTY to log in to the server as the root user.
  2. Decompress the NetCDF-Fortran installation package.
    tar -zxvf netcdf-fortran-4.4.5.tar.gz
  3. Go to the directory generated after the decompression.
    cd netcdf-fortran-4.4.5
  4. Perform the configuration.
    CC=mpicc CFLAGS="$optflags -I/path/to/HDF5/include -I/path/to/NETCDF/include" FC=mpif90 FFLAGS="$optflags -fPIC -I/path/to/HDF5/include -I/path/to/NETCDF/include" FCFLAGS="$optflags -fPIC -I/path/to/HDF5/include -I/path/to/NETCDF/include" F77=mpif77 LDFLAGS="$ldflags -L/opt/compiler/BS/bisheng-compiler-1.3.1-aarch64-linux -L/path/to/HDF5/lib -L/path/to/NETCDF/lib" ./configure --build=aarch64-linux --prefix=/path/to/NETCDF --enable-static --enable-shared --with-pic --enable-parallel-tests --enable-largefile --enable-large-file-tests

  5. Apply the patch package.
    patch -p1 < libtool.patch

  6. Create a libtool.patch file and edit the file.
    1. Create a libtool.patch file.
      vi libtool.patch
    2. Press i to enter the edit mode and add the following content:
      diff -ruN hdf5-1.10.1/libtool hdf5-1.10.1-new/libtool
      --- hdf5-1.10.1/libtool 2019-12-02 20:02:56.270676503 +0000
      +++ hdf5-1.10.1-new/libtool 2019-12-02 20:03:05.062708034 +0000
      @@ -11832,7 +11832,7 @@
       pic_flag=""
       # How to pass a linker flag through the compiler.
      -wl=""
      +wl="-Wl,"
       # Compiler flag to prevent dynamic linking.
       link_static_flag=""
    3. Press Esc, type :wq!, and press Enter to save the file and exit.
  7. Perform the installation.
    make -j$threads

    make install

  8. Verify the installation.
    ls /path/to/NETCDF/bin
    ls /path/to/NETCDF/lib