0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

GMT4.5.18をインストールする(CentOS Stream9)

Last updated at Posted at 2024-06-01

はじめに

GMT4,GMT5,GMT6で互換性がないため、GMT4で書かれたスクリプトがGMT5,GMT6では使用できない。CentOS Stream9のパッケージ管理ソフトではGMT6がセットされるため、GMT4の最終版の4.5.18をコンパイルする必要があります。

方針

  • GMTプログラム以外のデータや依存するプログラムについてはパッケージ管理ソフトで管理を行う。
  • 公式サイトのwikiにしたがうhttps://github.com/GenericMappingTools/gmt/wiki
  • /usr/local/gmt-4.5.18にプログラム一式を置くものとする。

GMTが依存しているプログラムのインストール

事前設定

詳細はhttps://docs.fedoraproject.org/en-US/epel/
EPEL,EPEL-NEXTリポジトリが入っていること、無効になっているCRBリポジトリが有効すること。

dnf config-manager --enable crb
dnf install epel-release epel-next-release
# リポジトリの存在と有効無効の確認
dnf repolist --all

こちらの# Install required dependencies# Install optional dependenciesをインストールする

dnf install cmake libcurl-devel netcdf-devel gdal-devel
dnf install ninja-build gdal pcre-devel fftw3-devel lapack-devel openblas-devel glib2-devel ghostscript

GMTのデータのインストール

dnf install gshhg-gmt-nc4 gshhg-gmt-nc4-full gshhg-gmt-nc4-high dcw-gmt

※gshhgは/usr/share/gshhg-gmt-nc4ディレクトリにデータが格納される。
※dcwは/usr/share/dcw-gmtディレクトリにデータが格納される。

GMTソースコードのダウンロード

こちらの

  • gmt-4.5.18-src.tar.bz2
  • gmt-4.5.18-non-gpl-src.tar.bz2(triangle)

をインストールそして解凍

wget http://www.scc.u-tokai.ac.jp/gmt/gmt-4.5.18-src.tar.bz2
wget http://www.scc.u-tokai.ac.jp/gmt/gmt-4.5.18-non-gpl-src.tar.bz2
tar -jxf gmt-4.5.18-src.tar.bz2
tar -jxf gmt-4.5.18-non-gpl-src.tar.bz2

全体でgmt-4.5.18ディレクトリに格納される。後者はその中の一部gmt-4.5.18/src/ディレクトリに格納。
※non-gpl-srcはGNUライセンスではないので別に格納しているだけである。

GMTのコンパイル

READMEを見て以下必要なオプションを追加

cd gmt-4.5.18
./configure --prefix=/usr/local/gmt-4.5.18 --with-gshhg-dir=/usr/share/gshhg-gmt-nc4 --enable-triangle --enable-gdal

※./configure --helpで必要なオプションを見ることができる。
※--prefix:install場所を指定
※--with-gshhg-dir:gmt-gshhgの場所を記入
※--enable-triangle:triangle(別ソースコードになっているもの)を有効
※--enable-gdal:gdalを有効

make all
sudo make install-all 
make clean

※make helpで実行して何を行うか見ることができます。

GMTのパスを張る

最後に/usr/local/gmt-4.5.18/binにパスを張りましょう。

$ vi ~/.profile
$ vi ~/.bashrc
$ vi ~/.bash_profile
等
export PATH=/usr/local/gmt-4.5.18/bin:${PATH}
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?