Rate This Document
Findability
Accuracy
Completeness
Readability

Compilation and Installation

Procedure

Use the GCC embedded in the OS to perform the installation. Do not load the GCC 9.3 environment.

  1. Use PuTTY to log in to the server as the root user.
  2. Install NCL and its dependencies.
    yum install ncl.aarch64 ncl-common.noarch ncl-devel.aarch64 ncl-examples.noarch -y
  3. Set the environment variables.
    export NCARG_FONTCAPS=/usr/lib64/ncarg/fontcaps
    export NCARG_GRAPHCAPS=/usr/lib64/ncarg/graphcaps
    export NCARG_ROOT=/usr
    export NCARG_DATABASE=/usr/lib64/ncarg/database
    export NCARG_LIB=/usr/lib64/ncarg
    export NCARG_NCARG=/usr/share/ncarg
    export EXTRA_CCOPTIONS=" -fsigned-char "$EXTRA_CCOPTIONS
  4. Perform the verification:
    ng4ex xy01n -W png

    If the NCL main program reports an error, as shown in the following figure, recompile the main program.

  5. Download the ncl-6.3.0-6.el7.src.rpm RPM package of NCL.
    yum install -y yum-utils
    yumdownloader --source ncl
  6. Recompile NCL and decompress the NCL installation package.
    rpm -ivh ncl-6.3.0-6.el7.src.rpm
    cd ~/rpmbuild/SOURCES
    tar zxvf ncl_ncarg-6.3.0.tar.gz
  7. Modify the /libncarg_c/yMakefile file.
    1. Open /libncarg_c/yMakefile.
      vim ncl_ncarg-6.3.0/common/src/libncarg_c/yMakefile
    2. Press i to enter the insert mode and modify line 35.
      #elif (defined(ia64) || defined(x86_64) || defined(amd64) || defined(aarch64))
    3. Press Esc, type :wq!, and press Enter to save the file and exit.
  8. Modify the /nio/yMakefile file.
    1. Open /nio/yMakefile.
      vim ncl_ncarg-6.3.0/ni/src/lib/nio/yMakefile
    2. Press i to enter the insert mode and modify line 85.
      #if defined(IRIX64) || defined(x86_64) || defined(__LP64__) || defined(aarch64)
    3. Press Esc, type :wq!, and press Enter to save the file and exit.
  9. Modify the /ncl/yMakefile file.
    1. Open /ncl/yMakefile.
      vim ncl_ncarg-6.3.0/ni/src/ncl/yMakefile
    2. Press i to enter the insert mode and modify the file as follows:
      • Modify line 46:
      EXTRA_CCOPTIONS = -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fsigned-char
      • Modify line 113:
      #if defined(IRIX64) || defined(x86_64) || defined(ia64) || defined(__LP64__) || defined(aarch64)
    3. Press Esc, type :wq!, and press Enter to save the file and exit.
  10. Delete the original TAR packages and pack the updated source code.
    rm -f ncl_ncarg-6.3.0.tar.gz
    tar zcvf ncl_ncarg-6.3.0.tar.gz ncl_ncarg-6.3.0
    rm -rf ncl_ncarg-6.3.0
  11. Recompile NCL.
    1. Go to the SPECS directory.
      cd ~/rpmbuild/SPECS
    2. Modify the ncl.spec file.
      vim ncl.spec
    3. Press i to go to the insert mode, and append the following content to the file:
      %define __debug_install_post   \
      %{_rpmconfigdir}/find-debuginfo.sh %{?_find_debuginfo_opts} "%{_builddir}/%{?buildsubdir}"\
      %{nil}

      See the following figure:

    4. Press Esc, type :wq!, and press Enter to save the file and exit.
    5. Perform the packing and compilation.
      rpmbuild -ba ncl.spec

      If an error is reported indicating that dependencies are missing, install the dependencies in sequence using Yum, as shown in the following figure:

      yum install netcdf-fortran-devel hdf-static hdf-devel g2clib-static gdal-devel proj-devel imake libXaw-devel flex-static udunits2-devel

      The rpmbuild -ba ncl.spec command can be executed when exit 0 is displayed, as shown in the following figure:

  12. Install NCL (delete the original NCL first).

    yum erase ncl.aarch64 ncl-common.noarch ncl-devel.aarch64 ncl-examples.noarch -y

    cd ~/rpmbuild/RPMS
    cp noarch/* aarch64/
    cd aarch64
    yum localinstall ncl-6.3.0-6.el7.aarch64.rpm ncl-common-6.3.0-6.el7.noarch.rpm ncl-debuginfo-6.3.0-6.el7.aarch64.rpm ncl-devel-6.3.0-6.el7.aarch64.rpm ncl-examples-6.3.0-6.el7.noarch.rpm -y