ubuntu16.04下gmt5.4.1的安裝
1 參考具神博客http://seisman.info/install-gmt5.2.x-under-linux.html
https://github.com/gmt-china/gmt-easy-installer/blob/master/GMT-installer.sh 下載gmt自動化安裝
2 我自己從ftp://ftp.soest.hawaii.edu/gmt/下載最新版本的gmt-5.4.1-src.tar.gz gshhg-gmt-2.3.6.tar.gz 和dcw-gmt-1.1.2.tar.gz
3 安裝依賴包
sudo apt-get update
sudo apt-get install netcdf-bin libnetcdf-dev
sudo apt-get install libgdal-dev
sudo apt-get install libpcre3 libpcre3-dev
sudo apt-get update # 必須安裝的包 sudo apt-get install ghostscript libnetcdf-dev sudo apt-get install libglib2.0-dev # 推薦安裝的包 sudo apt-get install libgdal-dev python-gdal sudo apt-get install liblapack3 # 可選的安裝包 sudo apt-get install libpcre3-dev libfftw3-dev
4 直接運行 sh gmt-installer.sh
tar -xf gmt-${GMT_VERSION}-src.tar.gz
tar -xf gshhg-gmt-${GSHHG_VERSION}.tar.gz
tar -xf dcw-gmt-${DCW_VERSION}.tar.gz
mv gshhg-gmt-${GSHHG_VERSION} gmt-${GMT_VERSION}/share/gshhg
mv dcw-gmt-${DCW_VERSION} gmt-${GMT_VERSION}/share/dcw-gmt
cd gmt-${GMT_VERSION}
運行到這裏,一直出錯
5 在terminal終端中
set (GMT_INSTALL_MODULE_LINKS FALSE)
set (COPY_GSHHG TRUE)
set (COPY_DCW TRUE)
set (GMT_USE_THREADS TRUE)
6 mkdir build
cd build
cmake ..
make
sudo make install
cd ../..
7 最後在terminal終端中配置環境變量
# Configuration
echo "export GMT5HOME=${GMT_INSTALL}" >> ~/.bashrc
echo ‘export PATH=${GMT5HOME}/bin:$PATH‘ >> ~/.bashrc
echo ‘export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${GMT5HOME}/lib64‘ >> ~/.bashrc
8 測試gmt安裝是否成功
terminal 直接輸入gmt或者gmt --version
或者gmt psxy or gmt pslegend
成功。
9 gmt中文支持
明天完成
ubuntu16.04下gmt5.4.1的安裝