Friday, June 21, 2013

Install GMT on debian/ OS X 10.8

Recipe:

Go to GMT website ( GMT 5.0), select DOWNLOAD from navigation bar in the left.
Fill a INSTALL_FORM for installation parameters.
  1. Select GMT version: [ GMT 5.0.0 beta]
  2. Select default units in GMT: [ SI units (cm)]
  3. Select POSIX Advisory File Locking: [ NO. Do not use file locking]
  4. Select passive [Default] or active ftp transmission: [ Passive ftp]
  5. Select the components you want (bzip2 sizes indicated): [ GMT source, docs, supplements][ GSHHS Coastlines (all resolutions)]
  6. Select which triangulation algorithm to use: [ Watson's algorithm]
  7. Select library build type: [ Shared (dynamic) Libraries]/[ Static Libraries]
  8. Select the C compiler you want to use: [ gcc][ Use default (whatever your compiler prefers)]
  9. Select the make program you want to use: [ make]
  10. Select GMT final destination directories: [ /opt/GMT]
Save the parameter list as a text file ( params.txt) in your home directory.
Download  install_gmt.sh to your home directory.
Run sh install_gmt.sh params.txt
For csh tcsh, edit .cshrc add line set path=(/opt/GMT/bin $path)

One has to give the full permission for path /opt/GMT (su; chmod 777 /opt/GMT).

If you got ftp proxy problems, then you can go to GMT mirror sites to download  gmt-5.0.0b.tar.bz2( GMT source ) and gshhs-2.2.0.tar.bz2( GSHHS Coastlines) to you home directory. Change your params.txt.
GMT_ftp=n
GSHHS_ftp=n
and if you still get proxy problem, then you can change
passive_ftp=n
If the installation process can not find you Netcdf correctly, you have to setup the lib and inc for it. ( csh)
locate libnetcdf
find path for libnetcdf.a libnetcdf.so ... and so on. ( /usr/lib/libnetcdf.*)
locate netcdf.inc
find path for netcdf.inc. ( /usr/include/netcdf.inc )
setenv NETCDF_INC /usr/include/
setenv NETCDF_LIB /usr/lib

That is all.

To install netcdf, ubuntu/debian user can simply type sudo apt-get install netcdf-bin libnetcdf-dev
For OS X user, You can also follow this tutorial, but have to install NetCDF firstly, and put netcdf path to parameter form. (/opt/netcdf4)

No comments:

Post a Comment