Debian Codegraph @

doc/FAQ

raw
1
2 Introduction
3
4 This is the FAQ ("frequently asked questions") document for the Gri
5 scientific graphing language, (c) 1991-2000 Dan Kelley
6 ([email protected]), to whom you are asked to email reports of
7 Gri errors, or suggestions for Gri improvements or new features.
8
9 The Questions
10
11 Q1 Features
12
13 * Q1.1 What is Gri?
14 * Q1.2 What does `Gri' stand for? How is it pronounced?
15 * Q1.3 What does Gri cost?
16 * Q1.4 How long will it take to learn Gri?
17
18 Q2 Documentation
19
20 * Q2.1 Is there a quick-reference card for Gri?
21 * Q2.2 Where can I get documentation for Gri?
22 * Q2.3 Is there a cookbook of Gri program to use for guidance?
23 * Q2.4 Is there a newsgroup for Gri?
24 * Q2.5 Where can I get some sample Gri input files?
25
26 Q3 Can Gri do ... ?
27
28 * Q3.1 Can Gri do barcharts?
29 * Q3.2 Can Gri do histograms?
30 * Q3.3 Can Gri do error bars?
31 * Q3.4 Can Gri draw labels for Tukey box plots?
32 * Q3.5 Can Gri read compressed data files?
33 * Q3.6 Can Gri use scientific notation on axes?
34 * Q3.7 Can Gri label x-axis with day of week?
35 * Q3.8 Can Gri draw maps?
36
37 Q4 Gri and other programs
38
39 * Q4.1 Is Gri better than Fortran/C/... plotting subroutines?
40 * Q4.2 How can I include Gri plots in LaTeX files?
41 * Q4.3 How may I convert Gri output to GIF format?
42 * Q4.4 Is there an Emacs mode for Gri?
43
44 Q5 Evolution of Gri
45
46 * Q5.1 Where can I get the latest version of Gri?
47 * Q5.2 How can I find out the most recent features of Gri?
48 * Q5.3 Should I keep my copy of Gri up-to-date?
49 * Q5.4 How can I protect myself against changes to Gri?
50
51 Q6 Gri on various computers
52
53 * Q6.1 What computers does Gri work on?
54 * Q6.2 What kind of compiler is required to compile gri?
55 * Q6.3 Why can't I link my compiled gri? (on HP computer)
56 * Q6.4 Is there a Macintosh version of Gri?
57 * Q6.5 Is there a DOS/Windows version of Gri?
58 * Q6.6 Is there a linux version of Gri?
59
60 Q7 Gri bugs
61
62 * Q7.1 What are known bugs in Gri?
63 * Q7.2 How can I report Gri bugs?
64
65 The Answers
66 _________________________________________________________________
67
68 A1 Features
69
70
71 A1.1 What is Gri?
72
73 Gri is a program for drawing scientific graphs. It makes xy plots
74 (linegraphs and scattergraphs), contour plots, and image plots. Unlike
75 many scientific plotting packages, Gri provides precise control over
76 fonts, line widths, grayscales, colors, etc. Since Gri was written by
77 a scientist, it does the kinds of plots scientists want. It has few
78 frills; e.g., it does not do 3D mesh plots, because the author
79 dislikes them. Gri is command-driven, not mouse driven.
80
81
82 A1.2 What does `Gri' stand for? How is it pronounced?
83
84 Gri stands for `gr-interactive', and `gr' is the name of a subroutine
85 library that preceded Gri. The `interactive' adjective indicates that
86 Gri can be used interactively -- that is, Gri is an interpreted
87 language whereas Gr is a compiled language. `Gri' rhymes with `try'.
88
89
90 A1.3 What does Gri cost?
91
92 Gri is free. A commercial version, called Gre (rhymes with `tree')
93 will be made available soon. It contains most of Gri as a subset, but
94 also contains quite a lot of the Perl language as well, making it a
95 fully functional and efficient programming language.
96
97
98 A1.4 How long will it take to learn Gri?
99
100 Most users can get Gri working after spending half an hour with manual
101 (see Q2.1). Familiarity with your operating system (for example
102 for viewing PostScript files) will speed this somewhat. After that,
103 it's best to learn new features only as you come to need them. To
104 begin with, you should skim the manual and the cookbook (see
105 Q2.3), looking just at the illustrations. This will take no more
106 than an hour.
107
108 The Gri manual is like most computer manuals: it would be a waste of
109 time to read it cover to cover before starting to use Gri. But you'll
110 find the manual helpful as you branch out, modifying the existing
111 examples and inventing code of your own.
112
113 Learning how to use a new command usually takes only a minute but
114 realizing that the command exists can take longer. That's why many
115 users with sophisticated needs find it useful to spend an afternoon
116 leafing through the entire manual at some point.
117
118 Most things in Gri can be done elegantly or crudely. The elegant
119 approach may require a little investment in time at the beginning, but
120 this will pay off constantly as your needs grow. For example, folks
121 who like computer programming often start using Gri "newcommands" (a
122 form of subroutines) within a few days. Other folks might avoid
123 newcommands, instead putting their entire program in one long "main
124 routine". What's right for you depends on how you think and the sort
125 of work you do.
126 _________________________________________________________________
127
128 A2 Documentation
129
130
131 A2.1 Is there a quick-reference card for Gri?
132
133 Yes, two quick-reference cards are stored on the FTP site
134 ftp://ftp.phys.ocean.dal.ca/users/kelley/gri. The PostScript file
135 refcard.ps is an overview of Gri syntax and usage, while cmdrefcard.ps
136 is a full list of Gri commands. Each of these files is also available
137 in TeX format.
138
139
140 A2.2 Where can I get documentation for Gri?
141
142 Full documentation is available in several forms on the FTP site
143 ftp://ftp.phys.ocean.dal.ca/users/kelley/gri. Check out the FAQ
144 file (which you are reading now), cmdrefcard.ps (a PostScript
145 reference card listing all Gri commands), refcard.ps (a PostScript
146 reference card overviewing Gri), and a file called something like
147 gri_manual_2.051.tar.gz (which is a complete PostScript manual
148 including figures). To save time and paper, you should look at the FAQ
149 and the two reference cards first.
150
151 The Gri manual is available on the WWW (world wide web) at the URL
152 http://gri.sourceforge.net/gridoc/html/index.html .
153
154 A2.3 Is there a cookbook of Gri programs to use for guidance?
155
156 Yes, at the website
157 http://gri.sourceforge.net/gri-cookbook/index.html
158
159
160 A2.4 Is there a newsgroup for Gri?
161
162 Gri has several email-type and web-type forums for discussions.
163
164 Until recently, the only such forum was a majordomo-based email list,
165 to which one subscribed by sending to [email protected]
166 a message containing just the two words subscribe gri, and to which
167 one contributed by mailing to [email protected].
168
169 However, in summer 2000 Gri got a much better suite of newsgroups, on
170 the SourceForge Gri site . Since these newsgroups are archived and
171 threaded, they are a better resource than the majordomo group
172 mentioned in the last paragraph.
173
174
175 A2.5 Where can I get some sample Gri input files?
176
177 You can get them from the anonymous FTP at
178 ftp://ftp.phys.ocean.dal.ca/users/kelley/gri. It is in the
179 compressed tarfile with the word 'example' contained in it. The file
180 is compressed with the program "gzip," so you'll type
181 gunzip gri-examples-2.1.10.tar.gz
182 tar xvf gri-examples-2.1.10.tar
183
184 (where 2.1.10 will be changed to the current version number), and the
185 tar program will create a directory called 'examples' which contains
186 the example .gri programs and datafiles. The 'examples' directory also
187 contains subdirectories with names that reflect computer names (e.g.,
188 SGI, SUN4). To get run gri on all the examples, go into the
189 appropriate subdirectory and type 'make examples'. For example:
190 cd examples/SUN4
191 make examples
192
193 creates files examples/SUN4/example1.ps, examples/SUN4/example2.ps,
194 etc.
195 _________________________________________________________________
196
197 A3 Can Gri do ... ?
198
199
200 A3.1 Can Gri do barcharts?
201
202 Gri has no specific command for barcharts, but the operating system
203 can easily rearrange your data into a form that lets Gri draw
204 barcharts. In the following example, the synonym \width is set to the
205 desired width of the bars and \missing is set to an arbitrary missing
206 value. The rest of the code will make sense to any Perl programmer. If
207 you don't know Perl, you should learn it.
208 \width = "1" // width of bars, in x units
209 \missing = "-99" // missing value
210 set missing value \missing
211 set x axis 0 6 1
212 set y axis 0 20 10
213 draw axes none // will get whited out by the chart anyway
214
215 // Create dataset
216 system cat > barchart.dat << "EOF"
217 1 12
218 2 14
219 3 15
220 4 13
221 5 10
222 EOF
223
224 // Create barchart style dataset and plot it
225 system perl <<"EOF"
226 open (IN, "barchart.dat") || die "Cannot open barchart.dat";
227 while(<IN>) {
228 ($x[$i], $y[$i]) = split(' ');
229 $i++;
230 }
231 $n = $i;
232 open (TMP, ">tmp") || die "Cannot open tmp";
233 for ($i = 0; $i < $n; $i++) {
234 print TMP $x[$i] - \width / 2, " ", 0, "\n";
235 print TMP $x[$i] - \width / 2, " ", $y[$i], "\n";
236 print TMP $x[$i] + \width / 2, " ", $y[$i], "\n";
237 print TMP $x[$i] + \width / 2, " ", 0, "\n";
238 print TMP \missing, " ", \missing, "\n";
239 }
240 EOF
241 open tmp
242 read columns x y
243 set graylevel 0.95
244 draw curve filled to 0 y
245 set graylevel 0
246 draw curve
247 draw axes
248 draw title "Demonstrate Gri barchart"
249
250
251
252 A3.2 Can Gri do histograms?
253
254 Gri has no specific command for histograms, but the operating system
255 can easily rearrange your data into a histogram format.
256
257 Here is Gri code to do it:
258 open "histogram -l 0 -h 10 -i 0.5 < inputfile |"
259 read columns x y // y is number of obs
260 draw curve filled to 0 y
261
262 where histogram is a perlscript which creates a histogram file named
263 inputfile. An example of histogram is:
264 #!/opt/bin/perl
265 # Calculate histogram of 1-column data
266 $usage ="\
267 NAME\
268 histogram -- create histogram file, given data file (1 column)\
269 \
270 SYNOPSIS\
271 histogram -l low -h high -i increment < input_file > output_file\
272 \
273 DESCRIPTION\
274 Scans the input values and finds the percentage of data in bins\
275 starting at value `low', ending at value `high', and incrementing by\
276 value `inc'.\
277 \
278 FILES\
279 Standard input: column of numbers\
280 Standard output: columns: (bin_centre, per, cum_per, num, cum_num)\
281 where 'per'=percentage and 'num'=number.\
282 ";
283 require "getopts.pl";
284 $opt_l = 0;
285 $opt_h = 0;
286 $opt_i = 0;
287 &Getopts('l:h:i:');
288 die "You must supply commandline arguments!\n$usage" if ($opt_l == $opt_h || $o
289 pt_i == 0);
290 $n = ($opt_h - $opt_l) / $opt_i;
291 print STDERR "Will have $n bins, running from $opt_l to $opt_h in steps of $opt
292 _i\n";
293 for ($i = 0; $i <= $n; $i++) {
294 $bin[$i] = 0;
295 }
296 while(<>) {
297 chop;
298 ($x) = split;
299 $i = int(0.5 + ($x - $opt_l) / $opt_i);
300 $i = 0 if ($i < 0);
301 $i = $n if ($i > $n);
302 $bin[$i]++;
303 }
304 for ($i = 0; $i <= $n; $i++) {
305 $x = $opt_l + $opt_i * ($i - 0.5);
306 print "$x $bin[$i]\n";
307 $x = $opt_l + $opt_i * ($i + 0.5);
308 print "$x $bin[$i]\n";
309 }
310
311
312
313 A3.3 Can Gri do error bars?
314
315 Gri has no specific command for error bars. It has no internal
316 representation of error bar data -- that is, you can't get them by a
317 read columns command. However, you can get error bars quite easily,
318 simply by reading the data line by line, plotting each one as
319 individually. Here's an example of error bars in y, where the third
320 column stores the error:
321 open a.dat
322 while 1
323 read .x. .y. .ey.
324 if ..eof..
325 break
326 end if
327 draw symbol bullet at .x. .y.
328 draw line from .x. {rpn .y. .ey. -} to .x. {rpn .y. .ey. +}
329 end while
330
331
332
333 A3.4 Can Gri draw labels for Tukey box plots?
334
335 Yes. Here is sample code, in which a label "My Label" is drawn to the
336 right of the median of a Tukey plot extending in the y direction:
337 read columns x y
338 1 11
339 2 22
340 1.2 3
341 3 5
342 2 20
343 3 10
344
345 draw y box plot at 2
346 draw label "My Label" at {rpn 2 xusertocm 0.4 +} \
347 {rpn y median yusertocm "M" ascent 2 / -} \
348 cm
349
350
351
352 A3.5 Can Gri read compressed data files?
353
354 Yes, as of version 2.6 Gri can read compressed files, e.g.
355 open myfile.gz
356 read columns x y
357
358 will work. You may also, of course, do
359 open "zcat myfile.gz |"
360 read columns x y
361
362 if you like.
363
364
365
366 A3.6 Can Gri use scientific notation on axes?
367
368 You have to trick it. Here's an example:
369 // NOTE: this requires manual setting of axes.
370 read columns x y
371 1 1.1e3
372 2 1.0e3
373 3 1.4e3
374 4 2.3e3
375 4 1.0e4
376
377 y /= 1e3
378 set y axis 1 5 1
379 set y format "%g$\times10^3$"
380 draw curve
381
382
383
384 A3.7 Can Gri label x-axis with day of week?
385
386 A future version of Gri will have much more powerful and general ways
387 of handling axes labelling. In the meantime, you have to trick Gri to
388 get such special effects. Here's an example:
389 set x axis 1 8 1
390 set y axis 0 1 .1
391 set font size 0
392 draw x axis at top
393 draw y axis at right
394 draw x axis at bottom
395 set font size 12
396 draw y axis at left
397 draw label "Mon" centered at 1.5 {rpn ..ymargin.. 0.7 - ycmtouser}
398 draw label "Tue" centered at 2.5 {rpn ..ymargin.. 0.7 - ycmtouser}
399 draw label "Wed" centered at 3.5 {rpn ..ymargin.. 0.7 - ycmtouser}
400 draw label "Thu" centered at 4.5 {rpn ..ymargin.. 0.7 - ycmtouser}
401 draw label "Fri" centered at 5.5 {rpn ..ymargin.. 0.7 - ycmtouser}
402 draw label "Sat" centered at 6.5 {rpn ..ymargin.. 0.7 - ycmtouser}
403 draw label "Sun" centered at 7.5 {rpn ..ymargin.. 0.7 - ycmtouser}
404
405 Note that the offset of 0.7 centimeters looks OK to me, with a 12
406 point font, but you may wish to experiment if you don't like the
407 placement.
408
409
410
411 A3.8 Can Gri draw maps?
412
413 Gri can draw maps, but it lacks builtin support for map projections.
414 (A previous version had projections, but they were not working
415 correctly and were removed.) Gri does not have builtin coastline
416 files, either. Many good coastline files are on the web; see, for
417 example, Rich Signell's site
418 http://crusty.er.usgs.gov/coast/getcoast.html
419 or the USGS mapping
420 site
421 http://www.usgs.gov
422 or the Global Self-consistent Hierarchical High-resolution
423 Shoreline site
424 http://www.ngdc.noaa.gov/mgg/shorelines/gshhs.html
425 _________________________________________________________________
426
427 A4 Gri and other programs
428
429
430 A4.1 Is Gri better than Fortran/C/... plotting subroutines?
431
432 Gri started out as a set of subroutines. The set is called `gr'; the
433 name `gri' means gr-interactive. Although I wrote both `gr' and `gri',
434 I haven't used gr in years. I am unaware of anybody else who ever used
435 `gr'. Thus, in at least this case, the interpreted Gri language is
436 superior to subroutines.
437
438 In some applications the graphics are hard-wired into the computation
439 so using Gri might not make sense. An example is the SPEM numerical
440 model, which has builtin NCAR plotting calls. But this approach is
441 inefficient in user-time and computer-time, because changing the
442 format of the output may require re-running a model. The best approach
443 is to decouple preparation of data from presentation of data.
444
445 In highly interactive applications, such as many uses of matlab and
446 statistical programs such as S and S-plus, it may make sense to use
447 the builtin graphics routines because they are so tightly bound to the
448 processing.
449
450 A4.2 How can I include Gri plots in LaTeX files?
451
452 This is done outside LaTeX (or TeX), with the program that converts
453 from DVI format to PostScript format. This conversion is done
454 differently on different computers; you'll have to enquire locally.
455 With `dvips', you can use the `\special' command or the `\espfbox'
456 command. The epsfbox command is smarter, since it figures the plot
457 dimensions from the PostScript file itself. Unfortunately, old
458 versions of Gri do not insert the correct plot dimensions in the
459 PostScript file. Here's an example, for a 15cm tall figure, of how to
460 insert a Gri PostScript file into a figure:
461 \documentstyle{article}
462 \begin{document}
463
464 ... Figure \ref{fig1} shows ...
465
466 \begin{figure}
467 \vspace*{15cm} % MAKE ENOUGH SPACE
468 \special{psfile=fig1.ps} % THIS INSERTS THE PLOT
469 \caption[Short caption, which appears in list of figures.]
470 {\label{fig1} Long caption, which appears with the figure.}
471 \end{figure}
472
473 \end{document}
474
475 In other LaTeX and TeX dialects, of course (e.g. the lovely agu++
476 format), you'll do things differently; the above will give you enough
477 of a guide.
478
479
480
481 A4.3 How may I convert Gri output to GIF format?
482
483 Conversion of the Gri PostScript output to GIF is normally done for
484 inclusion in web-pages. For a discussion of the merits of various
485 image formats, see Information Architecture. I have been told that
486 GIF images suffer from both technical limitations (no gamma value is
487 stored in the file) and license restrictions. The PNG format was
488 designed to overcome these limitations, and is expected to replace GIF
489 before the year 2000.
490
491 It should also be noted that there is no generally acceptable way to
492 convert PostScript to gif, especially when the PostScript is vector
493 based. One problem is that of resolution: if the output GIF is
494 low-resolution, then the text may be drawn roughly because of
495 rasterization. In many convertors one may specify the size of the
496 output image, which permits control over this resolution problem,
497 giving the user the task of weighing file size against output quality.
498 Note also that the colour table frequently gets reordered in the
499 conversion, possibly leading to inaccurate results. Simply stated,
500 PostScript is superior to GIF and other raster-based formats. That's
501 why Gri chose PostScript for the output model.
502
503 There are several ways to convert Gri PostScript into GIF images.
504 * METHOD 1. Use the convert program, which is a part of the
505 ImageMagick set of software. The convert software is quite
506 powerful, being able to convert from almost any format into almost
507 any other. The ImageMagick software is free, and available on the
508 world-wide-web at URL
509 http://www.wizards.dupont.com/cristy/ImageMagick.html
510 * METHOD 2: The GNU program gs can also do this conversion. In newer
511 versions, this conversion to GIF is builtin. Here is a shellscript
512 #!/usr/bin/sh
513 gri -y -p -b $1.gri
514 gs -q -dNOPAUSE -sDEVICE=ppm -sOutputFile=$1.ppm $1.ps -c quit
515 ppmtogif -interlace -transparent rgb:ff/ff/ff $1.ppm > $1.gif
516 rm -f $1.ppm
517 * METHOD 3: In older versions of gs, you must run a little program
518 in the gs interpreter, by typing
519 $ gs foo.ps
520 GS> (pstoppm.ps)run
521 GS> (foo) ppm1run
522 GS> quit
523 This creates a file called foo.ppm, in the so-called PPM format.
524 Various programs exist for converting image types, e.g. convert.
525
526 Availability of software: ImageMagick uses Aladdin Ghostscript,
527 another free program, to rasterize the PostScript file created by gri.
528 Ghostscript is available from
529 http://www.cs.wisc.edu/~ghost/index.html and many other sites
530 (including any CTAN archive). Older version of ghostscript are
531 available under the GNU GPL. Speaking of GNU, gs and other GNU
532 software are freely available at many locations on the web, e.g.
533 ftp://prep.ai.mit.edu/pub/gnu
534
535 Author's note: this answer was compiled with advice from Peter
536 Galbraith, Toru Suzuki, and George White, to each of whom I am very
537 grateful for the help. In fact, the answer is mostly a patchwork of
538 their suggestions, and all the helpful pointers to information on the
539 web are theirs, not mine.
540
541
542
543 A4.4 Is there an Emacs mode for Gri?
544
545 Yes. Peter Galbraith has written a very powerful mode for Gri
546 commandfiles which is supplied with Gri and which is fully documented
547 in the manual. The capabilities of the mode include the following.
548 * Indents loops, if statements, newcommands, etc.
549 * Uses built-in knowledge of Gri commands to 'complete' your
550 commands. For example, typing 'drM-TAB' (where M-TAB is the
551 completion keystroke) causes the mode to write 'draw' in place of
552 the 'dr'. Pressing M-TAB again gives a list of all Gri commands
553 starting with 'draw'.
554 * Provides complete access to Gri help on commands, including the
555 full Gri 'info' manual if your machine has that installed. There
556 is even an 'apropos' feature to let you search for commands you're
557 not sure even exist.
558 * Lets you run Gri from within the buffer. If syntax or runtime Gri
559 errors are encountered, the cursor (usually) moves to the
560 offending line in the Gri editing buffer.
561 * Lets you run Ghostview without leaving Emacs.
562 _________________________________________________________________
563
564 A5 Evolution of Gri
565
566
567
568 A5.1 Where can I get the latest version of Gri?
569
570 Gri is available at the anonymous FTP site
571 ftp://ftp.phys.ocean.dal.ca/users/kelley/gri
572 Instructions there will tell you what to do, but it should
573 be obvious if you've used FTP before.
574
575
576 A5.2 How can I find out the most recent features of Gri?
577
578 Do anonymous ftp to phys.ocean.dal.ca and cd to the directory
579 /users/kelley/gri. Pick up the file ChangeLog. For more details, see
580 the history chapter in the manual
581
582 A5.3 Should I keep my copy of Gri up-to-date?
583
584 The advantages of being up-do-date are:
585 * You get new features.
586 * There is a better chance of getting your bugs repaired, since all
587 bug fixes are applied only to the current version.) The
588 disadvantages of being up-to-date are:
589 * You can get clobbered by new bugs. (You should avoid this by
590 keeping your old versions of Gri. That means archiving both gri,
591 the executable, and gri.cmd, the startup file.)
592 * You can get clobbered by changes in the syntax. This is the
593 penalty you pay for using a program under active development. To
594 protect yourself, use the expecting version command, which will
595 warn you of any incompatibilites between the version you expect
596 and the version that is presently installed.
597
598 Most people should not be more than 5-10 versions out of date. To keep
599 in touch, subscribe to the gri maillist (...see Q2.3). Also, keep
600 track of the file ChangeLog in the FTP location. As with most
601 software, the supplier may be more enthusiastic about new versions
602 than the users are. Other Gri users may therefore provide the best
603 advice on whether it is worth upgrading.
604
605
606
607 A5.4 How can I protect myself against changes to Gri?
608
609 The most important thing is to save old versions of Gri. At hard-disk
610 street prices of about a cent per megabyte, an archive will cost under
611 a nickle.
612
613 Archiving the source is just a matter of copying the files you've
614 downloaded to a location of your choosing. Since the directory name is
615 of the form gri-VERSION, keeping track of old sources is trivial.
616
617 If you're using a prepackaged version of Gri (e.g. in RedHat or in
618 Debian linux), then you'll probably know how to update Gri already. At
619 any rate, you can skip some of the steps below, since rpm -ql gri will
620 list all the relevant files, saving you the part of the steps below
621 that involves locating files.
622
623 Archiving the Gri binary and library file is quite easy, but archiving
624 the documentation is complicated since there are a lot of
625 documentation files, and they are scattered across your filesystem.
626 For example, 'info' files go in the /usr/info directory, while
627 'manpage' files go in the /usr/man/man* directory, and the 'html'
628 files go someplace else). This isn't specific to Gri; the filesystem
629 is just defined that way, for historical reasons. Your first step is
630 to determine whether you wish to archive the documentation. In most
631 case you won't want to. The point is just that you have an old set of
632 scripts that you need to work; you won't be writing new scripts, and
633 if you wrote these ones, then you understand Gri well enough anyway.
634 Besides, Gri doesn't change that much from version to version, and the
635 changes mostly involve additions.
636
637 If you do wish to archive the documentation and emacs files, locate
638 the files and copy them. (If you do not, skip the remainder of this
639 paragraph.) In Redhat linux, do rpm -ql gri to locate the files. In
640 debian linux, do something similar. If 'locate' is working on your
641 computer, do locate gri and examine the list that you get. If none of
642 the above is true, look in the second-last paragraph above for
643 directories where Gri documentation files are often found, and move
644 them to wherever seems appropriate. You'll probably have to alter
645 other things as well, to tell the info and man programs where to find
646 the documentation. If you use the Emacs editing mode, move that
647 appropriately and edit whatever dot-files and system configuration
648 files that Emacs uses to locate mode files. (Note that all emacs modes
649 understand about using different versions; see the C-c C-r or by
650 calling the command M-x gri-version. If, as is likely, you're only
651 archiving Gri for old scripts that you don't need to edit, you may not
652 need to worry about changes to gri-mode and you may as well go ahead
653 and install the new gri-mode and forget about the old one.)
654
655 If you only wish to archive Gri itself, things are much easier! You
656 need to copy only two files, the executable (often /usr/bin/gri) and a
657 library file (often /usr/share/gri/gri.cmd) to a directory of your
658 choosing, and then create a shell alias (or a shellscript), which uses
659 these two files you've copied. Let me take it step by step.
660
661 First, type
662 gri -version
663
664 and make note of the present version number. For concreteness, let's
665 say it is version 2.6.0.
666
667 Next, decide where you wish to keep this gri version. For
668 concreteness, let's say that you'd like to keep it in a directory
669 named /usr/local/gri/2.6.0. Create that directory if it doesn't exist
670 already:
671 mkdir -p /usr/local/gri/2.6.0
672
673 Next, type
674 gri -directory_default
675
676 to find out where the gri.cmd file is located. Let's say it's in the
677 common location usr/share/gri, for concreteness; then you need to move
678 this to your chosen directory:
679 mv /usr/share/gri/gri.cmd /usr/local/gri/2.6.0
680
681 Now, we need to copy the executable. If you don't know where it is,
682 type
683 which gri
684
685 to find out. Then move it also, e.g. if Gri is located in the /usr/bin
686 directory, you'd type
687 mv /usr/bin/gri /usr/local/gri/2.6.0
688
689 Now we just have to make an alias to run this particular copy of Gri,
690 with this particular library file. In the Bash shell, just put the
691 following line in your ~/.aliases file:
692 alias gri2.6.0='/usr/local/gri/2.6.0/gri -directory /usr/local/gri/2.6.0'
693
694 and then you have a new command, gri2.6.0 that runs this particular
695 copy of Gri. Alternatively, you could create a shellscript to run this
696 Gri, e.g. a script named gri2.6.0 that contains the lines:
697 #!/usr/bin/sh
698 # Run numbered version of gri
699 /usr/local/gri/2.6.0/gri -directory /usr/local/gri/2.6.0 "$@"
700 _________________________________________________________________
701
702 A6 Gri on various computers
703
704
705 A6.1 What computers does Gri work on?
706
707 Gri has been ported to several Unix machines (e.g. Sun solaris and
708 sunOS; IBM RISC; HP RISC; SGI; DEC alpha; and x86 linux) and to x86
709 MS-DOS. An old version is available for DEC vax VMS.
710
711
712 A6.2 What kind of compiler is required to compile gri?
713
714 Gri requires a C++ compiler capable of handling the language feature
715 called "templates," and it also needs the so-called "standard template
716 library" (STL). Templates have been a feature of C++ since about 1994,
717 and STL became part of the draft C++ library standard in early 1996.
718 If your compiler vendor does not support templates or STL, you should
719 obtain a newer compiler.
720
721 The free C++ compiler called g++, available from the Free Software
722 Foundation, is known to compile Gri on at least a half-dozen problems.
723 The compiler version must be 2.7.2 or higher for success.
724
725
726 A6.3 Why can't I link my compiled gri? (on HP computer)
727
728 Unfortunately, I made a bad programming decision several versions ago
729 -- I decided to start using the STL (the standard template library).
730 The STL is part of the draft ANSI C++ standard, so I figured I'd be
731 safe. And my tests on solaris and linux platforms indicated that STL
732 worked as advertised, in g++ 2.7.x. However, I should have checked
733 further. It turns out that g++ on some platforms (e.g. HP's unix and
734 IBMRS's AIX unix) does not handle templates properly. The linker
735 cannot locate templates defined in one file and used in another. This
736 issue is discussed at some length in the g++ documentation, where
737 three methods are presented for solving the problem. (In the
738 info-format documentation, you can find the relevant parts by
739 searching for the string "where's the template?") In Gri I've used
740 what method 3 as defined in the g++ manual. Apparently this fails on
741 some platforms. Although I'd welcome tests by users on the other two
742 g++ methods, and I'd be happy to switch if one of them appeared to
743 work more universally, I have to say that I'm not optimistic: from
744 what I read on the newsgroups, nobody is having much success on this.
745 The GNU folks say that g++ version 2.8 will handle templates much
746 better, so I'm waiting for that. Unfortunately it's been, so far, a
747 two-year wait.
748
749 Almost certainly, commercial compilers handle templates better, but I
750 lack resources to purchase these for the various platforms. I'd be
751 happy, though, to act as a broker for anyone who is able to compile
752 Gri on the problematic platforms, and who is willing to share their
753 results.
754
755
756 A6.4 Is there a Macintosh version of Gri?
757
758 There once was a clicky-pointy Macintosh version of gri, but I got
759 frustrated with modifying the code each time Apple upgraded the OS and
760 stopped maintaining the code. After several years of living (happily)
761 without the Macintosh, I flushed the Mac code down the drain.
762
763 However a version for Macintosh unix is available .
764
765
766 A6.5 Is there a DOS/Windows version of Gri?
767
768 There is a version available for DOS, available at the normal Gri FTP
769 site,
770 ftp://ftp.phys.ocean.dal.ca/users/kelley/gri
771 and copy another at the anonymous FTP site
772 ftp://shiho.tokyo-u-fish.ac.jp/pub/msdos/gri
773 with filename of the form gri2025b.zip where 2025 refers
774 to the version name. This binary version was prepared and
775 very kindly shared by Toru Suzuki
776 [email protected]
777 Together with the distribution comes a file called README,
778 which tells how to install and use Gri in an msdos context.
779
780 Also, see the Gri manual under the heading Compilation on x86
781 (PC-style) Computers
782
783 As for viewing the output, I recommend obtaining a copy of the
784 Ghostview program (which is a general PostScript display program), in
785 the version called GSview.
786
787
788
789 A6.6 Is there a linux version of Gri?
790
791 For non-RedHat versions of linux, one compiles and installs Gri in the
792 usual way; see the manual for more details.
793
794 Users of RedHat linux have it much easier though! A RPM (RedHat
795 Program Manager) version of Gri exists, so that installing it takes
796 just one line of typing, or one mouse-click in the RPM GUI-based
797 installer called `glint'. requires just one line of typing.
798
799 The RPM (RedHat Package Manager) version exists at FTP site
800 ftp://ftp.phys.ocean.dal.ca/users/kelley/gri
801 in a file with a name such as `gri-2.1.17-1.i386.rpm'
802 (RedHat readers will know immediately what all the numbers and dots
803 stand for!) Once you've downloaded this, install Gri by typing
804 rpm -i gri-2.1.17-1.i386.rpm
805
806 Later on, Gri may be uninstalled ('extracted') by typing
807 rpm -e gri
808
809 Knowledgeable RedHat users will know that RPM can also give
810 information about Gri; for non-experts, here are a few examples:
811 rpm -qa -- list all installed packages
812 rpm -qi gri -- summarize gri capabilities (if it's installed)
813 rpm -ql gri -- list all files related to gri
814 _________________________________________________________________
815
816 A7 Gri bugs
817
818
819 A7.1 What are known bugs in Gri?
820
821 Gri is used daily by many users, including the author, so that it
822 suffers few serious bugs. Generally, more recent versions of Gri
823 suffer fewer bugs than earlier versions. This improvement owes much to
824 the trial of daily usage by folks with differing working styles; and
825 all users can thank those who send in bug reports (see Q7.2).
826
827 One of the main problems with recent versions of Gri is that line
828 numbers of syntax errors are reported inaccurately, if the error
829 occured inside a new-command.
830
831 A list of Gri bugs is maintained in the manual.
832
833
834
835 A7.2 How can I report Gri bugs?
836
837 The first step is to make sure it is actually a bug. You might try,
838 for example, posting a question to the Gri newsgroup (see Q2.3),
839 and getting advice from other users. Please be clear, so you don't
840 waste others users' time. If you think you've found a bug, let the
841 author know. Here's the advice from the manual (see especially item 4,
842 for directions on emailing bug reports):
843
844 Your bug reports help make Gri reliable and useful. Reporting bugs
845 often results in quick changes to gri which will solve your problem.
846 This is especially true if your version is reasonably up-to-date, for
847 then you can simply get the corrected version and replace the version
848 you were using. Here is how to report bugs.
849
850 The details of how to report bugs is in the online documents ,
851 but the quick answer is to go to the Sourceforge Gri/bug site and
852 use the slick GUI interface there.
853
854 References
855
856 1. http://www.phys.ocean.dal.ca/~kelley
857 2. mailto:[email protected]
858 3. file://localhost/home/kelley/GRI-work/gri/doc/FAQ.html#A1.1
859 4. file://localhost/home/kelley/GRI-work/gri/doc/FAQ.html#A1.2
860 5. file://localhost/home/kelley/GRI-work/gri/doc/FAQ.html#A1.3
861 6. file://localhost/home/kelley/GRI-work/gri/doc/FAQ.html#A1.4
862 7. file://localhost/home/kelley/GRI-work/gri/doc/FAQ.html#A2.1
863 8. file://localhost/home/kelley/GRI-work/gri/doc/FAQ.html#A2.2
864 9. file://localhost/home/kelley/GRI-work/gri/doc/FAQ.html#A2.3
865 10. file://localhost/home/kelley/GRI-work/gri/doc/FAQ.html#A2.4
866 11. file://localhost/home/kelley/GRI-work/gri/doc/FAQ.html#A2.5
867 12. file://localhost/home/kelley/GRI-work/gri/doc/FAQ.html#A3.1
868 13. file://localhost/home/kelley/GRI-work/gri/doc/FAQ.html#A3.2
869 14. file://localhost/home/kelley/GRI-work/gri/doc/FAQ.html#A3.3
870 15. file://localhost/home/kelley/GRI-work/gri/doc/FAQ.html#A3.4
871 16. file://localhost/home/kelley/GRI-work/gri/doc/FAQ.html#A3.5
872 17. file://localhost/home/kelley/GRI-work/gri/doc/FAQ.html#A3.6
873 18. file://localhost/home/kelley/GRI-work/gri/doc/FAQ.html#A3.7
874 19. file://localhost/home/kelley/GRI-work/gri/doc/FAQ.html#A3.8
875 20. file://localhost/home/kelley/GRI-work/gri/doc/FAQ.html#A4.1
876 21. file://localhost/home/kelley/GRI-work/gri/doc/FAQ.html#A4.2
877 22. file://localhost/home/kelley/GRI-work/gri/doc/FAQ.html#A4.3
878 23. file://localhost/home/kelley/GRI-work/gri/doc/FAQ.html#A4.4
879 24. file://localhost/home/kelley/GRI-work/gri/doc/FAQ.html#A5.1
880 25. file://localhost/home/kelley/GRI-work/gri/doc/FAQ.html#A5.2
881 26. file://localhost/home/kelley/GRI-work/gri/doc/FAQ.html#A5.3
882 27. file://localhost/home/kelley/GRI-work/gri/doc/FAQ.html#A5.4
883 28. file://localhost/home/kelley/GRI-work/gri/doc/FAQ.html#Q6.1
884 29. file://localhost/home/kelley/GRI-work/gri/doc/FAQ.html#Q6.2
885 30. file://localhost/home/kelley/GRI-work/gri/doc/FAQ.html#Q6.3
886 31. file://localhost/home/kelley/GRI-work/gri/doc/FAQ.html#Q6.4
887 32. file://localhost/home/kelley/GRI-work/gri/doc/FAQ.html#Q6.5
888 33. file://localhost/home/kelley/GRI-work/gri/doc/FAQ.html#Q6.6
889 34. file://localhost/home/kelley/GRI-work/gri/doc/FAQ.html#A7.1
890 35. file://localhost/home/kelley/GRI-work/gri/doc/FAQ.html#A7.2
891 36. file://localhost/home/kelley/GRI-work/gri/doc/FAQ.html#Q1.1
892 37. file://localhost/home/kelley/GRI-work/gri/doc/FAQ.html#Q1.2
893 38. file://localhost/home/kelley/GRI-work/gri/doc/FAQ.html#Q1.3
894 39. http://www.phys.ocean.dal.ca/~kelley/gre
895 40. file://localhost/home/kelley/GRI-work/gri/doc/FAQ.html#Q1.4
896 41. file://localhost/home/kelley/GRI-work/gri/doc/FAQ.html#Q2.1
897 42. file://localhost/home/kelley/GRI-work/gri/doc/FAQ.html#Q2.3
898 43. file://localhost/home/kelley/GRI-work/gri/doc/FAQ.html#Q2.1
899 44. ftp://ftp.phys.ocean.dal.ca/users/kelley/gri
900 45. file://localhost/home/kelley/GRI-work/gri/doc/FAQ.html#Q2.2
901 46. ftp://ftp.phys.ocean.dal.ca/users/kelley/gri
902 47. http://gri.sourceforge.net/gridoc/html/index.html
903 48. file://localhost/home/kelley/GRI-work/gri/doc/FAQ.html#Q2.3
904 49. http://gri.sourceforge.net/gri-cookbook/index.html
905 50. file://localhost/home/kelley/GRI-work/gri/doc/FAQ.html#Q2.4
906 51. mailto:[email protected]
907 52. mailto:[email protected]
908 53. http://sourceforge.net/forum/?group_id=5511
909 54. file://localhost/home/kelley/GRI-work/gri/doc/FAQ.html#Q2.5
910 55. ftp://ftp.phys.ocean.dal.ca/users/kelley/gri
911 56. file://localhost/home/kelley/GRI-work/gri/doc/FAQ.html#Q3.1
912 57. file://localhost/home/kelley/GRI-work/gri/doc/FAQ.html#Q3.2
913 58. file://localhost/home/kelley/GRI-work/gri/doc/FAQ.html#Q3.3
914 59. file://localhost/home/kelley/GRI-work/gri/doc/FAQ.html#Q3.4
915 60. file://localhost/home/kelley/GRI-work/gri/doc/FAQ.html#Q3.5
916 61. file://localhost/home/kelley/GRI-work/gri/doc/FAQ.html#Q3.6
917 62. file://localhost/home/kelley/GRI-work/gri/doc/FAQ.html#Q3.7
918 63. file://localhost/home/kelley/GRI-work/gri/doc/FAQ.html#Q3.8
919 64. http://crusty.er.usgs.gov/coast/getcoast.html
920 65. http://www.usgs.gov/
921 66. http://www.ngdc.noaa.gov/mgg/shorelines/gshhs.html
922 67. file://localhost/home/kelley/GRI-work/gri/doc/FAQ.html#Q4.1
923 68. file://localhost/home/kelley/GRI-work/gri/doc/FAQ.html#Q4.2
924 69. file://localhost/home/kelley/GRI-work/gri/doc/FAQ.html#Q4.3
925 70. http://www.lanl.gov/projects/ia
926 71. http://www.wizards.dupont.com/cristy/ImageMagick.html
927 72. http://www.cs.wisc.edu/~ghost/index.html
928 73. ftp://prep.ai.mit.edu/pub/gnu
929 74. file://localhost/home/kelley/GRI-work/gri/doc/FAQ.html#Q4.4
930 75. file://localhost/home/kelley/GRI-work/gri/doc/FAQ.html#Q5.1
931 76. ftp://ftp.phys.ocean.dal.ca/users/kelley/gri
932 77. file://localhost/home/kelley/GRI-work/gri/doc/FAQ.html#Q5.2
933 78. http://gri.sourceforge.net/gridoc/html/History.html
934 79. file://localhost/home/kelley/GRI-work/gri/doc/FAQ.html#Q5.3
935 80. file://localhost/home/kelley/GRI-work/gri/doc/FAQ.html#Q2.3
936 81. file://localhost/home/kelley/GRI-work/gri/doc/FAQ.html#Q5.4
937 82. file://localhost/home/kelley/GRI-work/gri/doc/FAQ.html#Q6.1
938 83. file://localhost/home/kelley/GRI-work/gri/doc/FAQ.html#Q6.2
939 84. file://localhost/home/kelley/GRI-work/gri/doc/FAQ.html#Q6.3
940 85. file://localhost/home/kelley/GRI-work/gri/doc/FAQ.html#Q6.4
941 86. http://gri.sourceforge.net/gridoc/html/mac-install.html#Mac-install
942 87. file://localhost/home/kelley/GRI-work/gri/doc/FAQ.html#Q6.5
943 88. ftp://ftp.phys.ocean.dal.ca/users/kelley/gri
944 89. ftp://shiho.tokyo-u-fish.ac.jp/pub/msdos/gri
945 90. mailto:[email protected]
946 91. http://gri.sourceforge.net/gridoc/html/msdos-install.html#Msdos-install
947 92. http://www.cs.wisc.edu/~ghost/index.html
948 93. file://localhost/home/kelley/GRI-work/gri/doc/FAQ.html#Q6.6
949 94. http://gri.sourceforge.net/gridoc/html/index.html
950 95. ftp://ftp.phys.ocean.dal.ca/users/kelley/gri
951 96. file://localhost/home/kelley/GRI-work/gri/doc/FAQ.html#Q7.1
952 97. file://localhost/home/kelley/GRI-work/gri/doc/FAQ.html#Q7.2
953 98. http://gri.sourceforge.net/gridoc/html/KnownBugs.html#KnownBugs
954 99. file://localhost/home/kelley/GRI-work/gri/doc/FAQ.html#Q7.2
955 100. file://localhost/home/kelley/GRI-work/gri/doc/FAQ.html#Q2.3
956 101. http://gri.sourceforge.net/gridoc/html/ReportingBugs.html#ReportingBugs
957 102. http://sourceforge.net/bugs/?group_id=5511