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.
Installing GSAS/EXPGUI under Mac OS X
- 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).
- 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).
- 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.)
- 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:cd mkdir -p Programs/gsas cd Programs tar xvzf ~/Desktop/osx_gsaskit.tar.gzIf 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
- 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:/Users/[me]/Programs/gsas/expgui/expguibut this gets old fast. Here are some different approaches that can be used to make EXPGUI easier to run:
- Create alias commands
Do this by placing alias commands into your ~/.cshrc file:alias expgui /sw/bin/wish /Applications/gsas/expgui/expgui alias gsas /Applications/gsas/gsas(where /Applications is the location where you have installed GSAS.) The above applies to users of the csh & tcsh shells. (You can find what shell you use by typingecho $SHELLIf you use bash, etc., you will put the commands in your ~/.profile file and the syntax is this:alias expgui='/sw/bin/wish /Applications/gsas/expgui/expgui' alias gsas='/Applications/gsas/gsas'
When this is done, restart X11 and from an X11 window you can typegsasorexpguiNote that this will also work:expgui EXPFILE.EXP
- Create an AppleScript to run EXPGUI
When run in OS X, a special menu appears in the EXPGUI file menu, "Create AppleScript," as shown to the right. When this is selected, you are asked to select a default starting directory for EXPGUI (this is for convenience; you can move to and work with .EXP files located in any directory.) You also select a directory and file name to save the script. Note that the default for this, ~/Library/Scripts/EXPGUI.scpt, will place the script in your "Script Menu" (see http://www.apple.com/applescript/scriptmenu).
- Create an Applet/Droplet to run EXPGUI
If you double-click on the EXPGUI AppleScript, created above, you will open it in the Script Editor, where you can convert it from a "Compiled Script" to a "Application". This application can then be used to start EXPGUI if doubled-clicked in a Finder window or on the desktop. You can also drag experiment (.EXP) files onto the icon to launch EXPGUI on those files (if you drag more than one .EXP file, an EXPGUI window is opened for each file -- use with care if you are short on memory).
To create an application from within the Script Editor, use the "File/Save As" menu option and be sure to select "Application" as the Format, as is shown below. I suggest that you also select the "Never Show Startup Screen" option, as is also shown below. You can call the file anything, although EXPGUI makes a certain amount of sense. You can put this file anywhere you choose, but either placing it on the dock or desktop makes a lot of sense.
To change the icon, you can to the following:
- copy into the clipboard whatever image you would like to use, such as the image to the right, which can also be found as file .../gsas/expgui.icns. (I am hoping that someone with more talent can contribute something better.)
- Control-click on the EXPGUI app file
- Click on the tiny icon under the word "general"
- Paste the picture from the clipboard (Edit/Paste or Apple-V)
Open questions: I am far from a Mac expert. Several problems I would like to solve are:
If you have any advice, please send it my way.
- Is there a way to create an application, as opposed to a compiled script, directly from an AppleScript, so I can do this for the user?
- Can I associate an icon with an app/script from within an AppleScript (so I can do it automatically)?
- Are there other (better?) ways to integrate AppleScripts into OS X for easy use.
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.
ProblemsIf 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$ xclockIf 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.0You can set the DISPLAY variable in bash/zsh, etc. using:bash-2.05a$ export DISPLAY=localhost:0.0or in csh/tcsh, etc. using:[d120234:~] toby% setenv DISPLAY localhost:0.0You can test if Tcl/Tk and the BLT package are installed correctly using the following commands:[d120234:~] toby% wish % package require BLT 2.4 % pack [blt::graph .g] % exitWhen 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.
$Revision: 767 $ $Date: 2009-12-04 23:11:41 +0000 (Fri, 04 Dec 2009) $