New on January 10, 2003.


GMT on Mac OSX, it's absolutely cool!!

Farewell to the Windows


Description in this page is ONLY FOR OS X 10.1.x.

For OS X 10.2.x, USE FINK. Brief guide by Koji is HERE.


What's GMT? Visit Koji's Gallery and GMT Homepage.



This is an install note of standard GMT package onto Mac OSX using install scripts and template supplied by the GMT homepage, by a poor beginner of UNIX, thanks to Dr. Takahiro Sumiya (Hiroshima University), Prof. Takashi Shu Kumamoto (Okayama University), and Dr. Shinji Toda (AIST).

0. Systems
I have successfully installed in a PowerBook G4/500 and a new iBook. There will be no problem in PowerMac G4s.

1. Install OSX (10.0 to 10.1)
The account name of the administrator required by the OSX installer should NOT be "root", which is reserved for the superuser, not for an administrator. In the following example the administrator's account name is "kojiok"

2. Install Developer tools.
The Developer tools may not be included in the OSX attached to a system. OSX full package and upgrade package include a CD-ROM of the Developer tools. Developer.mpkg is the installer. Apple Developer homepage has free download service of the Developer Tools for registered users.

3. Download GMT installer from GMT homepage (Easier way for sections 3 through 6.)
IMPORTANT: Read carefully through the homepage for the latest information and advice for installation.
Download install_gmt and install_gmt_form.pl , and save both in Users/kojiok/.
For install_gmt_form.pl necessary changes are:
Archive: gzip
PostScropt: EPS
netCDF-3.5: Get and install
FTP: Nearest site or Hawaii when permission is denied by a near-by site.
Compiler: cc
Leave all other queries as they are on the page.

4. Start Terminal in Application > Utility

5. Check line breaks(or paragraph mark, CR/LF mode) in terminal.

[localhost/-] kojiok% cat install_gmt
[localhost/-] kojiok% cat install_gmt_form.pl

If the end of each line is defined by a LF (line feed: a line break code for UNIX system), each line
of text begins in a new line (like this text). If not, all lines are shown as a paragraph without
line breaks because the paragraph marks are not LF but CR (carriage return for Mac), or CR+LF
(for MS-DOS/Windows). You need to change line break codes to LF. For the other text-based
data sets, such as xyz, xy, text to plot, cpt, and so on, if you create the file in Macintosh, you
should always change the line break codes to LF.

--Please carefully keep the spacing between arguments in the commands you type.--

6. Change line break using tr command

[localhost/-] kojiok% mv install_gmt install_gmt.mac
[localhost/-] kojiok% cat install_gmt.mac | tr '\r' '\n' > install_gmt

[localhost/-] kojiok% mv install_gmt_form.pl install_gmt_form.pl.mac
[localhost/-] kojiok% cat install_gmt_form.pl.mac | tr '\r' '\n' > install_gmt_form.pl

[You can also use a text editor which can specify the type of line breaks in Save as command.]

7. Change permission of install_gmt

[localhost/-] kojiok% chmod 755 install_gmt

8. Log in as root and start installation.
For the first time when there is no root password:
[localhost/-] kojiok% sudo passwd root
Password: (administrator's password)
New Password: (new password for the root. This may be the same as the administrator's.)

[localhost/-] kojiok% su
Password: (root password)
[localhost/kojiok] root% ./install_gmt install_gmt_form.pl

9. Everything goes automatically.
It may take 10 minutes or more for getting sources file by ftp.
While installing GMT following warnings are persistently repeated, but it seems there is no fatal problem on this.
/Users/kojiok/netcdf-3.5.0/include/netcdf.h:190: warning: ANSI C forbids const or volatile functions
/Users/kojiok/netcdf-3.5.0/include/netcdf.h:193: warning: ANSI C forbids const or volatile functions
After the installation of GMT, example 1 through 20 will be executed. If they are all done, the installation is successful.
The installer stops in an error during installation of mex package.
If you do not use matlab, this is a successful ending, I think.
For your record save the install log using Shell > Save text as.

10. Set path for GMT
Create a file titled .tcshrc (the filename begins with a dot) in your Home [/Users/kojiok] using pico or vi in terminal or a text editor for OSX. The text file (LF line break) should contain following 4 lines.

#
source /usr/share/init/tcsh/rc
#
set path=( $path /Users/kojiok/GMT3.4.1/bin /Users/kojiok/GMT3.4.1/lib/ Users/kojiok/GMT3.4.1/share )


11 Change terminal preference.
Startup: Check "Create a new shell window"
Shell: Check "Use default login shell for this user"
Quit terminal [IMPORTANT!].

12 Try GMT!
Start terminal
.
In Terminal, just type
[localhost/-] kojiok% pscoast

If the list of options are displayed, you are ready to use GMT.
Congratulations!

13 Install Adobe Illustrator or Ghostview2.5.1 for Mac OSX to view EPS output.

Adobe Illustrator is a supreme graphic interface for GMT graphics. You can edit all details with the subtlest touch saving the time and energy for blind efforts in command lines. Let the GMT do mapping and you do the arts.