source: trunk/doc/osx.html @ 762

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

# on 2003/12/08 22:25:22, toby did:
ready for prime time?

  • Property rcs:author set to toby
  • Property rcs:date set to 2003/12/08 22:25:22
  • Property rcs:rev set to 1.1
  • Property rcs:state set to Exp
  • Property svn:keywords set to Author Date Revision Id
File size: 11.1 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
26<H3>Installing GSAS/EXPGUI under Mac OS X:</H3>
27
28These are approximate directions for installing GSAS & EXPGUI on a
29Macintosh OS X machine. The software has been built using OS X 10.2.6
30and has been installed successfully on 10.2 and 10.3 machines.
31Note that most users will probably already have installed X11 and
32FINK on their computers. Most OS X books can provide more information
33on how to do this.
34
35<OL>
36<P><LI>Install X11
37<DL><DL><I>
38This can be done from your OS (Jaguar or Panther) CD-ROM or can be
39downloaded from
40<a href="http://www.nist.gov/cgi-bin/exit_nist.cgi?url=
41http://www.apple.com/macosx/features/x11/download/"
42>http://www.apple.com/macosx/features/x11/download/
43</A>. </I>
44(Please do not contact me for help with this -- I have never done it).
45</DL></DL>
46
47<P><LI>Install FINK
48<DL><DL><I>
49This software can be downloaded from
50<a href="http://www.nist.gov/cgi-bin/exit_nist.cgi?url=
51http://fink.sourceforge.net/"
52>http://fink.sourceforge.net/
53</A>. Download the package and then double-click on it.
54</I>(Please do not contact me for help with this -- I have never done it).
55</DL></DL>
56
57
58<P><LI>Download and install required packages.
59<DL><DL><I>
60GSAS requires a the "Portable Network Graphics" (libpng3) library.
61EXPGUI requires the X11 (not Aqua) Tcl/Tk and BLT packages.
62There is more than one way to install them. For example, you can use the
63fink command to compile and install packages from source code. The
64easier way is to simply download binary versions. With FINK installed
65this is easy, use this command in a terminal or X11 xterm window:</I>
66<PRE>
67     sudo apt-get install tcltk blt libpng3-shlibs
68</PRE>
69</DL></DL>
70
71<P><LI>Download the GSAS & EXPGUI programs.
72<DL><DL><I>
73Download this file from the NIST website:
74</I>
75<a href="ftp://ftp.ncnr.nist.gov/pub/cryst/gsas/osx_gsaskit.tar.gz">
76ftp://ftp.ncnr.nist.gov/pub/cryst/gsas/osx_gsaskit.tar.gz</a> (~7 Mb)
77<I>
78These files can also be downloaded from the CCP14 mirrors</I>
79[(<a href="http://www.nist.gov/cgi-bin/exit_nist.cgi?url=
80http://www.ccp14.ac.uk/ccp/ccp14/ftp-mirror/briantoby/pub/cryst/gsas/osx_gsaskit.tar.gz"
81>UK</a>),   
82(<a href="http://www.nist.gov/cgi-bin/exit_nist.cgi?url=
83http://ccp14.sims.nrc.ca/ccp/ccp14/ftp-mirror/briantoby/pub/cryst/gsas/osx_gsaskit.tar.gz"
84>Canada</a>),
85(<a href="http://www.nist.gov/cgi-bin/exit_nist.cgi?
86url=http://ccp14.semo.edu/ccp/ccp14/ftp-mirror/briantoby/pub/cryst/gsas/osx_gsaskit.tar.gz"
87>US</a>) or
88(<a href="http://www.nist.gov/cgi-bin/exit_nist.cgi?url=
89http://ccp14.minerals.csiro.au/ccp/ccp14/ftp-mirror/briantoby/pub/cryst/gsas/osx_gsaskit.tar.gz"
90>Australia</a>)].
91<P>
92<I>
93Note that if you have StuffIt installed, the compressed osx_gsaskit.tar.gz
94may be expanded to osx_gsaskit.tar and the contents (folder gsas)
95may be created automatically.
96In this case you can simply move this folder to the desired
97location. </I>
98<P>
99<I>
100If you need to expand and extract the files from the tar.gz file "manually"
101you can do this in a terminal or X11 xterm window.
102Assuming that you downloaded the above file to your desktop and wish to install
103the files in directory </I>/Users/[me]/Programs/gsas<I>
104(where </I>[me]<I> is your username), you will use commands like this:
105</I>
106<PRE>
107     cd
108     mkdir -p Programs/gsas
109     cd Programs/gsas
110     tar xvzf ~/Desktop/osx_gsaskit.tar.gz
111</PRE>
112If you wish to retrieve the files from the expanded osx_gsaskit.tar file,
113replace the last command with this:
114<PRE>
115     tar xvf ~/Desktop/osx_gsaskit.tar
116</PRE>
117</DL></DL>
118
119<LI>Make shortcuts to run EXPGUI
120<DL><DL><I>
121At this point you are able to run EXPGUI using the full command name
122from inside an X11 window by typing a command such as this:
123</I>
124<PRE>
125     /Users/[me]/Programs/gsas/expgui/expgui
126</PRE>
127<I>
128but this gets old fast. Here are some different approaches that can be used
129to make EXPGUI easier to run:
130</I>
131</DL></DL>
132<UL>
133<P><LI><B>Create alias commands</B>
134<DL><DL>
135<P><I>Do this by placing alias commands into your ~/.cshrc file:</I>
136<PRE>
137   alias expgui      /sw/bin/wish /Applications/gsas/expgui/expgui
138   alias gsas        /Applications/gsas/gsas
139</PRE>
140(where /Applications is the location where you have installed GSAS.)
141<I>The above applies to users of the csh & tcsh shells. (You can find what
142shell you use by typing</I>
143<PRE>     echo $SHELL</PRE>
144<I>If you use bash, etc., you will put the commands in
145your ~/.profile file and the syntax is this:</I>
146<PRE>
147   alias expgui='/sw/bin/wish /Applications/gsas/expgui/expgui'
148   alias gsas='/Applications/gsas/gsas'
149</PRE>
150<P>
151<I>When this is done, restart X11 and from an X11 window you can type </I>
152<PRE>    gsas</PRE> or
153<PRE>    expgui</pre> 
154<I>Note that this will also work:</I>
155<PRE>    expgui EXPFILE.EXP</pre>
156
157</DL></DL>
158<P><LI><B>Create an AppleScript to run EXPGUI</B>
159<DL><DL>
160<IMG SRC="osx1.jpg" ALT="EXPGUI menu" ALIGN="RIGHT">
161When run in OS X, a special menu appears in the EXPGUI file menu,
162"Create AppleScript," as shown to the right. When this is selected,
163you are asked to select a default starting directory for EXPGUI (this
164is for convenience; you can move to and work with .EXP files located
165in any directory.) You also select a directory and file name to save
166the script. Note that the default for this, ~/Library/Scripts/EXPGUI.scpt,
167will place the script in your "Script Menu" (see
168<a href="http://www.nist.gov/cgi-bin/exit_nist.cgi?url=
169http://www.apple.com/applescript/scriptmenu/">
170http://www.apple.com/applescript/scriptmenu</A>).
171<BR CLEAR="ALL">
172</DL></DL>
173
174<P><LI><B>Create an Applet to run EXPGUI</B>
175<DL><DL>
176If you double-click on the EXPGUI AppleScript, created above, you
177will open it in the Script Editor, where you can convert it from
178a "Compiled Script" to a "Application". This application can then be
179used to start EXPGUI if doubled-clicked in a Finder window, on the desktop
180or can even be moved to the dock. To create an application, use the
181File/Save As menu option and be sure to select "Application" as the Format,
182as is shown below. I suggest that you select the "Never Show Startup Screen"
183option, also. You can call the file anything, although EXPGUI makes a
184certain amount of sense. You can also put this file anywhere you choose.
185<P>
186</DL></DL>
187<IMG SRC="osx2.jpg" ALT="Script Editor save as options" ALIGN="TEXTTOP">
188<DL><DL>
189<P>
190To change the icon, you can to the following:
191<UL>
192<IMG SRC="expgui.jpg" ALIGN=RIGHT ALT="Sample 128x128 EXPGUI icon">
193<LI>copy into the clipboard whatever image you would like to use,
194such as the image to the right. (I am hoping
195that someone with more talent can contribute something better.)
196<LI>Control-click on the EXPGUI app file
197<LI>Click on the tiny icon under the word "general"
198<LI>Paste the picture from the clipboard (Edit/Paste or Apple-V)
199<BR CLEAR="ALL">
200</UL>
201</DL></DL>
202
203
204<P>
205<B>Open questions:</B> I am far from a Mac expert. Several problems
206I would like to solve are:
207<OL>
208<LI>Is there a way to create an application from an AppleScript, so this can
209be automated.
210<LI>Can I associate an icon with an app/script from within an AppleScript
211(so I can do it automatically)?
212<LI>How does one create a "droplet" so that one can drop a .EXP file onto
213the applet and get that file passed into the EXPGUI command line?
214<LI>Are there other (better?) ways to integrate AppleScripts into
215OS X for easy use.
216</OL>
217If you have any advice, please send it my way.
218</OL>
219
220<HR><HR>
221<h4>Mac ideosyncracies</H4>
222<P>
223Unlike the Windows & Unix ports, Mac windows may not be updated
224until you click on them. This is seems to be the case for PGPLOT
225windows (in POWPLOT, RAWPLOT,...) after the first plot. After typing the
226command to update the graph, click on the window bar and the plot will
227update.
228<HR><HR>
229<h4>Problems</H4>
230If you cannot get EXPGUI or the GSAS graphics programs to work,
231you may have a setup problem with X-windows (X11). As an example, when I start
232a terminal window, there is no definition for the X11 display (this does
233work correctly by starting an xterm session in X11).
234A quick test is to type xclock at the prompt:
235
236<PRE>
237     bash-2.05a$ xclock
238</PRE>
239If you get a clock display -- great. If you get the following error message
240the DISPLAY variable is not set:
241<PRE>
242     bash-2.05a$ xclock
243     Error: Can't open display:
244</PRE>
245
246If on the other hand, you get this error message, there is a problem
247with Xwindows:
248<PRE>
249     bash-2.05a$ xclock
250     Error: Can't open display: localhost:0.0
251</PRE>
252
253You can set the DISPLAY variable in bash/zsh, etc. using:
254<PRE>
255     bash-2.05a$ export DISPLAY=localhost:0.0
256</PRE>
257
258or in csh/tcsh, etc. using:
259
260<PRE>
261     [d120234:~] toby% setenv DISPLAY localhost:0.0
262</PRE>
263
264You can test if Tcl/Tk and the BLT package are installed correctly using the
265following commands:
266<PRE>
267     [d120234:~] toby% wish
268     % package require BLT
269     2.4
270     % pack [blt::graph .g]
271     % exit
272</PRE>
273When you type "wish" and press Enter, a new small blank window should appear.
274when you type the 2nd line, "package require BLT," there will be no change in
275the blank window, but the computer should respond "2.4". After the
276"pack [blt::graph .g]" command is entered, a set of x- and y-axes should appear
277in this window. The window should disappear after "exit" is typed.
278<P>
279<HR>
280<P>GSAS is Copyright, 1984-2000, by
281the Regents of the University of California.
282The GSAS software was produced under a U.S. Government contract (W-7405-ENG-36)
283by the Los Alamos National Laboratory, which is operated by the University
284of California for the U.S. Department of Energy. The U.S. Government is
285licensed to use, reproduce, and distribute this software. Permission is
286granted to the public to copy and use this software without charge, provided
287that this notice and any statement of authorship are reproduced on all
288copies. Neither the Government nor the University makes any warranty, express
289or implied, or assumes any liability or responsibility for the use of this
290software.
291
292<P>The author of EXPGUI is a U.S. Government employee which means that
293EXPGUI is not subject to copyright. Have fun with it. Modify it. Please write
294new sections and make them available to the rest of the world.
295
296<p>Neither the U.S. Government nor any author makes any warranty,
297expressed or implied, or assumes any liability or responsibility
298for the use of this information or the software described
299here. Brand names cited herein are used for
300identification purposes and do not constitute an endorsement by NIST.
301<hr>
302<P><font size=-1><a href="mailto:crystal@nist.gov">Questions/Problems: crystal@nist.gov</a>
303<br>
304$Revision: 762 $ $Date: 2009-12-04 23:11:35 +0000 (Fri, 04 Dec 2009) $
305</blockquote>
306</BODY>
307</HTML>
308
Note: See TracBrowser for help on using the repository browser.