Installing MDX for Mac OS X

MDX is a visualisation tool developed at and licensed by JPL. It requires a set of libraries that are no longer distributed with Apple's latest Xcode releases. This tutorial provides information on how to install MDX on Mac OS X (Snow Leopard with Xcode 3.2 or Lion with Xcode 4.3). It is assumed that Xcode (or Command Line Tools for Xcode) and gfortran are already installed.

  1. Download and install the latest OpenMotif package for Mac, which contains necessary 'Xm' libraries, from a server:


    The installation will be made under /usr/OpenMotif which requires the administrator password.

  2. Unzip the MDX source code in an appropriate place for installation. For example, I have ROI_PAC installed in /usr/local/ROI_PAC_3_0_1/ and this is where I install MDX.

  3. Change directory to the MDX source code. If there is a file 'Makefile_gfortran', copy this to 'Makefile', i.e.

    cp Makefile_gfortran Makefile

  4. Edit the following in Makefile, using the fundamentals already contained within it, to ensure they are present and not commented out:

    FC = gfortran

    FFLAGS = -DIO64 -ffixed-line-length -O

    CC = gcc

    CFLAGS = -DSUN -DIO64 -O

    XINC = -I/usr/X11/include -I/usr/OpenMotif/include

    XLIB = -I/usr/OpenMotif/lib -lXm -L/usr/X11/lib -lXmu -lXt -lXp -lX11 -lXext -lgfortran

    Other lines can be left as they are. N.B. -DIO64 is the only macro technically available for FFLAGS (it is superfluous to have any -DM10 or -DSUN option) but the -DSUN (or, alternatively and identically, -DSGI) macro option seems necessary for successful compilation on Macs.

  5. Remove all existing file builds:

    rm -f *.o

  6. Run make

    make all

  7. Finally, create a link to the newly created executable file in an existing path, e.g.

    ln -s `pwd`/mdx /usr/local/bin/mdx

    or

    ln -s `pwd`/mdx $INT_BIN/mdx

    where $INT_BIN is an environment variable defined for ROI_PAC.