ubuntu 14.04 64位环境下
参考文献:
blog.sina/s/blog_563c93160100zvac.html
blog.sciencenet/blog-653020-549872.html
blog.sciencenet/blog-387-405286.html
blog.sciencenet/blog-758166-627744.html
下载NetCDF www.soest.hawaii.edu/gmt/    或者直接:ftp://ftp.unidata.ucar.edu/pub/netcdf/
下载GMT ftp://ftp.soest.hawaii.edu/gmt/ 中的gmt-4.5.13-src.tar.bz2 gshhg-gmt-2.3.
执行以下命令,获取环境。
sudo apt-get install dpkg-dev -y
sudo apt-get install libX11-dev -y
sudo apt-get install gfortran -y
sudo apt-get install csh -y
sudo apt-get install tcsh -y
sudo apt-get install ncftp -y
sudo apt-get install emacs -y
sudo apt-get install vim -y
sudo apt-get install filezilla -y
sudo apt-get install libghc-X11-dev -y
sudo apt-get install libxaw7-dev -y
sudo apt-get install build-essential flex cmake zlib1g-dev qt4-dev-tools libqt4-dev gnuplot libreadline-dev libxt-dev --force-yes -y
设置环境变量:
1、cd
2、gedit .bashrc
3、复制以下内容到最后一行:环境变量
# for GAMIT
export  PATH=$PATH:/opt/gamit/gamit/bin:/opt/gamit/kf/bin:/opt/gamit/com
export  HELP_DIR=/opt/gamit/help/
# for GMT
export  PATH=$PATH:/usr/local/netcdf/bin
export  NETCDF=/usr/local/netcdf
export  GMTHOME="/usr/local/gmt"
export  PATH="$PATH:$GMTHOME/bin"
ubuntu vim命令4、source .bashrc
5、echo $PAHT  如果里面已经有NETCDF和GMT的路径表示设置成功。
安装NetCDF:(安装指向,不需要预定)
1、复制到某个文件夹下
2、tar -zxvf
3、cd netcdf-4.3.0
4、./configure --disable-dap --disable-netcdf-4 --prefix=/usr/local/netcdf FC=gfortran
5、make
6、make check
7、make install
安装GMT
1、tar -jxvf gmt-4.5.8.tar.bz2
2、cp -r gmt-4.5.8 /usr/local/gmt 
3、cd /usr/local/gmt
4、./configure --enable-netcdf=/usr/local/netcdf
5、make install
复制 gshhs到gmt目录
cp gshhg-gmt-2.3. /usr/local/gmt/
cd /usr/local/gmt/
tar –xvf gshhs-2.2.0.tar.bz2 
验证是否安装成功:psxy 出来一堆东西表示成功,如果仅出现无此命令则表示没有安装成功。

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。