Installing GSAS/EXPGUI under Mac OS X

These are approximate directions for installing GSAS & EXPGUI on a Macintosh OS X machine. The software has been built using OS X 10.2.6 and has been installed successfully on 10.2 and 10.3 machines. Note that most users will probably have already installed X11 and FINK on their computers. Most OS X books can provide more information on how to do this.

  1. Install X11
    This can be done from your OS (Jaguar or Panther) CD-ROM or can be downloaded from http://www.apple.com/macosx/features/x11/download/ . (Please do not contact me for help with this -- I have never done it).

  2. Install FINK
    This software can be downloaded from http://fink.sourceforge.net/ . Download the package and then double-click on it. (Please do not contact me for help with this -- I have never done it).

  3. Download and install required packages.
    GSAS requires a the "Portable Network Graphics" (libpng3) library. EXPGUI requires the X11 (not Aqua) Tcl/Tk and BLT packages. There is more than one way to install them. For example, you can use the fink command to compile and install packages from source code. The easier way is to simply download binary versions. With FINK installed this is easy, use this command in a terminal or X11 xterm window:
         sudo apt-get install tcltk blt libpng3-shlibs
    (I am probably not the best person to provide help on this either.)

  4. Download the GSAS & EXPGUI programs.
    Download this file from the NIST website: ftp://ftp.ncnr.nist.gov/pub/cryst/gsas/osx_gsaskit.tar.gz (~7 Mb) These files can also be downloaded from the CCP14 mirrors [(UK), (Canada), (US) or (Australia)].

    Note that if you have StuffIt installed, the compressed osx_gsaskit.tar.gz may be expanded to osx_gsaskit.tar and the contents (folder gsas) may be created automatically. In this case you can simply move this folder to the desired location.

    If you need to expand and extract the files from the tar.gz file "manually" you can do this in a terminal or X11 xterm window. Assuming that you downloaded the above file to your desktop and wish to install the files in directory /Users/[me]/Programs/gsas (where [me] is your username), you will use commands like this:

         mkdir -p Programs/gsas
         cd Programs
         tar xvzf ~/Desktop/osx_gsaskit.tar.gz
    If you wish to retrieve the files from the expanded osx_gsaskit.tar file, replace the last command with this:
         tar xvf ~/Desktop/osx_gsaskit.tar
  5. Make shortcuts to run EXPGUI
    At this point you are able to run EXPGUI using the full command name from inside an X11 window -- by typing a command such as this:
    but this gets old fast. Here are some different approaches that can be used to make EXPGUI easier to run:

Mac ideosyncracies

Unlike the Windows & Unix ports, Mac windows may not be updated until you click on them. This is seems to be the case for PGPLOT windows (in POWPLOT, RAWPLOT,...) after the first plot. After typing the command to update the graph, click on the window bar and the plot will update.


If you cannot get EXPGUI or the GSAS graphics programs to work, you may have a setup problem with X-windows (X11). As an example, when I start a terminal window, there is no definition for the X11 display (this does work correctly by starting an xterm session in X11). A quick test is to type xclock at the prompt:
     bash-2.05a$ xclock
If you get a clock display -- great. If you get the following error message the DISPLAY variable is not set:
     bash-2.05a$ xclock
     Error: Can't open display: 
If on the other hand, you get this error message, there is a problem with Xwindows:
     bash-2.05a$ xclock
     Error: Can't open display: localhost:0.0
You can set the DISPLAY variable in bash/zsh, etc. using:
     bash-2.05a$ export DISPLAY=localhost:0.0
or in csh/tcsh, etc. using:
     [d120234:~] toby% setenv DISPLAY localhost:0.0
You can test if Tcl/Tk and the BLT package are installed correctly using the following commands:
     [d120234:~] toby% wish
     % package require BLT
     % pack [blt::graph .g]
     % exit
When you type "wish" and press Enter, a new small blank window should appear. when you type the 2nd line, "package require BLT," there will be no change in the blank window, but the computer should respond "2.4". After the "pack [blt::graph .g]" command is entered, a set of x- and y-axes should appear in this window. The window should disappear after "exit" is typed.

GSAS is Copyright, 1984-2000, by the Regents of the University of California. The GSAS software was produced under a U.S. Government contract (W-7405-ENG-36) by the Los Alamos National Laboratory, which is operated by the University of California for the U.S. Department of Energy. The U.S. Government is licensed to use, reproduce, and distribute this software. Permission is granted to the public to copy and use this software without charge, provided that this notice and any statement of authorship are reproduced on all copies. Neither the Government nor the University makes any warranty, express or implied, or assumes any liability or responsibility for the use of this software.

The author of EXPGUI is a U.S. Government employee which means that EXPGUI is not subject to copyright. Have fun with it. Modify it. Please write new sections and make them available to the rest of the world.

Neither the U.S. Government nor any author makes any warranty, expressed or implied, or assumes any liability or responsibility for the use of this information or the software described here. Brand names cited herein are used for identification purposes and do not constitute an endorsement by NIST.

Questions/Problems: crystal@nist.gov
$Revision: 767 $ $Date: 2009-12-04 23:11:41 +0000 (Fri, 04 Dec 2009) $