Linux 系統版本:Opensuse 13.2 GMT版本: GMT5.4.2 根據README文件: 37 CMake 38 39 40 Install CMake (>=2.8.5) from http://www.cmake.org/cmake/resources/software.html ...
Linux 系統版本:Opensuse 13.2
GMT版本: GMT5.4.2
根據README文件:
37 CMake
38 -----
39
40 Install CMake (>=2.8.5) from http://www.cmake.org/cmake/resources/software.html
41
42
43 Install netCDF library
44 ----------------------
45
46 For all major Linux distributions there are prepackaged development binaries
47 available. netCDF is also available on MacOSX trough the macports and fink
48 package managers.
49
50 Otherwise, get netCDF from http://www.unidata.ucar.edu/downloads/netcdf/.
51 You need at least version 4.0 with netCDF-4/HDF5 data model support (do not
52 disable HDF5/ZLIB in netCDF with --disable-netcdf-4).
53
54 Install CURL library
55 --------------------
56
57 To handle URLs we depend on libcurl so install via your favorite package
58 manager if it is not intrinsic to your Unix installation. Otherwise, get
59 it from https://curl.haxx.se.
60
61 GDAL (optional)
62 ---------------
63
64 To use the GDAL interface (ability to provide grids or images to be imported
65 via gdal) you must have the GDAL library and include files installed. Like
66 netCDF, GDAL is available through your favorite package manager on many *NIX
67 systems.
68
69
70 PCRE (optional)
71 ---------------
72
73 To use the PCRE interface (ability to specify regular expressions in some
74 search options, e.g., gmtconvert) you must have the PCRE library and include
75 files installed. PCRE is available through your favorite package manager
76 on many *NIX systems.
77
78
79 LAPACK (optional)
80 ---------------
81
82 To greatly speed up some linear algebra calculations (greenspline in
83 particular) you must have the LAPACK library and include files installed.
84 LAPACK is available through your favorite package manager on many *NIX
85 systems or in the case of OS X is built in.
86
87
88 Install support data
89 --------------------
這裡未安裝 gdal、lapack等庫
繼續按照README.CMAKE的提示進行操作
下載gshhg-gmt-2.3.7.tar.gz,dcw-gmt-1.1.2.tar.gz
在GMT5.4.2解壓目錄cmake文件夾下,複製ConfigUserTemplate.cmake重命名為ConfigUser.cmake;
修改ConfigUser.cmake文件, 去掉 GSHHG 和 DCW_ROOT兩項的註釋。
然後在 ~/.bashrc 中增加兩個變數
export GSHHG_ROOT=/home/suse/software/gmt-5.4.2/gshhg-gmt-2.3.7/ export DCW_ROOT=/home/suse/software/gmt-5.4.2/dcw-gmt-1.1.2/
創建目錄build,
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=RelWithDebInfo ..
make install //這裡我沒有採用多線程運行 make -jx install
測試運行GMT命令
psxy
正常運行即安裝成功。