GEMPAK Installation for Mac OS X
This installation document, created by Kevin Tyle, University of Albany, serves to guide users through building the latest version of GEMPAK on Intel Mac OS X 10.6 (Snow Leopard) and 10.7 (Lion) with the GCC 4.5 compilers, and should also work for 10.5 (Leopard). Earlier versions/CPUs of OS X are untested.
The following steps should lead to a successful build, with a user account with admin (sudo) privileges.
1. Install Xcode
Prior to
Lion (10.7), Xcode can be found as an optional install on the install DVD, or (again pre-Lion) you can download the latest disk image of Xcode from the Apple Developer web site (you will have to register in order to download the .dmg file):
http://developer.apple.com/technologies/tools/xcode.html
For Mountain Lion (10.8), Xcode can be downloaded from the Mac App Store, Command Line Tools are optional, so you must install it manually in the Preferencs tab:

This is required for Macports to operate correctly.
2. Install MacPorts Packages
If you don't have MacPorts installed for your version of OS X, download and install the program from
macports.org. Once installed, your
.profile or
.cshrc should have
/opt/local/bin first in your path. Check to be sure this is the case before proceeding, and resource your
.profile or
.cshrc if not.
Using MacPorts, install several packages (all necessary pre-requisites of each package will automatically be downloaded and installed first, similar to "yum install" in CentOS/Fedora flavors of Linux). Perform some configuration following the installation of some of them. The sequence is as follows:
- a. Install gcc45. This will take a long time, perhaps even a couple hours if you are on a slower/low-RAM system.
sudo port install gcc45
- b. Install gcc_select
sudo port install gcc_select
- c. Make gcc45 the default compiler
sudo port select gcc mp-gcc45
- d. Install a variety of xorg packages, culminating with the libXtst package
sudo port install xorg-libXtst
- e. Install a variety of packages that are prerequisites for OpenMotif, which you will build from source in the next step.
sudo port install fontconfig jpeg libpng
sudo port install splint xbitmaps Xft2
sudo port install xorg-libXp xorg-libXmu xpm
Installing fontconfig will also install freetype.
Installing Xft2 will also install xorg-renderproto and libXrender.
Installing xorg-libXp will also install xorg-printproto.
Installing xorg-libXmu will also install xorg-libXt, xorg-libsm and xorg-libice.
3. Install OpenMotif
The GEMPAK graphical programs, such as NMAP2 and NWX, require OpenMotif. This is no longer available from MacPorts, so you need to download and install OpenMotif 2.3.3. Unfortunately the OpenMotif source obtained from motifzone.net will produce compilation errors on OS X systems, so the UPC has provided the package with necessary edits in order to correctly build on your system.
- a. Obtain the OpenMotif OS X specific tarball from the GEMPAK downloads page. Untar this in a directory of your choice. cd into it.
- b. Set the CFLAGS and LDFLAGS environment variables: if using a Bourne-like shell, type:
export CFLAGS="-I/opt/local/include"; export LDFLAGS="-L/opt/local/lib"
If using a C-like shell, type
setenv CFLAGS -I/opt/local/include; setenv LDFLAGS -L/opt/local/lib
- c. In the top level of OpenMotif 2.3.3, configure, build, and install:
configure --prefix=/opt/local; make all
Check that there are no build errors. If so, you probably missed one of the port install steps above. If no errors occur, install OpenMotif:
sudo make install
4. Build and Install GEMPAK
Extract the GEMPAK tarball archive obtained from the
GEMPAK Downloads page and modify
Gemenviron or
Gemenviron.profile depending on your shell so that the environmental variable
$NAWIPS is set to the correct directory path. Then cd into the
$NAWIPS directory (this is the parent directory of the GEMPAK/N-AWIPS directory tree).
Be sure you are cd'd into the top level GEMPAK6.6.0 directory at this time. Type
make > make.out
to build the package, which may take a long time, depending on the speed of your computer. In a separate window, you can watch the compilation process by typing
tail -f make.out
Once done, verify there are no fatal errors in the
make.out file (there should be two non-critical
Error 2 messages but no
Error 1 messages. If all went well, run
make install
and you should be good-to-go.
5. Troubleshooting
No doubt some individuals with different CPUs/OS versions may discover some problems not mentioned or covered here. Although basic run-time testing on OS X-compiled GEMPAK has been successful, it's possible there may be bugs in the OS X build which are not seen on other platforms. Users can report known probelms to Unidata's GEMPAK Support desk (
support-gempak@unidata.ucar.edu), and are encouraged to post updates and questions to the GEMBUD mailing list (
gembud@unidata.ucar.edu) as well.
Corrections and comments concerning this guide can be sent to support-gempak@unidata.ucar.edu