Compilation and Installation
Procedure
Use the GCC embedded in the OS to perform the installation. Do not load the GCC 9.3 environment.
- Use PuTTY to log in to the server as the root user.
- Install NCL and its dependencies.
yum install ncl.aarch64 ncl-common.noarch ncl-devel.aarch64 ncl-examples.noarch -y
- 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
- 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.

- Download the ncl-6.3.0-6.el7.src.rpm RPM package of NCL.
yum install -y yum-utils yumdownloader --source ncl
- 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
- Modify the /libncarg_c/yMakefile file.
- Open /libncarg_c/yMakefile.
vim ncl_ncarg-6.3.0/common/src/libncarg_c/yMakefile
- Press i to enter the insert mode and modify line 35.
#elif (defined(ia64) || defined(x86_64) || defined(amd64) || defined(aarch64))
- Press Esc, type :wq!, and press Enter to save the file and exit.
- Open /libncarg_c/yMakefile.
- Modify the /nio/yMakefile file.
- Open /nio/yMakefile.
vim ncl_ncarg-6.3.0/ni/src/lib/nio/yMakefile
- Press i to enter the insert mode and modify line 85.
#if defined(IRIX64) || defined(x86_64) || defined(__LP64__) || defined(aarch64)
- Press Esc, type :wq!, and press Enter to save the file and exit.
- Open /nio/yMakefile.
- Modify the /ncl/yMakefile file.
- Open /ncl/yMakefile.
vim ncl_ncarg-6.3.0/ni/src/ncl/yMakefile
- 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)
- Press Esc, type :wq!, and press Enter to save the file and exit.
- Open /ncl/yMakefile.
- 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
- Recompile NCL.
- Go to the SPECS directory.
cd ~/rpmbuild/SPECS
- Modify the ncl.spec file.
vim ncl.spec
- 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:

- Press Esc, type :wq!, and press Enter to save the file and exit.
- 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:

- Go to the SPECS directory.
- 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
Parent topic: NCL 6.3.0 Porting Guide (CentOS 7.6)