Pages

mardi 6 novembre 2012

GMT installation

I tried to install the GMT (generic mapping tool) in my Mac OSX 10.6.8.  I found that the link http://gmt.soest.hawaii.edu/gmt/gmt_install_form.html is quite helpful. I simply followed their suggestions:

1) You have access to a POSIX Bourne shell (Bash will also work). Note that on Solaris you are advised to use the version in /usr/xpg4/bin since /usr/bin/sh (and things like /usr/bin/grep) are not Posix-compliant, and furthermore /usr/bin/awk thinks sin(1) = 1.
2) You have bzip2 on your system. If not, use your package manager, or get source code and executables for bzip2 from the bzip2 site.
3) You have write permissions in all directories you specify below. If you have specified system directories for the install then you may need to run the script using sudo (or as root).
4) You have obtained and saved install_gmt.sh, the GMT install script. Be aware that some browsers may decide to save the script with a different extension (e.g., .txt) so you may have to rename the file after download.

From the link http://gmt.soest.hawaii.edu/gmt/gmt_install_form.html, I filled out a form and submit it; then it creates a configuration file which I should save it as GMT4param.txt. (here I choose to install the netcdf by the gmt installer)

In the path where the GMT4param.txt is saved, I also downloaded install_gmt.sh.
Then in this directory, I launch the installation: sh install_gmt.sh GMT4param.txt.
Then in the end of installation, I defined some enviroment variables:

 For csh or tcsh users:
setenv NETCDFHOME /Users/xwang/software/gmt/netcdf-3.6.3
set path=(/Users/xwang/software/gmt/GMT4.5.8/bin $path)

For sh or bash users:
export NETCDFHOME=/Users/xwang/software/gmt/netcdf-3.6.3
export PATH=/Users/xwang/software/gmt/GMT4.5.8/bin:$PATH

Note: if you installed netCDF as a shared library you may have to add
the path to this library to LD_LIBRARY_PATH or place the library in a
standard system path [see information on shared library for your OS].

For all users:
Add /Users/xwang/software/gmt/GMT4.5.8/man to MANPATH
Add /Users/xwang/software/gmt/GMT4.5.8/share/doc/gmt/html/gmt_services.html as browser bookmark

5) Then I went to my GMT installation directory, then went to share/doc/gmt/examples and ran an example.
6) I looked for a PostScript viewer in my Mac.
gs --version : show 9.0
which gs : show /opt/local/bin/gs

7) then in the gmt example directories, I tried the following command and it works:
gs example_01.ps


Note: for installer gs, http://sourceforge.net/projects/ghostscript/files/GPL%20Ghostscript/

Note: I also looked at several other viewers, such as MacGSview, Macphostview, which do not work well.


Aucun commentaire:

Enregistrer un commentaire