Changeset 773 for trunk/doc/osx.html

Dec 4, 2009 5:11:47 PM (13 years ago)

# on 2004/01/30 00:47:28, toby did:
revise to match new version

1 edited


  • trunk/doc/osx.html

    • Property rcs:date changed from 2004/01/12 19:42:37 to 2004/01/30 00:47:28
    • Property rcs:lines changed from +32 -20 to +206 -158
    • Property rcs:rev changed from 1.2 to 1.3
    r767 r773  
    32 These are approximate directions for installing GSAS & EXPGUI on a
    33 Macintosh OS X machine. The software has been built using OS X 10.2.6
     32This page contains information on installing and running GSAS & EXPGUI
     33on Macintosh OS X computers. The software has been built using OS X 10.2.6
    3434and has been installed successfully on 10.2 and 10.3 machines.
    35 Note that most users will probably have already installed X11 and
    36 FINK on their computers. Most OS X books can provide more information
    37 on how to do this.
     37The following summarizes the steps needed to load prerequisite software
     38as well as the GSAS/EXPGUI distribution.
     39I presume that most Mac users will probably have already installed X11 and
     40FINK on their computers. I have very limited experience with this, so please
     41do not contact me for help with steps 1-3. However,
     42most OS X books can provide more details beyond what is given here.
    4752</A>. </I>
    48 (Please do not contact me for help with this -- I have never done it).
    5155<P><LI>Install FINK
    53 This software can be downloaded from
     57To do this, you will need to install the Development Tools,
     58which are distributed with OS X as well as the FINK package,
     59which can be downloaded from
    5460<a href="
    5763</A>. Download the package and then double-click on it.
    58 </I>(Please do not contact me for help with this -- I have never done it).
    6268<P><LI>Download and install required packages.
    64 GSAS requires a the "Portable Network Graphics" (libpng3) library.
    65 EXPGUI requires the X11 (not Aqua) Tcl/Tk and BLT packages.
    66 There is more than one way to install them. For example, you can use the
    67 fink command to compile and install packages from source code. The
    68 easier way is to simply download binary versions. With FINK installed
    69 this is easy, use this command in a terminal or X11 xterm window:</I>
    70 <PRE>
    71      sudo apt-get install tcltk blt libpng3-shlibs
    72 </PRE>
    73 (I am probably not the best person to provide help on this either.)
    74 </DL></DL>
    76 <P><LI>Download the GSAS & EXPGUI programs.
    77 <DL><DL><I>
    78 Download this file from the NIST website:
    79 </I>
    80 <a href="">
    81</a> (~7 Mb)
    82 <I>
    83 These files can also be downloaded from the CCP14 mirrors</I>
     70GSAS requires the "Portable Network Graphics" (libpng3) library.
     71EXPGUI requires the X11 (not Aqua) version of Tcl/Tk package;
     72installation of the BLT add-on for Tcl/Tk is needed for plotting
     73from EXPGUI (for example, <A Href="liveplot.html">LIVEPLOT</A>).
     74There are many ways to install this software.
     75One way is to type in <a href="#FinkAptGet">Fink (apt-get) commands, as
     76described below.</a>
     77A more "Mac-appropriate" approach is to avoid use of the command line
     78completely and with a user-friendly front-end,
     79<a href="#FinkCommander">FinkCommander, also described below.</a></I>
     82<P><LI>Download the GSAS & EXPGUI programs as a Mac disk image.
     84<I>Download this file from the NIST website:</I>
     86<a href="">
     87</a> (~7 Mb)
     89<I>These files can also be downloaded from the CCP14 mirrors:</I>
    8490[(<a href="
    8793(<a href="
    9096(<a href="
    91 url="
    9298>US</a>) or
    9399(<a href="
    97 <I>
    98 Note that if you have StuffIt installed, the compressed osx_gsaskit.tar.gz
    99 may be expanded to osx_gsaskit.tar and the contents (folder gsas)
    100 may be created automatically.
    101 In this case you can simply move this folder to the desired
    102 location.</I>
    103 <P>
    104 <I>
    105 If you need to expand and extract the files from the tar.gz file "manually"
    106 you can do this in a terminal or X11 xterm window.
    107 Assuming that you downloaded the above file to your desktop and wish to install
    108 the files in directory </I>/Users/[me]/Programs/gsas<I>
    109 (where </I>[me]<I> is your username), you will use commands like this:
    110 </I>
    111 <PRE>
    112      cd
    113      mkdir -p Programs/gsas
    114      cd Programs
    115      tar xvzf ~/Desktop/osx_gsaskit.tar.gz
    116 </PRE>
    117 If you wish to retrieve the files from the expanded osx_gsaskit.tar file,
    118 replace the last command with this:
    119 <PRE>
    120      tar xvf ~/Desktop/osx_gsaskit.tar
    121 </PRE>
    122 </DL></DL>
    124 <LI>Make shortcuts to run EXPGUI
    125 <DL><DL><I>
     104<I>What happens when you download this file depends on your method for
     105downloading. Some browsers will automatically perform the next step for
     108Mount this file by double-clicking on it. This should create a new volume in
     109your top-level ("Computer") called "GSASvol"; clicking on this device will open
     110a finder window with a single folder ("gsas") present.
     112<I>While you can run GSAS & EXPGUI from this location, you are strongly
     113suggested to instead copy the entire package to your computer by dragging the
     114gsas folder icon to another finder window, or by clicking on it and using
     115Copy and Paste.</I>
    126117At this point you are able to run EXPGUI using the full command name
    127118from inside an X11 window -- by typing a command such as this:
     120     /MyApps/gsas/expgui/expgui
     124     /sw/bin/wish /MyApps/gsas/expgui/expgui
     128but this gets old fast -- see the following section for a better way.
     131<LI>Install a "shortcut" to launch EXPGUI
     133<I>The following
     134instructions describe ways that the EXPGUI program can be integrated
     135into the Mac environment.
     137<IMG SRC="expgui_osx.jpg" ALT="EXPGUI AppleScript icon" ALIGN="RIGHT">
     138The OSX version of GSAS & EXPGUI has an EXPGUI AppleScript application
     139in the "gsas" folder with the icon shown
     140to the right. This AppleScript will start X11,
     141if needed and then lauch EXPGUI. (If you have ideas for improving the script,
     142the code can be found in file expgui_applescript.txt.)
     143The EXPGUI AppleScript can be used in three ways:
     145<P><LI>Double-clicking on the icon will launch EXPGUI so that it starts
     146with the "file open" window in your home directory. This
     147window can then be used to navigate to
     148access/create experiments in other folders.
     149<P><LI>Dropping one or more GSAS Experiment (.EXP) files onto the EXPGUI icon
     150will cause the experiment files to be opened. If more than one file is dropped,
     151each file will open in a separate EXPGUI session.
     152<P><LI>Dropping one or more folders onto the EXPGUI icon will cause EXPGUI to be
     153started with the "file open" window in that folder.
     156You may find it convenient to drag the EXPGUI icon to the dock,
     157for easy access.
     158Note, that this <B><U>EXPGUI app will not
     159work correctly if copied or moved to another folder</U></B> -- instead
     160create an alias (for example using the Finder Command-L key). An alias
     161can be moved where desired -- for example, to
     162the desktop or to the Application folder.
     165<LI>Make a command-line "shortcut" to run EXPGUI
     168If you are a "Unix enthusiast," you might be interested in setting up
     169command line short-cuts to the gsas script and the EXPGUI program; however,
     170my presumption is that most people buy Mac's to avoid using the command line.
     171Those people who wish to define a command line short-cut should
     172see section 2.2 in the
     173<A Href="expgui_Unix_readme.html">Unix installation notes</A>.
    129 <PRE>
    130      /Users/[me]/Programs/gsas/expgui/expgui
    131 </PRE>
    132 <I>
    133 but this gets old fast. Here are some different approaches that can be used
    134 to make EXPGUI easier to run:
    135 </I>
    136 </DL></DL>
    137 <UL>
    138 <P><LI><B>Create alias commands</B>
    139 <DL><DL>
    140 <P><I>Do this by placing alias commands into your ~/.cshrc file:</I>
    141 <PRE>
    142    alias expgui      /sw/bin/wish /Applications/gsas/expgui/expgui
    143    alias gsas        /Applications/gsas/gsas
    144 </PRE>
    145 (where /Applications is the location where you have installed GSAS.)
    146 <I>The above applies to users of the csh & tcsh shells. (You can find what
    147 shell you use by typing</I>
    148 <PRE>     echo $SHELL</PRE>
    149 <I>If you use bash, etc., you will put the commands in
    150 your ~/.profile file and the syntax is this:</I>
    151 <PRE>
    152    alias expgui='/sw/bin/wish /Applications/gsas/expgui/expgui'
    153    alias gsas='/Applications/gsas/gsas'
    154 </PRE>
    155 <P>
    156 <I>When this is done, restart X11 and from an X11 window you can type </I>
    157 <PRE>    gsas</PRE> or
    158 <PRE>    expgui</pre>
    159 <I>Note that this will also work:</I>
    160 <PRE>    expgui EXPFILE.EXP</pre>
    162 </DL></DL>
    163 <a name="AppleScript">
    164 </a><P><LI><B>Create an AppleScript to run EXPGUI</B>
    165 <DL><DL>
    166 <IMG SRC="osx1.jpg" ALT="EXPGUI menu" ALIGN="RIGHT">
    167 When run in OS X, a special menu appears in the EXPGUI file menu,
    168 "Create AppleScript," as shown to the right. When this is selected,
    169 you are asked to select a default starting directory for EXPGUI (this
    170 is for convenience; you can move to and work with .EXP files located
    171 in any directory.) You also select a directory and file name to save
    172 the script. Note that the default for this, ~/Library/Scripts/EXPGUI.scpt,
    173 will place the script in your "Script Menu" (see
    174 <a href="
    177 <BR CLEAR="ALL">
    178 </DL></DL>
    180 <a name="CompileAppleScript">
    181 <P><LI><B>Create an Applet/Droplet to run EXPGUI</B>
    182 <DL><DL>
    183 If you double-click on the EXPGUI AppleScript, created above, you
    184 will open it in the Script Editor, where you can convert it from
    185 a "Compiled Script" to a "Application". This application can then be
    186 used to start EXPGUI if doubled-clicked in a Finder window or on the desktop.
    187 You can also drag experiment (.EXP) files onto the icon to launch EXPGUI on
    188 those files (if you drag more than one .EXP file, an EXPGUI window is opened
    189 for each file -- use with care if you are short on memory).
    190 <P>
    191 To create an application from within the Script Editor, use the
    192 "File/Save As" menu option and be sure to select "Application" as the Format,
    193 as is shown below. I suggest that you also select the
    194 "Never Show Startup Screen" option, as is also shown below.
    195 You can call the file anything, although EXPGUI makes a
    196 certain amount of sense. You can put this file anywhere you choose,
    197 but either placing it on the dock or desktop makes a lot of sense.
    198 <P>
    199 </DL></DL>
    200 <IMG SRC="osx2.jpg" ALT="Script Editor save as options" ALIGN="TEXTTOP">
    201 <DL><DL>
    202 <P>
    203 To change the icon, you can to the following:
    204 <UL>
    205 <IMG SRC="expgui.jpg" ALIGN=RIGHT ALT="Sample 128x128 EXPGUI icon">
    206 <LI>copy into the clipboard whatever image you would like to use,
    207 such as the image to the right, which can also be
    208 found as file .../gsas/expgui.icns. (I am hoping
    209 that someone with more talent can contribute something better.)
    210 <LI>Control-click on the EXPGUI app file
    211 <LI>Click on the tiny icon under the word "general"
    212 <LI>Paste the picture from the clipboard (Edit/Paste or Apple-V)
    213 <BR CLEAR="ALL">
    214 </UL>
    215 </DL></DL>
    218 <P>
    219 <B>Open questions:</B> I am far from a Mac expert. Several problems
    220 I would like to solve are:
    221 <OL>
    222 <LI>Is there a way to create an application, as opposed to a compiled script,
    223 directly from an AppleScript, so I can do this for the user?
    224 <LI>Can I associate an icon with an app/script from within an AppleScript
    225 (so I can do it automatically)?
    226 <LI>Are there other (better?) ways to integrate AppleScripts into
    227 OS X for easy use.
    229 If you have any advice, please send it my way.
    230 </OL>
    232 <HR><HR>
     179<HR noshade><HR noshade>
     180<h4>EXPGUI Enhancements specific to the Mac</H4>
     182EXPGUI will automatically designate the EXPGUI AppleScript
     183as the "open with" application for every GSAS experiment (.EXP) file
     184that is read or written by EXPGUI, provided that the Development Tools program
     185Rez is found in /Developer/Tools.
     186At the same, EXPGUI will also designate an icon for the .EXP file.
     187After this is done, EXPGUI can be invoked by simply double-clicking on
     188a GSAS experiment file.
     190If for some reason you would prefer this not be done
     191(I would be interested to hear why) -- deselect the
     192"Assign app to .EXP files" checkbox in the Options menu.
     194<HR noshade><HR noshade>
    233195<h4>Mac ideosyncracies</H4>
    235 Unlike the Windows & Unix ports, Mac windows may not be updated
    236 until you click on them. This is seems to be the case for PGPLOT
    237 windows (in POWPLOT, RAWPLOT,...) after the first plot. After typing the
    238 command to update the graph, click on the window bar and the plot will
     197Unlike in the Windows & Unix versions of GSAS, Mac windows may not be updated
     198until they are brought to the top of the screen by clicking on them
     199(given focus). This is most noticible for PGPLOT
     200graphics (in POWPLOT, RAWPLOT,...).
     201When you type graphics commands in a terminal window, the plot does not
     202appear to change. However, click on the PGPLOT's window bar and the plot will
    240 <HR><HR>
     205<HR noshade><HR noshade>
     206<a name="FinkAptGet"></a><h4>Installing software from the command line</H4>
     207With FINK installed, it is possible to download and install binary
     208versions of the required programs by entering the following command
     209in a terminal or xterm window:</I>
     211     sudo apt-get install tcltk blt libpng3-shlibs
     214<HR noshade><HR noshade>
     216<a name="FinkCommander"></a><h4>Installing software using FinkCommander</H4>
     217  <p><em>A second method, which is recommended for everyone other than UNIX
     218        gurus, is to use instead the &quot;FinkCommander&quot; application,
     219        which is provided in a separate directory
     220    (of the same name: see picture below). After installing the fink package
     221        (&quot;Fink... Installer.pkg&quot;),
     222     launch &quot;FinkCommander&quot;. &quot;FinkCommander&quot;
     223     which is a
     224     GUI interface for fink (that allows you to avoid having to
     225     remember these ugly-, long-, obsure and esoteric
     226     UNIX-styled commands)</em>
     227  <p>
     228    In &quot;FinkCommander&quot;, with your computer connected to the
     229    internet, simply use &quot;Update-all&quot;
     230    (in the &quot;Source&quot; menu)
     231    the first time you run &quot;FinkCommander&quot;,
     232    then be patient while Fink tabulates a list of the latest versions of
     233    all available OS X software packages.
     235  <p>Then, in the "binary" menu, select
     236      the &quot;blt&quot; package and ask to install it
     237      (from a binary distribution) using the "install" command,
     238      as shown in the picture below.
     239      Since FinkCommander will automatically load the packages required by
     240      blt (dependencies), this will also cause Tcl/Tk to be loaded or
     241      updated.
     242      <P>
     243      Repeat this step to install the &quot;libpng3&quot; library.
     244      <P>
     245  <table width="75%" border="1">
     246    <tr>
     247      <td width="55%">
     248      <a href="FinKComImage2.jpg" target="_blank">
     249      <img src="FinKComImage2.jpg" width="400" height="300" border="0">
     250      </a></td>
     251      <td width="45%"><p>The &quot;FinkCommander&quot; folder on
     252            the desktop (back window) and application (front window) showing
     253         the installation of the binary
     254            &quot;blt&quot; package.
     255        <p>(click to enlarge)</p></td>
     256    </tr>
     257  </table>
     258  <dt></dt>
     259  <p><em>Depending on which version of OS X you have, and the
     260         versions of the available binary distributions, it is possible that
     261         the above may not work. If this occurs,
     262          simply repeat the process, but this time use the install command
     263          from the source menu.
     264        The will achieve the same result, but will take much longer
     265        (say 15-45 minutes) as Fink will download and compile the source codes
     266        for the various packages.</em>
     268<HR noshade><HR noshade>
    242271If you cannot get EXPGUI or the GSAS graphics programs to work,
    243 you may have a setup problem with X-windows (X11). As an example, when I start
    244 a terminal window, there is no definition for the X11 display (this does
    245 work correctly by starting an xterm session in X11).
    246 A quick test is to type xclock at the prompt:
     272you may have a setup problem with X-windows (X11).
     273One common reason for this is that X11 must be restarted any time
     274your computer's IP address changes. This can happen when you connect your
     275Mac to a network directly or with a modem. Your IP address can change even
     276while your computer is wired into a network.
     278If exiting and restarting X11 does not address your problem,
     279the following paragraphs
     280may help you diagnose problems.
     282One possible problem is the definition for the X11 display (shell
     283environment variable DISPLAY).
     284On my machine, this variable is set correctly in an X11 xterm window, but
     285is not set by default within an Aqua terminal window.
     287A quick test for this is to type xclock at the shell prompt:
    273314     [d120234:~] toby% setenv DISPLAY localhost:0.0
     317A second possible problem relates to the installation of the
     318Tcl/Tk and BLT packages.
    276319You can test if Tcl/Tk and the BLT package are installed correctly using the
    277320following commands:
    288331"pack [blt::graph .g]" command is entered, a set of x- and y-axes should appear
    289332in this window. The window should disappear after "exit" is typed.
     337  The EXPGUI icon, the original version of the EXPGUI AppleScript
     338  and help with this documentation was provided by
     339  Francois Farges -- many thanks!
    292341<P>GSAS is Copyright, 1984-2000, by
    293342the Regents of the University of California.
Note: See TracChangeset for help on using the changeset viewer.