以下安装使用系统GCC,请勿加载GCC9.3环境。
yum install ncl.aarch64 ncl-common.noarch ncl-devel.aarch64 ncl-examples.noarch -y
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
ng4ex xy01n -W png
若NCL主程序报错(如下所示),则需要重新编译主程序。
yum install -y yum-utils yumdownloader --source ncl
rpm -ivh ncl-6.3.0-6.el7.src.rpm cd ~/rpmbuild/SOURCES tar zxvf ncl_ncarg-6.3.0.tar.gz
vim ncl_ncarg-6.3.0/common/src/libncarg_c/yMakefile
#elif (defined(ia64) || defined(x86_64) || defined(amd64) || defined(aarch64))
vim ncl_ncarg-6.3.0/ni/src/lib/nio/yMakefile
#if defined(IRIX64) || defined(x86_64) || defined(__LP64__) || defined(aarch64)
vim ncl_ncarg-6.3.0/ni/src/ncl/yMakefile
EXTRA_CCOPTIONS = -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fsigned-char
#if defined(IRIX64) || defined(x86_64) || defined(ia64) || defined(__LP64__) || defined(aarch64)
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
cd ~/rpmbuild/SPECS
vim ncl.spec
%define __debug_install_post \ %{_rpmconfigdir}/find-debuginfo.sh %{?_find_debuginfo_opts} "%{_builddir}/%{?buildsubdir}"\ %{nil}
修改如下图所示。
rpmbuild -ba ncl.spec
若报错缺少依赖,根据提示依次Yum安装即可,如下所示。
yum install netcdf-fortran-devel hdf-static hdf-devel g2clib-static gdal-devel proj-devel imake libXaw-devel flex-static udunits2-devel
直到rpmbuild -ba ncl.spec可以成功执行。如下图中出现“exit 0”,则表明成功执行。
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