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> |
---|
8 | A:link {text-decoration:none} |
---|
9 | A: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 | |
---|
28 | These are approximate directions for installing GSAS & EXPGUI on a |
---|
29 | Macintosh OS X machine. The software has been built using OS X 10.2.6 |
---|
30 | and has been installed successfully on 10.2 and 10.3 machines. |
---|
31 | Note that most users will probably already have installed X11 and |
---|
32 | FINK on their computers. Most OS X books can provide more information |
---|
33 | on how to do this. |
---|
34 | |
---|
35 | <OL> |
---|
36 | <P><LI>Install X11 |
---|
37 | <DL><DL><I> |
---|
38 | This can be done from your OS (Jaguar or Panther) CD-ROM or can be |
---|
39 | downloaded from |
---|
40 | <a href="http://www.nist.gov/cgi-bin/exit_nist.cgi?url= |
---|
41 | http://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> |
---|
49 | This software can be downloaded from |
---|
50 | <a href="http://www.nist.gov/cgi-bin/exit_nist.cgi?url= |
---|
51 | http://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> |
---|
60 | GSAS requires a the "Portable Network Graphics" (libpng3) library. |
---|
61 | EXPGUI requires the X11 (not Aqua) Tcl/Tk and BLT packages. |
---|
62 | There is more than one way to install them. For example, you can use the |
---|
63 | fink command to compile and install packages from source code. The |
---|
64 | easier way is to simply download binary versions. With FINK installed |
---|
65 | this 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> |
---|
73 | Download this file from the NIST website: |
---|
74 | </I> |
---|
75 | <a href="ftp://ftp.ncnr.nist.gov/pub/cryst/gsas/osx_gsaskit.tar.gz"> |
---|
76 | ftp://ftp.ncnr.nist.gov/pub/cryst/gsas/osx_gsaskit.tar.gz</a> (~7 Mb) |
---|
77 | <I> |
---|
78 | These files can also be downloaded from the CCP14 mirrors</I> |
---|
79 | [(<a href="http://www.nist.gov/cgi-bin/exit_nist.cgi?url= |
---|
80 | http://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= |
---|
83 | http://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? |
---|
86 | url=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= |
---|
89 | http://ccp14.minerals.csiro.au/ccp/ccp14/ftp-mirror/briantoby/pub/cryst/gsas/osx_gsaskit.tar.gz" |
---|
90 | >Australia</a>)]. |
---|
91 | <P> |
---|
92 | <I> |
---|
93 | Note that if you have StuffIt installed, the compressed osx_gsaskit.tar.gz |
---|
94 | may be expanded to osx_gsaskit.tar and the contents (folder gsas) |
---|
95 | may be created automatically. |
---|
96 | In this case you can simply move this folder to the desired |
---|
97 | location. </I> |
---|
98 | <P> |
---|
99 | <I> |
---|
100 | If you need to expand and extract the files from the tar.gz file "manually" |
---|
101 | you can do this in a terminal or X11 xterm window. |
---|
102 | Assuming that you downloaded the above file to your desktop and wish to install |
---|
103 | the 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> |
---|
112 | If you wish to retrieve the files from the expanded osx_gsaskit.tar file, |
---|
113 | replace 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> |
---|
121 | At this point you are able to run EXPGUI using the full command name |
---|
122 | from 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> |
---|
128 | but this gets old fast. Here are some different approaches that can be used |
---|
129 | to 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 |
---|
142 | shell you use by typing</I> |
---|
143 | <PRE> echo $SHELL</PRE> |
---|
144 | <I>If you use bash, etc., you will put the commands in |
---|
145 | your ~/.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"> |
---|
161 | When 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, |
---|
163 | you are asked to select a default starting directory for EXPGUI (this |
---|
164 | is for convenience; you can move to and work with .EXP files located |
---|
165 | in any directory.) You also select a directory and file name to save |
---|
166 | the script. Note that the default for this, ~/Library/Scripts/EXPGUI.scpt, |
---|
167 | will place the script in your "Script Menu" (see |
---|
168 | <a href="http://www.nist.gov/cgi-bin/exit_nist.cgi?url= |
---|
169 | http://www.apple.com/applescript/scriptmenu/"> |
---|
170 | http://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> |
---|
176 | If you double-click on the EXPGUI AppleScript, created above, you |
---|
177 | will open it in the Script Editor, where you can convert it from |
---|
178 | a "Compiled Script" to a "Application". This application can then be |
---|
179 | used to start EXPGUI if doubled-clicked in a Finder window, on the desktop |
---|
180 | or can even be moved to the dock. To create an application, use the |
---|
181 | File/Save As menu option and be sure to select "Application" as the Format, |
---|
182 | as is shown below. I suggest that you select the "Never Show Startup Screen" |
---|
183 | option, also. You can call the file anything, although EXPGUI makes a |
---|
184 | certain 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> |
---|
190 | To 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, |
---|
194 | such as the image to the right. (I am hoping |
---|
195 | that 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 |
---|
206 | I would like to solve are: |
---|
207 | <OL> |
---|
208 | <LI>Is there a way to create an application from an AppleScript, so this can |
---|
209 | be 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 |
---|
213 | the applet and get that file passed into the EXPGUI command line? |
---|
214 | <LI>Are there other (better?) ways to integrate AppleScripts into |
---|
215 | OS X for easy use. |
---|
216 | </OL> |
---|
217 | If you have any advice, please send it my way. |
---|
218 | </OL> |
---|
219 | |
---|
220 | <HR><HR> |
---|
221 | <h4>Mac ideosyncracies</H4> |
---|
222 | <P> |
---|
223 | Unlike the Windows & Unix ports, Mac windows may not be updated |
---|
224 | until you click on them. This is seems to be the case for PGPLOT |
---|
225 | windows (in POWPLOT, RAWPLOT,...) after the first plot. After typing the |
---|
226 | command to update the graph, click on the window bar and the plot will |
---|
227 | update. |
---|
228 | <HR><HR> |
---|
229 | <h4>Problems</H4> |
---|
230 | If you cannot get EXPGUI or the GSAS graphics programs to work, |
---|
231 | you may have a setup problem with X-windows (X11). As an example, when I start |
---|
232 | a terminal window, there is no definition for the X11 display (this does |
---|
233 | work correctly by starting an xterm session in X11). |
---|
234 | A quick test is to type xclock at the prompt: |
---|
235 | |
---|
236 | <PRE> |
---|
237 | bash-2.05a$ xclock |
---|
238 | </PRE> |
---|
239 | If you get a clock display -- great. If you get the following error message |
---|
240 | the DISPLAY variable is not set: |
---|
241 | <PRE> |
---|
242 | bash-2.05a$ xclock |
---|
243 | Error: Can't open display: |
---|
244 | </PRE> |
---|
245 | |
---|
246 | If on the other hand, you get this error message, there is a problem |
---|
247 | with Xwindows: |
---|
248 | <PRE> |
---|
249 | bash-2.05a$ xclock |
---|
250 | Error: Can't open display: localhost:0.0 |
---|
251 | </PRE> |
---|
252 | |
---|
253 | You can set the DISPLAY variable in bash/zsh, etc. using: |
---|
254 | <PRE> |
---|
255 | bash-2.05a$ export DISPLAY=localhost:0.0 |
---|
256 | </PRE> |
---|
257 | |
---|
258 | or in csh/tcsh, etc. using: |
---|
259 | |
---|
260 | <PRE> |
---|
261 | [d120234:~] toby% setenv DISPLAY localhost:0.0 |
---|
262 | </PRE> |
---|
263 | |
---|
264 | You can test if Tcl/Tk and the BLT package are installed correctly using the |
---|
265 | following commands: |
---|
266 | <PRE> |
---|
267 | [d120234:~] toby% wish |
---|
268 | % package require BLT |
---|
269 | 2.4 |
---|
270 | % pack [blt::graph .g] |
---|
271 | % exit |
---|
272 | </PRE> |
---|
273 | When you type "wish" and press Enter, a new small blank window should appear. |
---|
274 | when you type the 2nd line, "package require BLT," there will be no change in |
---|
275 | the 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 |
---|
277 | in this window. The window should disappear after "exit" is typed. |
---|
278 | <P> |
---|
279 | <HR> |
---|
280 | <P>GSAS is Copyright, 1984-2000, by |
---|
281 | the Regents of the University of California. |
---|
282 | The GSAS software was produced under a U.S. Government contract (W-7405-ENG-36) |
---|
283 | by the Los Alamos National Laboratory, which is operated by the University |
---|
284 | of California for the U.S. Department of Energy. The U.S. Government is |
---|
285 | licensed to use, reproduce, and distribute this software. Permission is |
---|
286 | granted to the public to copy and use this software without charge, provided |
---|
287 | that this notice and any statement of authorship are reproduced on all |
---|
288 | copies. Neither the Government nor the University makes any warranty, express |
---|
289 | or implied, or assumes any liability or responsibility for the use of this |
---|
290 | software. |
---|
291 | |
---|
292 | <P>The author of EXPGUI is a U.S. Government employee which means that |
---|
293 | EXPGUI is not subject to copyright. Have fun with it. Modify it. Please write |
---|
294 | new 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, |
---|
297 | expressed or implied, or assumes any liability or responsibility |
---|
298 | for the use of this information or the software described |
---|
299 | here. Brand names cited herein are used for |
---|
300 | identification 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 | |
---|