This is a archived web page. Please visit the latest version here

gv for Mac OS X

gv is useful for displaying Postscript files, such as those created with GMT, from the command line and can be included easily in plotting scripts.

gv requires the Xaw3d libraries and header files, which are not included in Apple's Xcode developer suite. One must therefore install Xaw3d first.

Installing Xaw3d (version 1.5E and prior)

This process is complicated somewhat by the fact that xmkmf, part of imake and required to build the now fairly old Xaw3d, is no longer distributed. xmkmf was last released with Xcode 3.1 for Mac OS X 10.5 (Leopard).

As a result, it is not possible to create a Makefile from the Imakefile distributed with the source code. However, I have kept a copy of the Makefile I created when still operating Mac OS X 10.5 (Leopard) and Xcode 3.1. I can only assume in what I provide here that no major or significant differences would be apparent with later OS X releases.

The latest Xaw3d source code release (2003-04-15) may be downloaded here. Unzip and expand the tar-file in an appropriate directory. A hierarchy of directories (xc/lib/Xaw3d/) will have been produced. Either move the Xaw3d to the current working directory, e.g.

mv xc/lib/Xaw3d .

or change directory to xc/lib/Xaw3d/, e.g.

cd xc/lib/Xaw3d/

Copy my Makefile to this top-level Xaw3d/ directory and, from this directory, first make the includes, e.g.

make includes

N.B. If you do not rename the downloaded file to "Makefile", you must add an option to the make command to override this default, e.g.

make -f Makefile.Xaw3d includes

This will have created an exports/include/X11/Xaw3d/ directory. Copy this directory to wherever your X11 includes are. These are likely to be system directories and the copy will require administrator privileges. On Mac OS X 10.6 (Snow Leopard) and 10.7 (Lion), the location is /usr/X11/include/X11/, e.g.

sudo cp -pri exports/include/X11/Xaw3d /usr/X11/include/X11/

Next, create the dependencies, e.g.

make depend

Now one can make and install the library, and clean up, e.g.

make
sudo make install
sudo make clean

Installing gv

With Xaw3d installed, one may now install gv from source. The source code is available here (latest version is 3.7.3).

On Mac, the configuration seems to require the addition of the --enable-SIGCHLD-fallback flag (I also include the X libraries and includes although I don't know if these are really necessary), e.g.

./configure --x-includes=/usr/X11/include/X11 --x-libraries=/usr/X11/lib --enable-SIGCHLD-fallback

followed by the usual sequence of make commands, e.g.

make
sudo make install
make clean

This will install gv in /usr/local/bin/, which should make gv available through the system's default paths.