编译安装NCL之后,运行NCL后出现如下错误,因为一直都没有用,所以都没发现。
[root@px: /root]# ncl
Copyright (C) 1995-2015 - All Rights Reserved
University Corporation for Atmospheric Research
NCAR Command Language Version 6.3.0
The use of this software is governed by a License Agreement.
See http://www.ncl.ucar.edu/ for more details.
warning:Unable to Get System Resource File Name?
warning:Unable to load System Resource File (null)
fatal:GetSysAppDir:Unable to get a default value for the system App Resource directory
warning:["Resources.c":734]:Unable to set appSysDir to default value - Using NULL
fatal:GetSysAppDir:Unable to get a default value for the system App Resource directory
warning:["Resources.c":734]:Unable to set appSysDir to default value - Using NULL
warning:Unable to Get System Resource File Name?
warning:WorkstationClassInitialize:Unable to access rgb color database - named colors unsupported:[errno=2]
NDV_COLORMAP_PATH environment variable not set:
defaulting to .:$NCARG_ROOT/lib/ncarg/colormaps
warning:["Palette.c":1844]:NhlLoadColormapFiles: Invalid directory encountered in colormap path specification
段错误 (core dumped)
解决方法也很简单,加个环境变量就可以了。之前我是源码下下来之后configure
和make
的,所以也没仔细看官方文档,没想到还要这个环境变量才能用。
如果是像我这样默认安装的,一般安装路径是/usr/local
,所以使用export NCARG_ROOT=/usr/local
就可以了。如果是其他路径,相应修改一下就可以了。把这句话加到相应的bashrc
里,例如:如果是单个用户需要,就加到用户home目录下的.bashrc
文件里,如果是所有用户,就加在/etc/bashrc
里,之后重开终端。
Comments
注:如果长时间无法加载,请针对 disq.us | disquscdn.com | disqus.com 启用代理。