source: trunk/doc/osx.html @ 767

Last change on this file since 767 was 767, checked in by toby, 12 years ago

# on 2004/01/12 19:42:37, toby did:
work in progress

  • Property rcs:author set to toby
  • Property rcs:date set to 2004/01/12 19:42:37
  • Property rcs:lines set to +32 -20
  • Property rcs:rev set to 1.2
  • Property rcs:state set to Exp
  • Property svn:keywords set to Author Date Revision Id
File size: 11.6 KB
Line 
1<HTML>
2<HEAD>
3   <TITLE>Mac OS X Installation Notes for EXPGUI</TITLE>
4   <meta name="keywords" content="crystallography, Rietveld, diffraction,
5   GSAS, EXPGUI, Mac, OS X">
6</HEAD>
7<style>
8A:link {text-decoration:none}
9A:vlink {text-decoration:none}
10</style>
11
12<BODY BGCOLOR="#FFFFFF"
13      topmargin="0" leftmargin="0" marginwidth="0" marginheight="0" 
14      text="#000000" link="#0033ff" vlink="#0033ff" alink="#0033ff">
15
16<?
17   include("/var/www/include/navigation.inc");
18   include("/var/www/include/utility.inc");
19?>
20<blockquote><font face="arial, helvetica, sans-serif">
21
22<TABLE BORDER BGCOLOR="#FFFF40" ALIGN=RIGHT>
23<TR><TH><A  Href="expgui.html">EXPGUI home</A> 
24</TH></TR></TABLE><BR CLEAR=ALL>
25<CENTER><H1>
26<HR noshade width="75%" size="2" align="center">
27Installing GSAS/EXPGUI under Mac OS X
28<HR noshade width="75%" size="2" align="center">
29</H1></CENTER>
30
31
32These are approximate directions for installing GSAS & EXPGUI on a
33Macintosh OS X machine. The software has been built using OS X 10.2.6
34and has been installed successfully on 10.2 and 10.3 machines.
35Note that most users will probably have already installed X11 and
36FINK on their computers. Most OS X books can provide more information
37on how to do this.
38
39<OL>
40<P><LI>Install X11
41<DL><DL><I>
42This can be done from your OS (Jaguar or Panther) CD-ROM or can be
43downloaded from
44<a href="http://www.nist.gov/cgi-bin/exit_nist.cgi?url=
45http://www.apple.com/macosx/features/x11/download/"
46>http://www.apple.com/macosx/features/x11/download/
47</A>. </I>
48(Please do not contact me for help with this -- I have never done it).
49</DL></DL>
50
51<P><LI>Install FINK
52<DL><DL><I>
53This software can be downloaded from
54<a href="http://www.nist.gov/cgi-bin/exit_nist.cgi?url=
55http://fink.sourceforge.net/"
56>http://fink.sourceforge.net/
57</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).
59</DL></DL>
60
61
62<P><LI>Download and install required packages.
63<DL><DL><I>
64GSAS requires a the "Portable Network Graphics" (libpng3) library.
65EXPGUI requires the X11 (not Aqua) Tcl/Tk and BLT packages.
66There is more than one way to install them. For example, you can use the
67fink command to compile and install packages from source code. The
68easier way is to simply download binary versions. With FINK installed
69this 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>
75
76<P><LI>Download the GSAS & EXPGUI programs.
77<DL><DL><I>
78Download this file from the NIST website:
79</I>
80<a href="ftp://ftp.ncnr.nist.gov/pub/cryst/gsas/osx_gsaskit.tar.gz">
81ftp://ftp.ncnr.nist.gov/pub/cryst/gsas/osx_gsaskit.tar.gz</a> (~7 Mb)
82<I>
83These files can also be downloaded from the CCP14 mirrors</I>
84[(<a href="http://www.nist.gov/cgi-bin/exit_nist.cgi?url=
85http://www.ccp14.ac.uk/ccp/ccp14/ftp-mirror/briantoby/pub/cryst/gsas/osx_gsaskit.tar.gz"
86>UK</a>),   
87(<a href="http://www.nist.gov/cgi-bin/exit_nist.cgi?url=
88http://ccp14.sims.nrc.ca/ccp/ccp14/ftp-mirror/briantoby/pub/cryst/gsas/osx_gsaskit.tar.gz"
89>Canada</a>),
90(<a href="http://www.nist.gov/cgi-bin/exit_nist.cgi?
91url=http://ccp14.semo.edu/ccp/ccp14/ftp-mirror/briantoby/pub/cryst/gsas/osx_gsaskit.tar.gz"
92>US</a>) or
93(<a href="http://www.nist.gov/cgi-bin/exit_nist.cgi?url=
94http://ccp14.minerals.csiro.au/ccp/ccp14/ftp-mirror/briantoby/pub/cryst/gsas/osx_gsaskit.tar.gz"
95>Australia</a>)].
96<P>
97<I>
98Note that if you have StuffIt installed, the compressed osx_gsaskit.tar.gz
99may be expanded to osx_gsaskit.tar and the contents (folder gsas)
100may be created automatically.
101In this case you can simply move this folder to the desired
102location.</I>
103<P>
104<I>
105If you need to expand and extract the files from the tar.gz file "manually"
106you can do this in a terminal or X11 xterm window.
107Assuming that you downloaded the above file to your desktop and wish to install
108the 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>
117If you wish to retrieve the files from the expanded osx_gsaskit.tar file,
118replace the last command with this:
119<PRE>
120     tar xvf ~/Desktop/osx_gsaskit.tar
121</PRE>
122</DL></DL>
123
124<LI>Make shortcuts to run EXPGUI
125<DL><DL><I>
126At this point you are able to run EXPGUI using the full command name
127from inside an X11 window -- by typing a command such as this:
128</I>
129<PRE>
130     /Users/[me]/Programs/gsas/expgui/expgui
131</PRE>
132<I>
133but this gets old fast. Here are some different approaches that can be used
134to 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
147shell you use by typing</I>
148<PRE>     echo $SHELL</PRE>
149<I>If you use bash, etc., you will put the commands in
150your ~/.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>
161
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">
167When 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,
169you are asked to select a default starting directory for EXPGUI (this
170is for convenience; you can move to and work with .EXP files located
171in any directory.) You also select a directory and file name to save
172the script. Note that the default for this, ~/Library/Scripts/EXPGUI.scpt,
173will place the script in your "Script Menu" (see
174<a href="http://www.nist.gov/cgi-bin/exit_nist.cgi?url=
175http://www.apple.com/applescript/scriptmenu/">
176http://www.apple.com/applescript/scriptmenu</A>).
177<BR CLEAR="ALL">
178</DL></DL>
179
180<a name="CompileAppleScript">
181<P><LI><B>Create an Applet/Droplet to run EXPGUI</B>
182<DL><DL>
183If you double-click on the EXPGUI AppleScript, created above, you
184will open it in the Script Editor, where you can convert it from
185a "Compiled Script" to a "Application". This application can then be
186used to start EXPGUI if doubled-clicked in a Finder window or on the desktop.
187You can also drag experiment (.EXP) files onto the icon to launch EXPGUI on
188those files (if you drag more than one .EXP file, an EXPGUI window is opened
189for each file -- use with care if you are short on memory).
190<P>
191To 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,
193as is shown below. I suggest that you also select the
194"Never Show Startup Screen" option, as is also shown below.
195You can call the file anything, although EXPGUI makes a
196certain amount of sense. You can put this file anywhere you choose,
197but 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>
203To 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,
207such as the image to the right, which can also be
208found as file .../gsas/expgui.icns. (I am hoping
209that 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>
216
217
218<P>
219<B>Open questions:</B> I am far from a Mac expert. Several problems
220I would like to solve are:
221<OL>
222<LI>Is there a way to create an application, as opposed to a compiled script,
223directly 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
227OS X for easy use.
228</OL>
229If you have any advice, please send it my way.
230</OL>
231
232<HR><HR>
233<h4>Mac ideosyncracies</H4>
234<P>
235Unlike the Windows & Unix ports, Mac windows may not be updated
236until you click on them. This is seems to be the case for PGPLOT
237windows (in POWPLOT, RAWPLOT,...) after the first plot. After typing the
238command to update the graph, click on the window bar and the plot will
239update.
240<HR><HR>
241<h4>Problems</H4>
242If you cannot get EXPGUI or the GSAS graphics programs to work,
243you may have a setup problem with X-windows (X11). As an example, when I start
244a terminal window, there is no definition for the X11 display (this does
245work correctly by starting an xterm session in X11).
246A quick test is to type xclock at the prompt:
247
248<PRE>
249     bash-2.05a$ xclock
250</PRE>
251If you get a clock display -- great. If you get the following error message
252the DISPLAY variable is not set:
253<PRE>
254     bash-2.05a$ xclock
255     Error: Can't open display:
256</PRE>
257
258If on the other hand, you get this error message, there is a problem
259with Xwindows:
260<PRE>
261     bash-2.05a$ xclock
262     Error: Can't open display: localhost:0.0
263</PRE>
264
265You can set the DISPLAY variable in bash/zsh, etc. using:
266<PRE>
267     bash-2.05a$ export DISPLAY=localhost:0.0
268</PRE>
269
270or in csh/tcsh, etc. using:
271
272<PRE>
273     [d120234:~] toby% setenv DISPLAY localhost:0.0
274</PRE>
275
276You can test if Tcl/Tk and the BLT package are installed correctly using the
277following commands:
278<PRE>
279     [d120234:~] toby% wish
280     % package require BLT
281     2.4
282     % pack [blt::graph .g]
283     % exit
284</PRE>
285When you type "wish" and press Enter, a new small blank window should appear.
286when you type the 2nd line, "package require BLT," there will be no change in
287the blank window, but the computer should respond "2.4". After the
288"pack [blt::graph .g]" command is entered, a set of x- and y-axes should appear
289in this window. The window should disappear after "exit" is typed.
290<P>
291<HR>
292<P>GSAS is Copyright, 1984-2000, by
293the Regents of the University of California.
294The GSAS software was produced under a U.S. Government contract (W-7405-ENG-36)
295by the Los Alamos National Laboratory, which is operated by the University
296of California for the U.S. Department of Energy. The U.S. Government is
297licensed to use, reproduce, and distribute this software. Permission is
298granted to the public to copy and use this software without charge, provided
299that this notice and any statement of authorship are reproduced on all
300copies. Neither the Government nor the University makes any warranty, express
301or implied, or assumes any liability or responsibility for the use of this
302software.
303
304<P>The author of EXPGUI is a U.S. Government employee which means that
305EXPGUI is not subject to copyright. Have fun with it. Modify it. Please write
306new sections and make them available to the rest of the world.
307
308<p>Neither the U.S. Government nor any author makes any warranty,
309expressed or implied, or assumes any liability or responsibility
310for the use of this information or the software described
311here. Brand names cited herein are used for
312identification purposes and do not constitute an endorsement by NIST.
313</blockquote>
314<hr>
315<P><font size=-1><a href="mailto:crystal@nist.gov">Questions/Problems: crystal@nist.gov</a>
316<br>
317$Revision: 767 $ $Date: 2009-12-04 23:11:41 +0000 (Fri, 04 Dec 2009) $
318</BODY>
319</HTML>
320
Note: See TracBrowser for help on using the repository browser.