概述
系统:Centos 7.6 ,GUN编译器
依赖库:udunits, netcdf, libpng, Xlib,hdf5,curl
1 编译环境配置
vi ~/.bashrc
export CC=icc
export CXX=icpc
export FC=ifort
export F90=ifort
export F77=ifort
source ~/.bashrc
2 安装依赖库
(1)zlib
tar -zxvf zlib-1.2.11.tar.gz
cd zlib-1.2.8
./configure --prefix=/usr/local/netcdf
make
make check
make install
vim ~/.bashrc
export CPPFLAGS=-I/usr/local/netcdf/include
export LDFLAGS=-L/usr/local/netcdf/lib
source ~/.bashrc
(2)libpng
tar xzvf libpng-1.6.37.tar.gz
cd libpng-1.6.37
./configure --prefix=/usr/local/netcdf
make
make install
(3)curl
tar -zxvf curl-7.55.1.tar.gz
cd -zxvf curl-7.55.1
./configure --prefix=/usr/local/netcdf_install
make
make check
make install
(4)hdf5
tar -zxvf hdf5-1.10.5.tar.gz
cd hdf5-1.10.5
./configure --prefix=/usr/local/netcdf --with-zlib=/usr/local/netcdf
make
make check
make install
make check-install
vim ~/.bashrc
export HDF5_HOME=/usr/local/netcdf
export PATH=$HDF5_HOME/bin:$PATH
export LD_LIBRARY_PATH=$HDF5_HOME/lib:$LD_LIBRARY_PATH
export INCLUDE=$HDF5_HOME/include:$INCLUDE
source ~/.bashrc
(5)netcdf-c
tar -zxvf netcdf-c-4.8.0.tar.gz
cd netcdf-c-4.8.0
./configure --prefix=/usr/local/netcdf --with-hdf5=/usr/local/netcdf --disable-dap
make
make check
make install
(6)netcdf-fortran
tar -zxvf netcdf-fortran-4.5.3.tar.gz
cd netcdf-fortran-4.5.3
./configure --prefix=/usr/local/netcdf --with-hdf5=/usr/local/netcdf --disable-dap
make
make check
make install
vim ~/.bashrc
export NETCDF=/usr/local/netcdf
export PATH=$NETCDF/bin:$PATH
export LD_LIBRARY_PATH=$NETCDF/lib:$LD_LIBRARY_PATH
source ~/.bashrc
(7)udunits
tar -xvf udunits-2.2.28.tar.gz
cd udunits-2.2.28
./configure --prefix=/usr/local/udunits2
make
make check
make install
(8)Xlib
yum install libXext.i386
yum install libXext-devel.i386
yum install libXaw-devel
yum install libXt-devel
yum install libICE-devel
yum install libSM-devel
3 ncview安装
tar -xvf ncview-2.1.8.tar.gz
cd ncview-2.1.8
./configure --prefix=/usr/local/ncview --with-udunits2_incdir=/usr/local/udunits/include/ --with-udunits2_libdir=/usr/local/udunits/lib/
make
make check
make install
4 运行
neview nc文件名,如:
ncview geo_em.d01.nc
就有窗口弹出
5 问题:Error: Can't open display,运行无窗口弹出
1 修改文件 /etc/ssh/sshd_config,设
X11Forwarding yes
2.安装Xming
(1)下载地址:https://sourceforge.net/projects/xming/?source=typ_redirect
(2)安装:“下一步”式无脑安装即可。
(3)配置:打开Xming的安装目录,找到文件“X0.hosts”(刚安装的Xming改文件名一般为X0,也可能X1,此处不讨论),以文本形式打开这个文件,在第二行补充服务器IP地址:
localhost
***.***.***.***
然后重启Xming软件
3、修改服务器环境变量 ,添加本地机IP***.***.***.***
vim ~/.bashrc
export DISPLAY=***.***.***.***:0.0
source ~/.bashrc
再尝试
ncview geo_em.d01.nc
成功!
参考文章:ncview的安装,netcdf-c-4.8.0及netcdf-fortran4.5.3安装笔记,轻松解决远程链接问题
最后
以上就是无私裙子为你收集整理的Centos服务器下ncview 安装的全部内容,希望文章能够帮你解决Centos服务器下ncview 安装所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复