GMT Version 3.4 for OS/2 Warp
Table of Contents
Introduction
I have ported the Generic Mapping Tools (GMT) package from Unix
to OS/2. GMT is a freely-available package, distributed under the
GNU Public License, that produces exceptionally high-quality graphical
output; it has been developed by Paul Wessel, currently at the University
of Hawaii, and Walter Smith, presently at NOAA. GMT is especially
designed for spatial data, and includes ways of displaying information
using any one of many map projections. All GMT graphical output
is either Postscript or Encapsulated Postscript, and can be printed/viewed on any postscript printer, or printed
with a utility such as Ghostscript/GSView. For more details on GMT, refer
to the GMT Web Site, which
also provides many examples of GMT graphical output. Please refer
to the GMT web site for all information on GMT that is not specific to OS/2.
This version of GMT for OS/2 has been built and tested on Warp 4, FixPak 12.
No testing has been performed on OS/2 version 2.x of Warp 3, although I expect
that the GMT routines, which make no use of PM or the WPS, should
work fine on either of these systems.
GMT can be used in a US installation or in an SI (Europe or Asia)
installation. The user chooses which system to be used at run-time.
Note: The current version of GMT is 3.4.
Return to Table of Contents
Requirements
System
The present OS/2 version of GMT is required to be installed
upon a file system permitting long file names. Under OS/2, of course, this
will almost always be HPFS, but it is possible to install GMT on
other file systems (such as ext2, used by Linux, or FAT32,
used by M$ Windows) for which OS/2 drivers are available.
Libraries
Run-time. In addition to the GMT codes, one must also have
installed the run-time support for EMX. This plus the remainder of the
EMX development system is freely available from Hobbes
or LEO.
The OS/2 version of GMT has been compiled with EMX version 0.9d
(fix level 4), and thus the run-time library corresponding to that version
should be used.
Development. In addition to the EMX development system, GMT
requires the netCDF libraries, developed by the University Corporation
for Atmospheric Research. These are freely available from its ftp
site. An OS/2 DLL version of the netCDF library is provided with this
distribution. In addition, GMT requires a math library; I
have used Sun Microsystem's Freely Distributable Math Library (fdlibm),
available from netlib, for the required
routines. The necessary routines are made available in the DLL named fdlibm.dll.
Return to Table of Contents
Obtaining the executables
Only the binary executables are made available here, due to the fact that
GMT is now extremely portable. Because of its portability, NO changes
in the source codes are now required to successfully compile GMT (thanks,
Paul and Walter).
The basic sources can be obtained using links found on the main GMT
home page. From the GMT home page, all the required documentation and
associated information can be obtained.
The GMT distribution I am providing includes some supplementary
routines, namely the meca routines (which permit earthquake focal
mechanisms to be plotted, for example) and the
grdraster utility,
which permits conversion and extraction of subgrids of certain raster grid
formats.
This OS/2 distribution, in contrast to some earlier distributions, is not
staticly linked. The executables require, in addition to the EMX libraries,
four DLLs. These are (1) the netCDF library (netcdf.dll), (2) Sun's Freely
Distributable math library (fdlibm.dll), (3) the GMT Postscript library (psl.dll),
and (4) the GMT support library (gmt.dll). All the required libraries, as
well as the executables, as provided as part of the basic distribution, gmt3_4.zip.
This archives can be obtained here
or from Hobbes.
Unzipping gmt3_4.zip will provide the following files:
ReadMe.txt : A brief introduction
gmt4os2.html : What you are reading
Porting.zip : Instructions and files for building the codes
dll-files.zip : The four DLLs required
exe-files.zip : The GMT executables
The DLLs (dll-files.zip) should be placed in a directory in your LIBPATH.
The executables (exe-files.zip) should be placed somewhere in your PATH. The files
in Porting.zip are only needed if you might wish to rebuild the
DLLs and executables yourself.
All other required data files, coastline files, documentation, and associated
information should be obtained from links on the GMT
web page.
Return to Table of Contents
Environment Variables
The environment variable
GMTHOME must to be set for GMT to work
properly. In this respect, the OS/2 distribution is the same as the
Unix distribution. GMT will look for required data files in the subdirectory
share beneath the main GMT directory specified by GMTHOME.
I suggest setting
GMTHOME in CONFIG.SYS. In addition, the variable
HOME should be set to a directory of the user's choice (it could
be the same as GMTHOME); GMT stores default parameters in
that directory. Remember to use forward slashes rather than backward slashes
to indicate the directories (for example, use SET GMTHOME=d:/GMT rather
than SET GMTHOME=d:\GMT).
Return to Table of Contents
Idiosyncracies
- If you unpack the GMT distribution in a directory g:/GMT,
and set the environment variable GMTHOME to g:/GMT, GMT won't find several
required files, for unpacking GMT_progs.tar.gz will place them in
G:/GMT/GMT3.4/share instead of the expected G:/GMT/share. Moving them to the
latter path will solve the problem.
- To successfully use, e.g. tcsh, for the examples, one has to rename tcsh.exe
to csh.exe and place a copy in a directory /bin on the drive on which the examples
reside.
- When creating the examples, the TMP or TEMP environment variables are not
honored. Instead one has to ensure that a directory /tmp exists in the root of
the drive that the examples reside on. If /tmp doesn't exists, the example will
fail.
Items 2 and 3 could be solved by using TVFS.
Thanks to Christian Hennecke for pointing out the above features.
Return to Table of Contents
Installation
To install, extract the routines from the archive and set the environment
variables as discussed above. Install the executables in the directory
/GMT/GMT3.4/bin or in any other location in your PATH. Install the DLLs
in a location in your LIBPATH, or modify your LIBPATH to include the directory
in which you place the DLLs. Obtain and install documentation as you see
fit; note that man pages can be viewed online from the GMT site.
If you are unfamiliar with GMT, I strongly suggest getting the nice
tutorial, available from the main GMT web site.
Return to Table of Contents
Known Problems
Thus far (24 Dec 2001) there is only one known problem with the port.
At least one of the routines (sample1d) seems to have a problem
accepting piped output from other routines. This is exemplified when example 3
is run. For example, in example 3 (job03.bash, for instance) the command
filter1d ship.pg -Fm1 -T$sampr1/$sampr2/1 -E | sample1d -Nsamp.x > samp_ship.pg
fails, yet the executing the commands via temporary files, such as
filter1d ship.pg -Fm1 -T$sampr1/$sampr2/1 -E > filter1d.tmp
sample1d filter1d.tmp -Nsamp.x > samp_ship.pg
seems to work perfectly. Until such problems are resolved, you might consider
using temporary files with sample1d.
Return to Table of Contents
Other Utilities
GMT produces outstanding graphical output. All its output is in
the form of either Postscript or Encapsulated Postscript files. Some readily-available
utilities are extremely useful for viewing or printing such files. Aladdin
Ghostscript
provides one the ability to print Postscript files to non-Postscript printers;
I recommend it (there is also a Gnu version of ghostscript, which I simply
have not used). An outstanding OS/2 utility named GSView,
written by Russell Lang,
uses Aladdin Ghostscript and provides an OS/2 user the ability to preview
Postscript and Encapsulated Postscript files; in addition, GSView can
be used as an interface to Ghostscript, permitting Postscript files to be
rather easily converted into other formats supported by Ghostscript.
Return to Table of Contents
Help and Bug Reports
This version of GMT is not directly supported by Paul Wessel
and Walter Smith, who are the authors of the Unix verison. If you believe
you've found a bug, it may well be a bug that applies to the Unix version
as well as to the OS/2 version. Be aware that there are two electronic
mailing lists available to users. The first,
gmtgroup@soest.hawaii.edu,
is used primarily to notify users of bug fixes and new versions. The second,
gmthelp@soest.hawaii.edu, serves as a users forum for idea exchange
and questions about GMT usage. To subscribe to either of these lists,
send an e-mail message to
listserver@soest.hawaii.edu containing
one or both of the commands
subscribe gmtgroup <your full name, not your e-mail address>
subscribe gmthelp <your full name, not your e-mail address>
Do not include the angle brackets in the message. Also, if your
e-mail client appends a signature file to your outgoing messages, inhibit
the sending of the file (or send a blank file).
For questions of bug reports that you believe are specific to the OS/2
version, please send bug reports [e-mail only!] to Allen
Cogbill, Los Alamos National Laboratory.
Return to Table of Contents