home *** CD-ROM | disk | FTP | other *** search
/ Math Solutions 1995 October / Math_Solutions_CD-ROM_Walnut_Creek_October_1995.iso / pc / mac / discrete / doc / install.tex < prev    next >
Encoding:
Text File  |  1993-05-05  |  109.4 KB  |  2,365 lines

  1. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  2. %%
  3. %A  install.tex                 GAP documentation            Martin Schoenert
  4. %%
  5. %A  @(#)$Id: install.tex,v 3.14 1993/02/19 11:30:42 gap Exp $
  6. %%
  7. %Y  Copyright 1990-1992,  Lehrstuhl D fuer Mathematik,  RWTH Aachen,  Germany
  8. %%
  9. %%  This file describes the installation and features of \GAP\ on various OS.
  10. %%
  11. %%  Currently only UNIX  and TOS on the   Atari ST are supported.   Hopefully
  12. %%  more systems will follow soon, especially DOS on 386PC and the Macintosh.
  13. %%
  14. %%  To read about the  system you are   interested in, search for  the string
  15. %%  'Section{<system>}', e.g., 'Section{UNIX}' or 'Section{Atari ST}'.
  16. %%
  17. %H  $Log: install.tex,v $
  18. %H  Revision 3.14  1993/02/19  11:30:42  gap
  19. %H  removed overfull hboxes
  20. %H
  21. %H  Revision 3.13  1993/02/19  10:48:42  gap
  22. %H  adjustments in line length and spelling
  23. %H
  24. %H  Revision 3.12  1993/02/18  07:55:21  felsch
  25. %H  some misprints removed
  26. %H
  27. %H  Revision 3.11  1993/02/17  15:07:32  felsch
  28. %H  example fixed
  29. %H
  30. %H  Revision 3.10  1993/02/16  15:06:04  fceller
  31. %H  fixed example, changed description of 'gapexe.next'
  32. %H
  33. %H  Revision 3.9  1993/02/11  15:51:53  martin
  34. %H  updated for 3.2
  35. %H
  36. %H  Revision 3.8  1992/05/25  18:09:39  martin
  37. %H  added "Upgrading GAP"
  38. %H
  39. %H  Revision 3.7  1992/05/22  08:58:45  martin
  40. %H  added the sections for IBM PC compatibles
  41. %H
  42. %H  Revision 3.6  1992/04/09  11:36:01  martin
  43. %H  made a few changes so that two LaTeX passes suffice
  44. %H
  45. %H  Revision 3.5  1992/04/07  22:48:42  martin
  46. %H  fixed the examples
  47. %H
  48. %H  Revision 3.4  1992/04/02  18:03:40  martin
  49. %H  added the banner
  50. %H
  51. %H  Revision 3.3  1992/03/25  15:49:27  martin
  52. %H  changed the output of 'ls <gap-dir>/doc'
  53. %H
  54. %H  Revision 3.2  1992/03/23  12:37:54  martin
  55. %H  added "Getting GAP"
  56. %H
  57. %H  Revision 3.1  1992/03/23  11:58:51  martin
  58. %H  improved the installation sections
  59. %H
  60. %H  Revision 3.0  1991/12/27  16:10:27  martin
  61. %H  initial revision under RCS
  62. %H
  63. %%
  64. \Chapter{Getting and Installing GAP}%
  65. \index{installation}\index{options}
  66.  
  67. {\GAP} runs on a large number of different operating systems.  It behaves
  68. slightly  different on  each  of  those.    This chapter  describes   the
  69. behaviour of {\GAP}, the  installation, and the options  on some of those
  70. operating systems.
  71.  
  72. Currently  it contains  sections  for  *UNIX*  (see "UNIX", "Installation
  73. under  UNIX", "Features under UNIX"), which  runs on  an ever  increasing
  74. number  of machines, for  *MS-DOS*, which is the operating system on *IBM
  75. PC compatibles* (see "IBM PC Compatibles", "Copyright  of GAP  for IBM PC
  76. Compatibles", "Installation on  IBM PC Compatibles", "Features on  IBM PC
  77. Compatibles"), and *TOS*, which is the operating system of the *Atari ST*
  78. (see "Atari  ST", "Installation on the Atari ST", "Features  on the Atari
  79. ST").
  80.  
  81. When you port {\GAP} to a new machine we would like to hear  about it, so
  82. that we can make this new port  available  to others.  We are  especially
  83. interested in ports to the Macintosh, and to VMS on DEC VAX systems.  The
  84. section "Porting GAP" gives hints how to approach such a port.
  85.  
  86. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  87. \Section{Getting GAP}%
  88. \index{ftp}
  89.  
  90. {\GAP}  is distributed *free of charge*.  You can obtain it via 'ftp'  or
  91. electronic mail  and give it away to your colleagues.  {\GAP} is *not* in
  92. the  public  domain,  however.  In  particular  you are  not  allowed  to
  93. incorporate {\GAP} or parts thereof into a commercial product.
  94.  
  95. If you get {\GAP}, we would appreciate it if you  could notify  us, e.g.,
  96. by  sending a short  e-mail message  to 'gap@samson.math.rwth-aachen.de',
  97. containing your full name and address,  so that we  have a  rough idea of
  98. the number of users.   We also hope that this number will be large enough
  99. to  convince  various  agencies  that  {\GAP}  is  a  project  worthy  of
  100. (financial) support.  If you publish some result that was partly obtained
  101. using {\GAP},  we  would appreciate it  if you would cite {\GAP}, just as
  102. you would cite another paper that you used.  Again we would appreciate if
  103. you could inform us about such a paper.
  104.  
  105. We  distribute  the *full source*  for everything, the  C  code  for  the
  106. kernel, the {\GAP}  code for the library, and  the {\LaTeX}  code for the
  107. manual, which has at present about 800 pages.  So it should be no problem
  108. to get {\GAP}, even  if  you  have a rather uncommon system.   Of course,
  109. ports to  non UNIX  systems may require some work.  We already have ports
  110. for IBM PC compatibles with an Intel 80386 or 80486 and for the Atari ST.
  111. We also hope to provide a port  of {\GAP} 3.2  to  the Apple Macintosh in
  112. the near future (there is already a port of {\GAP} 3.1).  Note that about
  113. 4 MByte of main memory and a harddisk are required to run {\GAP}.
  114.  
  115. {\GAP} 3.2 can be obtained by anonymous *ftp* from the following servers.
  116.  
  117. 'samson.math.rwth-aachen.de':\\
  118.         Lehrstuhl D fur Mathematik, RWTH Aachen, Germany.\\
  119.         (Internet number 137.226.152.6)
  120.  
  121. 'dimacs.rutgers.edu':\\
  122.         DIMACS, Rutgers, New Brunswick, New Jersey.\\
  123.         (Internet number 128.6.75.16)
  124.  
  125. 'math.ucla.edu':\\
  126.         Math. Dept., Univ. of California at Los Angeles.\\
  127.         (Internet number 128.97.4.254)
  128.  
  129. 'wuarchive.wustl.edu':\\
  130.         Mathematics Archives, Univ. of Tennessee.\\
  131.         (Internet number 128.252.135.4) \\
  132.         (directory '/edu/math/source.code/group.theory/gap')
  133.  
  134. 'pell.anu.edu.au':\\
  135.         Math. Dept., Australian National Univ., Canberra.\\
  136.         (Internet number 150.203.15.5)
  137.  
  138. 'ftp' to the server *closest* to  you, login  as user 'ftp' and give your
  139. full e-mail address as password.  {\GAP} is  in the directory  'pub/gap'.
  140. Remember  when  you transmit the  files to  set the file transfer type to
  141. *binary image*, otherwise you  will only receive unusable garbage.  Those
  142. servers will always have the latest version of {\GAP} available.
  143.  
  144. {\GAP}  can also be obtained via  *electronic mail*.   To get one of  the
  145. files  below, send  a  message  to  'listserv@samson.math.rwth-aachen.de'
  146. containing  a line 'get  GAP <file-name>', e.g., 'get GAP  src3r2.tar.Z'.
  147. 'listserv' will reply by sending you the file as e-mail message.
  148.  
  149. Because most files are  large  binary files they will  be  uuencoded  and
  150. split into  several parts,  each   at  most 64  kBytes  large.   You  can
  151. concatenate  the parts  by hand,  removing the mail  header, and then use
  152. 'uudecode' to decode them.  We suggest however that you also get 'uud.c',
  153. which skips  the  mail headers automatically  and  is also able to fix up
  154. transmission errors caused by 'EBCDIC' machines.  You can also get single
  155. parts of a file by sending 'get GAP <file-name> <part-nr>'.
  156.  
  157. For users in the United Kingdom with only Janet access, neither 'ftp' nor
  158. the mail server will work (please do *not*  try to  use the mail server).
  159. Please contact Derek Holt (e-mail address 'dfh@maths.warwick.ac.uk').  He
  160. has kindly offered us to distribute GAP in the United Kingdom.
  161.  
  162. The 'ftp'  directory and  the 'listserv' archive   contain  the following
  163. files.  Please check first  which files you  need, to  avoid transferring
  164. those that you don\'t need.
  165.  
  166. 'README':\\
  167.         the announcement for {\GAP}.
  168.  
  169. {\GAP} version 3  release 2 itself comes in  several  files.  You  do not
  170. need all of those files.  All files are 'compress'-ed 'tar' archives.
  171.  
  172. 'src3r2.tar.Z':\\
  173.         the *source code* for the {\GAP} kernel.  You need it  unless you
  174.         get one of the executables below.  This  file is about 750 KBytes
  175.         long.
  176.  
  177. 'lib3r2.tar.Z':\\
  178.         the  *library of functions*.  You need this.   This file is about
  179.         1000 KBytes long.
  180.  
  181. 'doc3r2.tar.Z':\\
  182.         the *documentation*.   Serves  as  LaTeX  source for  the printed
  183.         manual and  online documentations.  This file is about 850 KBytes
  184.         long.
  185.  
  186. 'doc3r2.dvi.Z':\\
  187.         the preformatted documentation.  You need this if you do not have
  188.         a *big* TeX.  This file is about 1100 KByte long.
  189.  
  190. 'grp3r2.tar.Z':\\
  191.         various  *group  libraries*.  Contains for example all  primitive
  192.         permutation groups of  degree at most 50.  This file is about  50
  193.         KByte long.
  194.  
  195. 'two3r2.tar.Z':\\
  196.         the library of *2-groups* of size  at  most  256.  This  file  is
  197.         about 650 KByte long.
  198.  
  199. 'thr3r2.tar.Z':\\
  200.         the library of *3-groups* of size  at  most  729.  This  file  is
  201.         about 20 KByte long.
  202.  
  203. 'tbl3r2.tar.Z':\\
  204.         a library of *character tables* including all of the ATLAS.  This
  205.         file is about 2050 KByte long.
  206.  
  207. 'tom3r2.tar.Z':\\
  208.         a library of *table of marks* of  various groups.  This  file  is
  209.         about 450 KByte long.
  210.  
  211. 'anupq.tar.Z':\\
  212.         the *ANU PQ* share library package.  This file is about 350 KByte
  213.         long.
  214.  
  215. 'nq.tar.Z':\\
  216.         the *NQ*  share  library  package.  This  file is about 100 KByte
  217.         long.
  218.  
  219. 'weyl.tar.Z':\\
  220.         the *Weyl* share library package.  This  file  is about  50 KByte
  221.         long.
  222.  
  223. 'src3r2.zoo', 'lib3r2.zoo', 'doc3r2.zoo', 'grp3r2.zoo', \\
  224. 'two3r2.zoo', 'thr3r2.zoo', 'tbl3r2.zoo', 'tom3r2.zoo', \\
  225. 'anupq.zoo',  'nq.zoo',     'weyl.zoo':\\
  226.         'zoo'  archives  containing  *exactly*  the  same  files  as  the
  227.         'compress'-ed   'tar'   archives   above.    The   advantage   of
  228.         'compress'-ed  'tar' archives is that 'uncompress' and 'tar'  are
  229.         widely  available  on  UNIX  systems.   The  advantage  of  'zoo'
  230.         archives  is that  they are smaller (about  30 percent)  and that
  231.         'zoo' is more common on PC-s and  Atari ST-s.  (These  files  may
  232.         not be available on all servers.)
  233.  
  234. We supply executables for machines  that  don\'t usually come  with  a  C
  235. compiler  or  machines  where  the  standard C compiler does  not produce
  236. optimal results.  If you have one of those machines it will be easier for
  237. you  to get this executable  instead of compiling  {\GAP}  yourself.  The
  238. following  executables  are  available  (again these  files  may  not  be
  239. available on all servers)
  240.  
  241. 'gapexe.386':\\
  242.         executable for IBM  PC  compatibles with  an Intel 80386 or 80486
  243.         running  MS-DOS 5.0 compiled with the GNU C  2.2.2 compiler.  See
  244.         below for the copyright.  This file is about 500 KByte long.
  245.  
  246. 'gapexe.next':\\
  247.         executable for  the  NeXT (680?0)  running  NeXTstep 3.0 compiled
  248.         with GNU C compiler 2.3.3.  This file is about 400 KByte long.
  249.  
  250. 'gapexe.st':\\
  251.         executable for Atari ST (680?0) running TOS compiled with the GNU
  252.         C compiler.  This file is about 450 KByte long.
  253.  
  254. 'gapexe.su3':\\
  255.         executable for SUN 3 (680?0) running SunOS 4.0 or higher compiled
  256.         with SunOS C.  This file is about 500 KByte long.
  257.  
  258. 'gapexe.su4':\\
  259.         executable for SUN 4 (Sparc) running SunOS 4.1 or higher compiled
  260.         with GNU C 2.3.2 compiler.  This file is about 600 KByte long.
  261.  
  262. The following support files are also available (and again these files may
  263. not be available on all servers)
  264.  
  265. 'compress.tar':\\
  266.         'compress' version 4.1.  You need  this program to uncompress the
  267.         compressed tar files.  Note however, that almost all UNIX systems
  268.         these days already come with an executable 'compress'.  This file
  269.         is about 40 KByte long.
  270.  
  271. 'patch.tar.Z':\\
  272.         Larry Wall\'s 'patch' program version 2.0.2.0 (patchlevel  12u4).
  273.         This program can be used  to automatically apply  upgrades.  Note
  274.         that older versions  of 'patch' are *not* able to understand  the
  275.         unified 'diff'  format  used in the  upgrade files.  This file is
  276.         about 70 KByte long.
  277.  
  278. 'uud.c':\\
  279.         'uud' version 3.4.  'uud' is much better than the 'uudecode' that
  280.         comes with most UNIX systems.  This file is about 12 KByte long.
  281.  
  282. 'zoo21.tar.Z':\\
  283.         Rahul Dhesi\'s 'zoo' archiver  version  2.1.   You  need  this to
  284.         unpack the *zoo-archives*.  Note that the widespread version 2.01
  285.         will *not* work.  This file is about 240 KByte long.
  286.  
  287. 'zooexe.386':\\
  288.         Executable of 'zoo' for  IBM PC  compatibles.  This file is about
  289.         55 KByte long.
  290.  
  291. 'zooexe.st':\\
  292.         Executable of  'zoo' for the  Atari  ST.  This  file is  about 80
  293.         KByte long.
  294.  
  295. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  296. \Section{Upgrading GAP}
  297.  
  298. From time  to  time we  will  *upgrade* {\GAP}.  There  are generally two
  299. types of  upgrades.  The  major  upgrades create  new  *releases* and the
  300. minor  are upgrades between releases.  New releases usually introduce new
  301. features while upgrades  between releases  usually only fix bugs found in
  302. one release.
  303.  
  304. Each version  has  a  number.  The number of  a  release consists of  two
  305. parts.  The first  part is  the  *version number*,  which is currently 3.
  306. The  second part  is  the *release  number*,  which  is  1 for  the first
  307. release, 2 for  the second, and so on.  The current number is  *version 3
  308. release  1*, which we  sometimes abbreviate  to  'V3R1'.  The number of a
  309. upgrade between releases consists of three  parts.  The first and  second
  310. part are the  version and release  number  of  the  current release.  The
  311. third part is called the *patchlevel*.  The first upgrade after a release
  312. has patchlevel 1, the second patchlevel 2, and so on.  The current number
  313. is *version 3 release  2 patchlevel 0*, which we sometimes abbreviate  to
  314. 'V3R2P0'.
  315.  
  316. Because it would be too much work for us to put the complete distribution
  317. (which currently is about 6  MByte  for the  'compress'-ed 'tar' archives
  318. alone)  on the 'ftp' servers for every upgrade, and also because it would
  319. be  a lot of  work  for you to obtain the complete distribution for every
  320. upgrade, we  only make  the differences between  one upgrade and the next
  321. one available.  They  are  stored in  a  single  file, called an *upgrade
  322. file*.  For example the  differences  between  'V3R1P1' and  'V3R1P2' are
  323. stored  in a file called 'upg3r1p2.dif'  (actually this  file  is  stored
  324. 'compress'-ed   on   the   'ftp'   servers,   so   its   true   name   is
  325. 'upg3r1p2.dif.Z').
  326.  
  327. Note that upgrade files always take you from one version to the next.  So
  328. to upgrade to  'V3R1P2'  you  must first  upgrade  to 'V3R1P1'.  Also the
  329. upgrade to a new release will be relative to the latest patchlevel of the
  330. previous release.   So to  upgrade to 'V3R2' you must  first  upgrade  to
  331. 'V3R1P2', or whatever will be the latest patchlevel of the first release.
  332.  
  333. Note also  that we will provide new executables  only  for  new releases.
  334. That  means that  currently the  executables  we  provide  are those  for
  335. 'V3R1', not those for 'V3R1P2'.  So  for  example, to get  the executable
  336. for  'V3R1P2'  for the Atari ST, you must get the sources for the kernel,
  337. upgrade  them, and compile  them yourself.  Note  however, that  upgrades
  338. between releases will only fix bugs, of which we  hope there will  not be
  339. too many in the kernel.  That means that it should be possible to use the
  340. executables  even  with the  upgraded library.  The  same holds  for  the
  341. preformatted documentation ('doc3r1.dvi.Z').
  342.  
  343. To make it easier for you to apply an upgrade, the upgrade files are in a
  344. special format, called (unified) 'diff', which a  special program, called
  345. 'patch',  can   understand.    'patch'   reads   the   upgrade  file  and
  346. automatically makes all the necessary changes to the files.  This program
  347. is  available on  most UNIX machines.  However, we also make it available
  348. on the 'ftp' servers, so  you can get it from there  if your machine does
  349. not have one or if your machine  has one  that is  too  old to understand
  350. unified 'diff'-s.
  351.  
  352. To apply an upgrade you need the sources for the parts of {\GAP} that you
  353. are interested in.  This should at least be the sources, the library, and
  354. the documentation.  You may also have  the groups  library, the primitive
  355. groups library,  the 2-groups library, and  the character table  library.
  356. If  an upgrade changes  a file in one of the  parts that you do not have,
  357. 'patch'  will ask you about the file it  cannot find.  Then  you can tell
  358. 'patch' to ignore this change, and it will continue to change those files
  359. it can find.
  360.  
  361. In  the following example,  we assume that  you (as user 'you') have  all
  362. parts of {\GAP}, that {\GAP}  is installed in  the subdirectory 'gap/' of
  363. your homedirectory, and that you want to upgrade from 'V3R1' to 'V3R1P1'.
  364.  
  365. The first thing  of course is to get the upgrade file.  The upgrade files
  366. are available at  the  same  places as the rest  of {\GAP} (see  "Getting
  367. GAP").  If you are subscribed to the  {\GAP}-forum, you will also get the
  368. upgrade  files as  e-mail messages.   In this example we will assume that
  369. you have obtained the upgrade file 'upg3r1p1.dif.Z' from one of the 'ftp'
  370. servers.
  371.  
  372. |    you@ernie:~/gap > ls -l
  373.     drwxr-xr-x  2 you          1536 May 25 18:03 doc
  374.     drwxr-xr-x  2 you           512 May 25 18:03 grp
  375.     drwxr-xr-x  2 you          1536 May 25 18:02 lib
  376.     drwxr-xr-x  2 you          1536 May 25 18:01 src
  377.     drwxr-xr-x  2 you          1536 May 25 18:04 tbl
  378.     drwxr-xr-x  2 you          1024 May 25 18:04 two
  379.     -rw-r--r--  1 you         45866 May 25 18:04 upg3r1p1.dif.Z
  380.     you@ernie:~/gap > |
  381.  
  382. Next 'uncompress' the upgrade file with the following command.
  383.  
  384. |    you@ernie:~/gap > uncompress upg3r1p1.dif
  385.     you@ernie:~/gap > ls -l upg3r1p1.dif
  386.     -rw-r--r--  1 you        123695 May 25 18:04 upg3r1p1.dif
  387.     you@ernie:~/gap > |
  388.  
  389. The first thing that you should do is always to read the beginning of the
  390. upgrade file.  It contains instructions on how to apply the upgrade.  You
  391. should always read this  to see if there are special  things that must be
  392. done before  this  upgrade can be applied.  For  example, before  you can
  393. apply the upgrade from 'V3R1P1' to 'V3R1P2' you must first make a copy of
  394. the file  'src/system.st'.  In our example, i.e., the upgrade from 'V3R1'
  395. to 'V3R1P1' no special tasks must be performed.
  396.  
  397. Now you apply the upgrade with the following command.
  398.  
  399. |    you@ernie:~/gap > patch -p0 < upg3r1p1.dif
  400.     Hmm...  Looks like a unified diff to me...
  401.     The text leading up to this was:
  402.     --------------------------
  403.     !What is this file?
  404.     !==================
  405.  
  406.     # 'patch' prints the introduction text, about 200 lines long
  407.  
  408.     !Now for the upgrade itself
  409.     !==========================
  410.     !
  411.     !diff -u doc/aboutgap.tex doc/aboutgap.tex
  412.     !--- doc/aboutgap.tex   Thu Apr  9 14:06:31 1992
  413.     !+++ doc/aboutgap.tex   Thu Apr 30 14:38:06 1992
  414.     --------------------------
  415.     Patching file doc/aboutgap.tex using Plan A...
  416.     Hunk |'\#'|1 succeeded at 6.
  417.     Hunk |'\#'|2 succeeded at 13.
  418.     Hunk |'\#'|3 succeeded at 493.
  419.     Hunk |'\#'|4 succeeded at 529.
  420.     Hunk |'\#'|5 succeeded at 1074.
  421.     Hunk |'\#'|6 succeeded at 5168.
  422.     Hmm...  The next patch looks like a unified diff to me...
  423.     The text leading up to this was:
  424.     --------------------------
  425.     !diff -u doc/aggroup.tex doc/aggroup.tex
  426.     !--- doc/aggroup.tex    Thu Apr  9 14:06:33 1992
  427.     !+++ doc/aggroup.tex    Thu Apr 30 14:20:05 1992
  428.     --------------------------
  429.     Patching file doc/aggroup.tex using Plan A...
  430.     Hunk |'\#'|1 succeeded at 2.
  431.     Hunk |'\#'|2 succeeded at 10.
  432.     Hunk |'\#'|3 succeeded at 336.
  433.     Hunk |'\#'|4 succeeded at 2708.
  434.  
  435.     # similar output for 70 more files, about 700 lines
  436.  
  437.     Hmm...  The next patch looks like a unified diff to me...
  438.     The text leading up to this was:
  439.     --------------------------
  440.     !diff -u src/word.h src/word.h
  441.     !--- src/word.h Fri Apr  3 20:56:34 1992
  442.     !+++ src/word.h Wed Apr 29 13:28:43 1992
  443.     --------------------------
  444.     Patching file src/word.h using Plan A...
  445.     Hunk |'\#'|1 succeeded at 3.
  446.     done
  447.     you@ernie:~/gap > |
  448.  
  449. See below about the  things that  could go wrong.  For the moment we will
  450. assume that everything worked, i.e., that 'patch' did not complain.
  451.  
  452. Next compile the  source  of  the  kernel again.   How  this  is  done is
  453. described in  the installation sections (see "Installation under  UNIX").
  454. Note that it may not be necessary to do this if the source of  the kernel
  455. did not  change, or if the changes were only  cosmetic.  The introduction
  456. of the upgrade file will tell you if it is really necessary or not.
  457.  
  458. Then  {\LaTeX}  the  documentation  again.   How this  is  done  is  also
  459. described in  the  installation  sections (see "Installation under UNIX",
  460. "Installation on IBM PC Compatibles",  "Installation  on  the Atari ST").
  461. Again this may not be necessary,  if the changes to the manual were  only
  462. minor.  Again the introduction of the upgrade file will tell you if it is
  463. really necessary or not.
  464.  
  465. Now you may want to throw away the original files.  'patch' saves them by
  466. appending the suffix '.orig' to the original file name.  So to remove all
  467. original files issue the following command.
  468.  
  469. |    you@ernie:~/gap > rm -f */*.orig
  470.     you@ernie:~/gap > |
  471.  
  472. There are several things that can go wrong.
  473.  
  474. The first possibility is that you don\'t  have 'patch'.  In this case get
  475. 'patch', for example by anonymous 'ftp' from 'samson.math.rwth-aachen.de'
  476. (Internet number 137.226.152.6).
  477.  
  478. Another possibility is that  you  have a version  of 'patch' that  is too
  479. old.   Versions  of  'patch'  before  2.0.2.0  (patchlevel  12u4)  don\'t
  480. understand the unified 'diff' format of this upgrade file.  In this  case
  481. you will see the following message.
  482.  
  483. |    you@ernie:~/gap > patch -p0 < upg3r1.dif
  484.     Hmm...  I can't seem to find a patch in there anywhere.
  485.     you@ernie:~/gap > |
  486.  
  487. To solve this problem, get a newer version of 'patch'.   For  example  by
  488. anonymous 'ftp' from 'samson.math.rwth-aachen.de'.
  489.  
  490. Another possibility is that you forgot the '-p0' option for 'patch'.   In
  491. this case 'patch' assumes  that the files to patch are all in the current
  492. directory (not in the subdirectories 'doc', 'grp', etc.).  It can\'t find
  493. them there of course.  Therefore it asks you for the names  of  the files
  494. to patch interactively.
  495.  
  496. |    you@ernie:~/gap > patch -p0 < upg3r1p1.dif
  497.     Hmm...  Looks like a unified diff to me...
  498.     The text leading up to this was:
  499.     --------------------------
  500.     !What is this file?
  501.     !==================
  502.  
  503.     # 'patch' prints the introduction text, about 200 lines long
  504.  
  505.     !Now for the upgrade itself
  506.     !==========================
  507.     !
  508.     !diff -u doc/aboutgap.tex doc/aboutgap.tex
  509.     !--- doc/aboutgap.tex   Thu Apr  9 14:06:31 1992
  510.     !+++ doc/aboutgap.tex   Thu Apr 30 14:38:06 1992
  511.     --------------------------
  512.     File to patch: |
  513.  
  514. Stop 'patch' by hitting <ctr>-'C', and  start it anew, this time with the
  515. option '-p0'.
  516.  
  517. Another possibility is that you already  changed a file.  For  example if
  518. you already changed 'word.c', which could not be  compiled with GNU cc on
  519. the NeXT, you will get  the  following  message (note  the  message  that
  520. hunk '\#3' failed).
  521.  
  522. |    you@ernie:~/gap > patch -p0 < upg3r1p1.dif
  523.  
  524.     # the usual output from 'patch'
  525.  
  526.     Hmm...  The next patch looks like a unified diff to me...
  527.     The text leading up to this was:
  528.     --------------------------
  529.     !diff -u src/word.c src/word.c
  530.     !--- src/word.c Sun Apr  5 23:29:44 1992
  531.     !+++ src/word.c Wed Apr 29 13:28:43 1992
  532.     --------------------------
  533.     Patching file src/word.c using Plan A...
  534.     Hunk |'\#'|1 succeeded at 3.
  535.     Hunk |'\#'|2 succeeded at 10.
  536.     Hunk |'\#'|3 failed at 2094.
  537.     Hunk |'\#'|4 succeeded at 2218.
  538.     Hunk |'\#'|5 succeeded at 2469.
  539.     1 out of 5 hunks failed--saving rejects to src/word.c.rej
  540.  
  541.     # the rest of the output from 'patch'
  542.  
  543.     you@ernie:~/gap > |
  544.  
  545. In this case examine the '\*.rej' files  carefully after running 'patch'.
  546. They will tell you what 'patch' expected to find in the file, and what it
  547. really  found.   Then  examine the  source file itself to see if  you can
  548. ignore the rejection, or if you should apply the patch manually.
  549.  
  550. Another  possibility is that 'patch'  cannot  find the  files  it  should
  551. patch.   For example,  if you  don\'t have  the  groups library installed
  552. 'patch' will give the following output.
  553.  
  554. |    you@ernie:~/gap > patch -p0 < upg3r1p1.dif
  555.  
  556.     # the usual output from 'patch'
  557.  
  558.     Hmm...  The next patch looks like a unified diff to me...
  559.     The text leading up to this was:
  560.     --------------------------
  561.     !diff -u grp/permgrp.grp grp/permgrp.grp
  562.     !--- grp/permgrp.grp  Tue Apr  7 22:39:12 1992
  563.     !+++ grp/permgrp.grp  Thu Apr 30 13:14:12 1992
  564.     --------------------------
  565.     File to patch: |
  566.  
  567. Simply type <return> to this question.  'patch' will ask you then.
  568.  
  569. |    No file found--skip this patch? [n] |
  570.  
  571. Answer with 'y<return>', i.e., tell 'patch' to ignore this file.  'patch'
  572. will then show the following output.
  573.  
  574. |    Skipping patch...
  575.     Hunk |'\#'|1 ignored at 2.
  576.     Hunk |'\#'|2 ignored at 9.
  577.     Hunk |'\#'|3 ignored at 83.
  578.     3 out of 3 hunks ignored--saving rejects to grp/permgrp.grp.rej
  579.     patch: can't create grp/permgrp.grp.rej,
  580.            output is in /tmp/patchra22700. |
  581.  
  582. Then it will continue to apply the other patches.
  583.  
  584. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  585. \Section{UNIX}%
  586. \index{BSD}\index{4.2BSD}\index{4.3BSD}\index{ULTRIX}%
  587. \index{System V}\index{SysV}\index{HP-UX}\index{SunOS}%
  588.  
  589. {\GAP} runs very well under UNIX.  In fact  it is being developed on UNIX
  590. workstations.   {\GAP} running on any UNIX machine  should behave exactly
  591. as described in the manual.
  592.  
  593. {\GAP} has successfully been compiled and installed on the following UNIX
  594. machines.
  595.  
  596. |    Vendor,  Model,            Processor,  System,      Compiler
  597.     DEC,     DECstation 3100,  MIPS R2000, Ultrix 4.0,  cc and GNU gcc
  598.     DEC,     DECstation 5120,  MIPS R3000, Ultrix 4.2,  cc and GNU gcc
  599.     HP,      HP 9000/825,      HP-PA 1.0,  HP-UX 7.0,   cc
  600.     HP,      HP 9000/720,      HP-PA 1.1,  HP-UX 8.0.5, cc
  601.     IBM,     POWERstation 530, RS/6000,    AIX,         cc
  602.     IBM,     PC,               i386/i486,  386BSD,      GNU gcc
  603.     IBM,     PC,               i386/i486,  Linux,       GNU gcc
  604.     MIPS,    M120/5,           MIPS R2000, RiscOS,      cc
  605.     NeXT,    NeXTstation,      MC68040,    Mach,        GNU gcc
  606.     Sequent, Symmetry,         ---,        Dynix,       cc,
  607.     SGI,     Iris,             MIPS R3000, Irix,        cc and GNU gcc
  608.     Sun,     Sun 3/60,         MC68020,    SunOS 4.0.1, cc and GNU gcc
  609.     Sun,     Sun 4/280,        Sparc,      SunOS 4.0.1, cc and GNU gcc|
  610.  
  611. We hope that compiling and installing {\GAP} on another UNIX machine does
  612. not  pose any problem.   If it does,  please  inform us of your problems,
  613. and, if possible of your solution.
  614.  
  615. The section "Installation under UNIX" describes how you install {\GAP} on
  616. a  UNIX  machine, and  the section  "Features  under  UNIX" describe  the
  617. options that {\GAP} accepts undex UNIX.
  618.  
  619. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  620. \Section{Installation under UNIX}%
  621. \index{installation!under UNIX}\index{UNIX!installation}
  622.  
  623. Installation of {\GAP}  under UNIX is  fairly easy.  There are however  a
  624. couple of choices to make.
  625.  
  626. The first choice is to decide who should  be able to  use {\GAP}.  It may
  627. be that you are the only user  that will use {\GAP},  or it may be that a
  628. couple of users will be using {\GAP}.  So first decide about this.
  629.  
  630. Next you have to decide on which machines you want to use {\GAP}.  It may
  631. be that  you (and the  other users as well)  will be using {\GAP} only on
  632. one machine, or it may be that  you will be using  {\GAP} on a number of,
  633. possibly different, machines on a network.  So next decide about this.
  634.  
  635. In  the following we  will give two examples.  In  the first  one we will
  636. assume that you, as user 'you', want  to install {\GAP}  for your own use
  637. on one  DECstation, called 'ernie', only.  In  the other example  we will
  638. assume that you,   as user 'local',  are installing   {\GAP}  for use  by
  639. several users on a network of two DECstations, called 'bert' and 'tiffy',
  640. and a   HP 9000/825, called  'goliath'.   Note that  certain parts of the
  641. output in the examples should only be taken  as rough outline, especially
  642. file sizes and file dates are *not* to be taken literally.
  643.  
  644. In the  next step you  have to decide where to  install {\GAP}.  The best
  645. place depends on the decisions  you have made.  If you  are the only  one
  646. who will be using {\GAP} and you will be using it only on one machine, it
  647. is probably  best to install {\GAP}  beneath you homedirectory.  If other
  648. users will also be  using {\GAP}, you  should install {\GAP} in  a public
  649. place accessible to all users.  If you want to use  {\GAP} on a number of
  650. machines on a network, you should install {\GAP} on  a filesystem that is
  651. shared via *NFS* (*N*etwork *F*ile *S*ystem) between those machines.
  652.  
  653. For our first example you have to create  the subdirectory 'gap/' beneath
  654. you homedirectory, assuming that no such directory already exists.
  655.  
  656. |    you@ernie:~ > mkdir gap
  657.     you@ernie:~ > cd gap
  658.     you@ernie:~/gap > |
  659.  
  660. For our  second example you will  have to create the  subdirectory 'gap/'
  661. beneath the directory  '/usr/local/lib/',  which  is a  common place  for
  662. software package of general interest, and which, we assume, is shared via
  663. NFS between 'bert', 'tiffy' and 'goliath'.
  664.  
  665. |    local@goliath:~ > cd lib
  666.     local@goliath:~/lib > mkdir gap
  667.     local@goliath:~/lib > cd gap
  668.     local@goliath:~/lib/gap > |
  669.  
  670. Now you have to get the {\GAP} distribution on your machine.  How you can
  671. obtain {\GAP} is  described in the section  "Getting GAP".  The usual way
  672. would be to get them with 'ftp' onto  you machine.  Remember that all the
  673. files are binary files and that you must transmit them in binary mode.
  674.  
  675. So lets assume that  you have the  files  'src3r2.tar.Z', 'lib3r2.tar.Z',
  676. 'doc3r2.tar.Z',  and maybe  also  the  optional  files 'grp3r2.tar.Z' and
  677. 'tbl3r2.tar.Z'
  678.  
  679. |    you@ernie:~/gap > ls -l
  680.     -rw-r--r--     you      835097 Apr  7 22:13 doc3r2.tar.Z
  681.     -rw-r--r--     you     1062916 Apr  7 22:21 lib3r2.tar.Z
  682.     -rw-r--r--     you      741217 Apr  7 22:27 src3r2.tar.Z
  683.     you@ernie:~/gap > |
  684.  
  685. Now make a  subdirectory for the source  called 'src/'.  Change into this
  686. subdirectory and unpack the source.  Note that you must  be in the source
  687. subdirectory to unpack  the source.  After you  have  unpacked the source
  688. you may  remove the *archive-file*.  The unpacking  of the source happens
  689. correspondingly in the second example, so we do not show it here.
  690.  
  691. |    you@ernie:~/gap > mkdir src
  692.     you@ernie:~/gap > cd src
  693.     you@ernie:~/gap/src > uncompress ../src3r2.tar.Z 
  694.     you@ernie:~/gap/src > tar xf ../src3r2.tar
  695.     you@erine:~/gap/src > ls
  696.     Makefile      finfield.c    pcpresen.c    read.h        sysunix.c
  697.     agcollec.c    finfield.h    pcpresen.h    record.c      tietze.c
  698.     agcollec.h    function.c    permutat.c    record.h      tietze.h
  699.     aggroup.c     function.h    permutat.h    scanner.c     unknown.c
  700.     aggroup.h     gap.c         plist.c       scanner.h     unknown.h
  701.     blister.c     gasman.c      plist.h       set.c         vecffe.c
  702.     blister.h     gasman.h      polynom.c     set.h         vecffe.h
  703.     costab.c      idents.c      polynom.h     statemen.c    vector.c
  704.     costab.h      idents.h      range.c       statemen.h    vector.h
  705.     cyclotom.c    integer.c     range.h       string.c      word.c
  706.     cyclotom.h    integer.h     rational.c    string.h      word.h
  707.     eval.c        list.c        rational.h    sysdos.c
  708.     eval.h        list.h        read.c        system.h
  709.     you@ernie:~/gap/src > |
  710.  
  711. Execute 'make' to see which compilation targets are predefined.
  712.  
  713. |    you@ernie:~/gap/src > make
  714.     usage: 'make <target>'  where target is one of
  715.     'decs-ultrix-gcc2'  for DECstations under Ultrix with GNU cc 2
  716.     'decs-ultrix-cc'    for DECstations under Ultrix with cc
  717.     'hp700-hpux-cc'     for HP 9000/700 under HP-UX with cc
  718.     'hp800-hpux-cc'     for HP 9000/800 under HP-UX with cc
  719.     'ibm6000-aix-cc'    for IBM RS/6000 under AIX with cc
  720.     'ibmpc-386bsd-gcc2' for IBM PCs under 386BSD with GNU cc 2
  721.     'ibmpc-386bsd-cc'   for IBM PCs under 386BSD with cc (GNU)
  722.     'ibmpc-linux-gcc2'  for IBM PCs under Linux with GNU cc 2
  723.     'ibmpc-msdos-djgpp' for IBM PCs under MSDOS with DJ GNU cc
  724.     'mips-bsd-cc'       for MIPS under RISC/os Berkeley with cc
  725.     'mips-sysv-cc'      for MIPS under RISC/os System V with cc
  726.     'next-mach-gcc2'    for NeXT under Mach with GNU cc 2
  727.     'next-mach-cc'      for NeXT under Mach with cc (GNU)
  728.     'sequent-dynix-cc'  for Sequent Symmetry under Dynix with cc
  729.     'sgi-irix-gcc2'     for SGI under Irix with GNU cc 2
  730.     'sgi-irix-cc'       for SGI under Irix with cc
  731.     'st-tos-gcc2'       for Atari ST under TOS with GNU cc 2
  732.     'sun3-sunos-gcc2'   for SUN 3 under SunOs with GNU cc 2
  733.     'sun3-sunos-cc'     for SUN 3 under SunOS with cc
  734.     'sun4-sunos-gcc2'   for SUN 4 under SunOs with GNU cc 2
  735.     'sun4-sunos-cc'     for SUN 4 under SunOS with cc
  736.     'bsd'               for others under Berkeley UNIX with cc
  737.     'usg'               for others under System V UNIX with cc
  738.        targets are listed according to preference,
  739.        i.e., 'sun4-sunos-gcc2' is better than 'sun4-sunos-cc'.
  740.        additional C compiler and linker flags can be passed with
  741.        'make <target> COPTS=<compiler-opts> LOPTS=<linker-opts>',
  742.        i.e., 'make sun4-sunos-gcc2 COPTS=-g LOPTS=-g.'
  743.     you@ernie:~/gap/src > |
  744.  
  745. Choose the best matching target.  If nothing matches precisely, use 'bsd'
  746. (if your UNIX is more Berkeley) or 'usg' (if your UNIX is more System V).
  747. If compilation of  the file 'sysunix.c' fails or the command line editing
  748. does not work, remove the  file 'sysunix.o' and try the other target.  If
  749. 'sysunix.c' cannot be compiled neither with target  'bsd' nor with target
  750. 'usg', look  at this file and try to modify it so that compilation works.
  751. If you can  compile but command  line editing does not  work  with either
  752. target,  we  suggest  that you always start  {\GAP}  with option '-n'  to
  753. disable command  line editing.   In any case we would like to  hear about
  754. such problems.
  755.  
  756. In our  first example   the  right target is  obviously  'decs-ultrix-cc'
  757. (remember 'ernie' was assumed to be a DECstation).  Compile {\GAP}.
  758.  
  759. |    you@ernie:~/gap/src > make decs-ultrix-cc
  760.     # 'make' prints the name of each file as it is compiled
  761.     # ignore the warnings that two functions in 'system.c' are too large
  762.     # for optimization, they are not critical for the performance
  763.     you@ernie:~/gap/src > ls -l gap
  764.     -rwxr-xr-x     you      520192 Apr  7 22:47 gap
  765.     you@ernie:~/gap/src > cd ..
  766.     you@ernie:~/gap > |
  767.  
  768. In our second example things are a little bit more difficult, because you
  769. have to   compile  {\GAP} for  two different   types of machines.   First
  770. compile it for 'goliath', the HP 9000/800. To avoid name conflicts rename
  771. the executable to 'gap.hp8'.
  772.  
  773. |    local@goliath:~/lib/gap/src > make hp800-hpux-cc
  774.     # 'make' prints the name of each file as it is compiled
  775.     # ignore the warnings that two functions in 'system.c' are too large
  776.     # for optimization, they are not critical for the performance
  777.     local@goliath:~/lib/gap/src > mv gap gap.hp8
  778.     local@goliath:~/lib/gap/src > |
  779.  
  780. and   then compile it  on 'bert',  one   of the DECstations.  Rename this
  781. executable  to 'gap.ds'.  Note that you  first have to  remove the object
  782. files.  Otherwise 'make' will only try to link the object files, and fail
  783. because those object files were made for a different processor.
  784.  
  785. |    local@goliath:~/lib/gap/src > rlogin bert
  786.     local@bert:~ > cd lib/gap/src
  787.     local@bert:~/lib/gap/src > rm *.o
  788.     local@bert:~/lib/gap/src > make decs-ultrix-cc
  789.     # 'make' prints the name of each file as it is compiled
  790.     # ignore the warnings that two functions in 'system.c' are too large
  791.     # for optimization, they are not critical for the performance
  792.     local@bert:~/lib/gap/src > mv gap gap.ds
  793.     local@bert:~/lib/gap/src > exit
  794.     local@goliath:~/lib/gap/src > cd ..
  795.     local@goliath:~/lib/gap > |
  796.  
  797. You may  want to keep  the source and  object files around until  you are
  798. certain that  everything works.  However if space  is a tight resource on
  799. your system you may remove the source and object files now.  All you need
  800. in the 'src/' subdirectory from now on is (are) the executable(s).
  801.  
  802. Now you have to make a small  shell script whose job  is to start {\GAP}.
  803. This  shell script  is  a convenient  place to put   various defaults and
  804. configuration parameters.  In our first example enter
  805.  
  806. |    you@ernie:~/gap > cat > gap
  807.     exec /usr/you/gap/src/gap -l /usr/you/gap/lib/ -m 4m $*
  808.     |<ctr>-'D'
  809. |    you@ernie:~/gap > |
  810.  
  811. The '-l' option tells {\GAP} where  to find the  library, in this case it
  812. is in '/usr/you/gap/lib'.   If you give a wrong path {\GAP} will complain
  813.  
  814. |    gap: hmm, I cannot find 'lib/init.g', maybe use option '-l <libname>'?|
  815.  
  816. and very little will work.
  817.  
  818. The  '-m' option   tells {\GAP} the  default  amount  of  initial working
  819. memory, in this case  it is 4 MByte.   Note that  {\GAP} will expand  its
  820. working memory as need arises.  However, before doing so it will try very
  821. hard to succeed  with the  current amount of memory.  Since  this is very
  822. time consuming you may  not want to  make  this value  to small.  On  the
  823. other hand you should  not make it  too large, because  otherwise  {\GAP}
  824. will not fit in main  memory, and will spend most  of  its  time  paging,
  825. instead of doing useful work.
  826.  
  827. The |$*| makes the script pass all its arguments to {\GAP}, so that users
  828. can override   the default values of   '-l' and '-m'  and  also set other
  829. options (see "Features under UNIX").
  830.  
  831. In the second example the  shell script is more complex  to allow for the
  832. various machines.    Also  put it  into the   '/usr/local/bin' directory,
  833. assuming  that this is the  directory that users have  in their path.  If
  834. the  '/usr/local/bin' directory is  not shared between 'goliath', 'bert',
  835. and 'tiffy' you have to put this script into each of those directories.
  836.  
  837. |    local@goliath:~/gap > cd ../bin
  838.     local@goliath:~/bin > cat > gap
  839.     case `hostname` in
  840.     'goliath' )
  841.         exec /usr/local/lib/gap/src/gap.hp8 -l /usr/local/lib/gap/lib $*
  842.         ;;
  843.     'bert' )
  844.         exec /usr/local/lib/gap/src/gap.ds -l /usr/local/lib/gap/lib $*
  845.         ;;
  846.     'tiffy' )
  847.         exec /usr/local/lib/gap/src/gap.ds -l /usr/local/lib/gap/lib $*
  848.         ;;
  849.     * )
  850.         echo "gap: sorry, no executable exists for this machine"
  851.     esac
  852.     |<ctr>-'D'
  853. |    local@goliath:~/bin > |
  854.  
  855. Now make a subdirectory for the library  called 'lib/'.  Change into this
  856. subdirectory and unpack  the  library.   Note that  you  must  be in  the
  857. library directory  to unpack  the  library.  After you  have unpacked the
  858. library you may remove the  *archive-file*.  The unpacking of the library
  859. happens correspondingly in the second example, so we do not show it here.
  860.  
  861. |    you@ernie:~/gap > mkdir lib
  862.     you@ernie:~/gap > cd lib
  863.     you@ernie:~/gap/lib > uncompress ../lib3r2.tar.Z
  864.     you@ernie:~/gap/lib > tar xf ../lib3r2.tar
  865.     you@ernie:~/gap/lib > ls
  866.     abattoir.g    ctautoms.g    fpsgpres.g    matgrp.g      permprod.g
  867.     agcent.g      ctbasic.g     fptietze.g    matring.g     permutat.g
  868.     agclass.g     ctcharac.g    gaussian.g    matrix.g      polyfin.g
  869.     agcomple.g    ctfilter.g    group.g       module.g      polyfld.g
  870.     agcoset.g     ctgapmoc.g    grpcoset.g    numfield.g    polynom.g
  871.     agctbl.g      ctgeneri.g    grpctbl.g     numtheor.g    polyrat.g
  872.     aggroup.g     ctlattic.g    grpelms.g     onecohom.g    pq.g
  873.     aghall.g      ctmapcon.g    grphomom.g    operatio.g    rational.g
  874.     aghomomo.g    ctmapusi.g    grpprods.g    permag.g      recsl.g
  875.     aginters.g    ctpermch.g    init.g        permbckt.g    ring.g
  876.     agnorm.g      ctpgrp.g      integer.g     permcose.g    rowmodul.g
  877.     agprops.g     ctsymmet.g    lattag.g      permcser.g    rowspace.g
  878.     agsubgrp.g    cyclotom.g    lattgrp.g     permctbl.g    string.g
  879.     agwords.g     domain.g      lattperf.g    permgrp.g     tom.g
  880.     cdaggrp.g     field.g       lattperm.g    permhomo.g    vecspace.g
  881.     chevgrp.g     finfield.g    list.g        permnorm.g
  882.     combinat.g    fpgrp.g       mapping.g     permoper.g
  883.     you@ernie:~/gap/lib > cd ..
  884.     you@ernie:~/gap > |
  885.  
  886. Now start {\GAP} and try a few things.  Note that {\GAP} has to read most
  887. of the library for   the fourth statement   below, so this takes  quite a
  888. while.  Subsequent definitions of groups will be much faster.
  889.  
  890. |    you@ernie:~/gap > src/gap
  891.     gap> 2 * 3 + 4;
  892.     10
  893.     gap> Factorial( 30 );
  894.     265252859812191058636308480000000
  895.     gap> Factors( 10^42 + 1 );
  896.     [ 29, 101, 281, 9901, 226549, 121499449, 4458192223320340849 ]
  897.     gap> M11 := Group( (1,2,3,4,5,6,7,8,9,10,11),
  898.     >                  (3,7,11,8)(4,10,5,6) );;
  899.     gap> Size( M11 );
  900.     7920
  901.     gap> Factors( 7920 );
  902.     [ 2, 2, 2, 2, 3, 3, 5, 11 ]
  903.     gap> IsSimple( M11 );
  904.     true |
  905.  
  906. Especially try the  command line  editing and history facilities, because
  907. the are probably the most machine dependent  feature of {\GAP}.   Enter a
  908. few  commands and  then  make  sure  that <ctr>-'P'   redisplays the last
  909. command, that  <ctr>-'E' moves the cursor to  the  end of  the line, that
  910. <ctr>-'B' moves the cursor back one character, and that <ctr>-'D' deletes
  911. single characters.  So, after entering the above commands, typing\\
  912. <ctr>-'P' <ctr>-'P' <ctr>-'E' <ctr>-'B' 
  913. <ctr>-'B' <ctr>-'B' <ctr>-'B' <ctr>-'D' '1'\\
  914. should give the following line.
  915.  
  916. |    gap> Factors( 7921 );
  917.     [ 89, 89 ] |
  918.  
  919. If command line editing does not work, remove the file 'system.o' and try
  920. to compile with a different target, i.e., 'bsd' instead of  'usg' or vice
  921. versa.  If  neither works,  we   suggest that  you  disable command  line
  922. editing  by calling {\GAP}  always with the '-n' option.   In any case we
  923. would like to hear about such problems.
  924.  
  925. If your operating  system has job control, make  sure that  you can still
  926. stop {\GAP}, which is usually done by pressing <ctr>-'Z'.
  927.  
  928. Unpack the documentation  into a subdirectory 'doc/'.   The documentation
  929. serves both as {\LaTeX} source for the printed manual and as online help.
  930. Because the documentation  files also serve as   online help, you  do not
  931. want to remove them, unless space is very tight, and you are content with
  932. the printed manual.
  933.  
  934. |    you@ernie:~/gap > mkdir doc
  935.     you@ernie:~/gap > cd doc
  936.     you@ernie:~/gap/doc > uncompress ../doc3r2.tar.Z
  937.     you@ernie:~/gap/doc > tar xf ../doc3r2.tar
  938.     you@ernie:~/gap/doc > ls
  939.     aboutgap.tex  environm.tex  language.tex  numfield.tex  rowspace.tex
  940.     aggroup.tex   field.tex     list.tex      numtheor.tex  set.tex
  941.     agwords.tex   finfield.tex  manual.bbl    operatio.tex  share.tex
  942.     anupq.tex     fpgrp.tex     manual.bib    paramaps.tex  string.tex
  943.     blister.tex   gaussian.tex  manual.idx    permgrp.tex   tom.tex
  944.     boolean.tex   gentable.tex  manual.ind    permutat.tex  unknown.tex
  945.     characte.tex  gettable.tex  manual.tex    polynom.tex   vecspace.tex
  946.     chartabl.tex  group.tex     manual.toc    preface.tex   vector.tex
  947.     combinat.tex  grplib.tex    mapping.tex   range.tex     weyl.tex
  948.     copyrigh.tex  homomorp.tex  matgrp.tex    rational.tex  word.tex
  949.     cyclotom.tex  install.tex   matring.tex   record.tex
  950.     domain.tex    integer.tex   matrix.tex    ring.tex
  951.     you@ernie:~/gap/doc > |
  952.  
  953. If you have a big version of {\LaTeX} available, you may now want to make
  954. a printed copy  of the manual.  Change  into the directory 'doc/' and run
  955. {\LaTeX} *twice* on  the source.  The first  pass  with {\LaTeX} produces
  956. the  '.aux'  files, which resolve  all  the cross references.  The second
  957. pass produces  the final formatted *dvi*   file 'manual.dvi'.  Then print
  958. the  *dvi*  file.  How   this is  done    depends on your   local  {\TeX}
  959. installation, if in doubt ask your local computer guru.
  960.  
  961. |    you@ernie:~/gap/doc > latex manual
  962.     # about 2000 messages about undefined references
  963.     you@ernie:~/gap/doc > latex manual
  964.     # there should be no warnings this time
  965.     you@ernie:~/gap/doc > ls -l manual.dvi
  966.     -rw-r--r--     you    2591132 Apr  7 23:28 manual.dvi
  967.     you@ernie:~/gap/doc > lp -dvi manual.dvi
  968.     you@ernie:~/gap/doc > cd ..
  969.     you@ernie:~/gap > |
  970.  
  971. Note that because  of the large number  of cross references in the manual
  972. you need a *big*  {\LaTeX} to format  the {\GAP} manual.   If you see the
  973. error message 'TeX capacity exceeded',  you do not  have a big  {\LaTeX};
  974. again ask your local computer guru to  provide a big version of {\LaTeX}.
  975. If this is not possible, you may  also obtain the already formatted *dvi*
  976. file 'manual.dvi' from the same place where  you obtained the rest of the
  977. {\GAP} distribution.
  978.  
  979. Note that, apart   from   the  '\*.tex' files  and the file  'manual.bib'
  980. (bibliography database),  which you absolutely need, we  supply  also the
  981. files 'manual.toc' (table of   contents), 'manual.ind' (unsorted  index),
  982. 'manual.idx' (sorted  index), and  'manual.bbl' (bibliography).  If those
  983. files are missing, or  if you prefer  to do everything  yourself, here is
  984. what you will have to do.  After  the first  pass with {\LaTeX}, you will
  985. have  preliminary 'manual.toc' and  'manual.ind'  files.   All  the  page
  986. numbers are  still incorrect, because the  do not account  for  the pages
  987. used by  the table of contents itself.   Now 'bibtex  manual' will create
  988. 'manual.bbl' from 'manual.bib'.  After  the second pass with {\LaTeX} you
  989. will  have a  correct   'manual.toc'  and 'manual.ind'.  'makeindex'  now
  990. produces the sorted index 'manual.idx' from 'manual.ind'.  The third pass
  991. with {\LaTeX} incorporates this index into the manual.
  992.  
  993. |    you@ernie:~/gap/doc > latex manual
  994.     # about 2000 messages about undefined references
  995.     you@ernie:~/gap/doc > bibtex manual
  996.     # 'bibtex' prints the name of each file it is scanning
  997.     you@ernie:~/gap/doc > latex manual
  998.     # still some messages about undefined citations
  999.     you@ernie:~/gap/doc > makeindex manual
  1000.     # 'makeindex' prints some diagnostic output
  1001.     you@ernie:~/gap/doc > latex manual
  1002.     # there should be no warnings this time
  1003.     you@ernie:~/gap/doc > lp -dvi manual.dvi
  1004.     you@ernie:~/gap/doc > cd ..
  1005.     you@ernie:~/gap > |
  1006.  
  1007. If you obtained the groups and character tables libraries unpack them now
  1008. into the subdirectories 'grp/', 'two/', and  'tbl/'.  Note that the group
  1009. and the character table libraries  are not essential to work with {\GAP},
  1010. you only need them when you want to access the data in those libraries.
  1011.  
  1012. Thats  all, finally you  are  done.  We  hope  that you  will enjoy using
  1013. {\GAP}.  If you have problems, do not hesitate to contact us.
  1014.  
  1015. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  1016. \Section{Features under UNIX}%
  1017. \index{features!under UNIX}\index{UNIX!features}%
  1018. \index{options!under UNIX}\index{UNIX!options}%
  1019. \index{.gaprc}
  1020.  
  1021. When you start {\GAP} under UNIX, you may  specify a number of options on
  1022. the  command-line to change the  default behaviour  of {\GAP}.  All these
  1023. options start with a  hyphen '-', followed by  a single  letter.  Options
  1024. must not be grouped, e.g., 'gap -gq' is illegal, use 'gap -g -q' instead.
  1025. Some options require an argument, this must follow the option and must be
  1026. separated  by a <space>, e.g., 'gap  -m 256k', it is  not  correct to say
  1027. 'gap -m256k' instead.
  1028.  
  1029. {\GAP} under UNIX will only accept lower case options.
  1030.  
  1031. As is described  in the previous section  (see "Installation under UNIX")
  1032. usually you will  not execute {\GAP} directly.   Instead you will  call a
  1033. shell script,  with the name 'gap', which in  turn executes {\GAP}.  This
  1034. shell script sets some options as neccessary to make  {\GAP} work on your
  1035. system.  This means that the default settings mentioned  below may not be
  1036. what you experience when you execute {\GAP} on your system.
  1037.  
  1038. '-g'
  1039.  
  1040. The option  '-g' tells {\GAP} to print a information message every time a
  1041. garbage collection is performed.
  1042.  
  1043. |    #G collect garbage, 1931 used, 5012 dead, 912 KB free, 4096 KB total|
  1044.  
  1045. For example, this tells you that there are 1931 live objects that surived
  1046. a garbage collection, that 5012 unused objects  were reclaimed by it, and
  1047. that 912 KByte of totally allocated 4096 KBytes are available afterwards.
  1048.  
  1049. '-l <libname>'
  1050.  
  1051. The option '-l' tells {\GAP} that  the  library of {\GAP} functions is in
  1052. the directory  <libname>.  Per  default <libname>  is 'lib/',  i.e.,  the
  1053. library is normally  expected in the  subdirectory  'lib/' of the current
  1054. directory.  {\GAP} searches for the library files, whose filenames end in
  1055. '.g', and which contain the functions initially known to  {\GAP}, in this
  1056. directory.   <libname> should end with  a  pathname separator, i.e., '/',
  1057. but {\GAP} will silently add one  if it is missing.  {\GAP} will read the
  1058. file '<libname>/init.g' during startup.  If {\GAP} cannot find this  file
  1059. it will print the following warning
  1060.  
  1061. |    gap: hmm, I cannot find 'lib/init.g', maybe use option '-l <lib>'?|
  1062.  
  1063. If you want  a bare bones {\GAP},  i.e., if you do  not need  any library
  1064. functions, you may ignore this warning, otherwise you should leave {\GAP}
  1065. and start it  again, specifying the  correct library path using the  '-l'
  1066. option.
  1067.  
  1068. It is  also possible  to  specify several  alternative library  pathes by
  1069. separating them  with semicolons ';'.   Note  that in this case  all path
  1070. names must end with the pathname separator '/'.   {\GAP} will then search
  1071. for its library files in all those directories in turn, reading the first
  1072. it finds.  E.g., if you specify '-l \"lib/;/usr/local/lib/gap/3.2/lib/\"'
  1073. {\GAP} will search for a library file first in the subdirectory 'lib/' of
  1074. the current directory, and if it does not find it there in the  directory
  1075. '/usr/local/lib/gap/3.2/lib/'.  This way you can built your own directory
  1076. of {\GAP} library files that override the standard ones.
  1077.  
  1078. {\GAP} searches  for the group files,  whose filenames end in '.grp', and
  1079. which contain the groups initially known  to {\GAP}, in the directory one
  1080. gets  by replacing the  string 'lib' in  <libname> with the string 'grp'.
  1081. If you  do not  want  to  put  the group   directory  'grp/' in  the same
  1082. directory as the  'lib/' directory, for  example if you want  to  put the
  1083. groups onto another hard disk partition,  you have to edit the assignment
  1084. in '<libname>/init.g' that reads
  1085.  
  1086. |    GRPNAME := ReplacedString( LIBNAME, "lib/;", "grp/;" );|
  1087.  
  1088. This path  can also consist of  several  alternative  pathes, just as the
  1089. library path.  If the library path consists of several alternative pathes
  1090. the default value for this path will consist of the same pathes, where in
  1091. each component the last occurrence of 'lib/' is replaced by 'grp/'.
  1092.  
  1093. Similar considerations    apply to   the  character  table  files.  Those
  1094. filenames end in '.tbl'.   {\GAP} looks for  those files in the directory
  1095. given  by 'TBLNAME'.  The default  value   for 'TBLNAME'  is  obtained by
  1096. replacing 'lib' in <libname> with 'tbl'.
  1097.  
  1098. '-h <docname>'
  1099.  
  1100. The option '-h'  tells {\GAP} that the on-line documenation for {\GAP} is
  1101. in  the  directory  <docname>.  Per  default  <docname>  is  obtained  by
  1102. replacing 'lib'  in  <libname> with  'doc'.   <docname> should end with a
  1103. pathname  separator, i.e., '/', but {\GAP} will silently add one if it is
  1104. missing.  {\GAP} will read the file '<docname>/manual.toc' when you first
  1105. use the help system.  If  {\GAP} cannot find this file it will print  the
  1106. following warning
  1107.  
  1108. |    help: hmm, I cannot open the table of contents file 'doc/manual.toc'
  1109.     maybe you should use the option '-h <docname>'?|
  1110.  
  1111. '-m <memory>'
  1112.  
  1113. The option '-m' tells {\GAP} to allocate <memory>  bytes at startup time.
  1114. If the last character of <memory> is 'k' or 'K' it is taken in KBytes and
  1115. if the last character is 'm' or 'M' <memory> is taken in MBytes.
  1116.  
  1117. Under UNIX the default amount  of memory allocated  by {\GAP} is 2 MByte.
  1118. The amount of memory  should be large  enough so that computations do not
  1119. require  too  many  garbage  collections.  On the   other hand  if {\GAP}
  1120. allocates more virtual memory than  is physically available it will spend
  1121. most of  the  time  paging.   2 MByte    is  reasonable for  single  user
  1122. workstations with 4 MByte or for multi user systems with 8 MByte or more.
  1123.  
  1124. '-n'
  1125.  
  1126. The option  '-n'  tells {\GAP}  to disable  the line editing  and history
  1127. (see "Line Editing").
  1128.  
  1129. You may want to do this if the command line  editing is incompatible with
  1130. another program that is used to run {\GAP}.  For example if {\GAP} is run
  1131. from inside a GNU Emacs shell window, '-n' should be used since otherwise
  1132. every input line will be echoed twice, once by Emacs and once by {\GAP}.
  1133.  
  1134. '-b'
  1135.  
  1136. The option '-b'  tells {\GAP} to  surpress the banner.  That  means  that
  1137. {\GAP} immediately prints the prompt.  This is useful  when you get tired
  1138. of the banner after a while.
  1139.  
  1140. '-q'
  1141.  
  1142. The option  '-q' tells {\GAP} to  be quiet.  This  means that {\GAP} does
  1143. not display the  banner and the prompts  'gap>'.  This is  useful  if you
  1144. want to run {\GAP} as a filter with input and output redirection and want
  1145. to avoid the the banner and the prompts clobber the output file.
  1146.  
  1147. '-x <length>'
  1148.  
  1149. With this option  you can tell  {\GAP}  how long lines  are.  {\GAP} uses
  1150. this value to decide when to split long lines.
  1151.  
  1152. The default value is 80, which is the right value if you have  a standard
  1153. ASCII terminal.  If you have a larger monitor, or use a  smaller font, or
  1154. redirect the output to a printer, you may want to increase this value.
  1155.  
  1156. '-y <length>'
  1157.  
  1158. With this  option you can  tell {\GAP} how  many lines  your  screen has.
  1159. {\GAP} uses this value to decide after how  many lines of on-line help it
  1160. should display |-- <space> for more --|.
  1161.  
  1162. The default value is 24, which is the right  value if you have a standard
  1163. ASCII terminal.  If you have a larger monitor, or use  a smaller font, or
  1164. redirect the output to a printer, you may want to increase this value.
  1165.  
  1166. Further arguments are taken as filenames of files that are read by {\GAP}
  1167. during  startup, after '<libname>/init.g' is read, but  before the  first
  1168. prompt is printed.  The files are read  in the order  in that they appear
  1169. on  the command line.  {\GAP} only accepts  14  filenames  on the command
  1170. line.  If a file cannot be opened {\GAP} will print  an error message and
  1171. will abort.
  1172.  
  1173. When you  start {\GAP}, it looks  for the file  with the name '.gaprc' in
  1174. your  homedirectory.  If   such  a file   is    found it  is  read  after
  1175. '<libname>/init.g', but before any of the files  mentioned on the command
  1176. line are read.  You  can use this  file  for your private customizations.
  1177. For example,  if you have a  file containing functions  or  data that you
  1178. always need, you could read this from '.gaprc'.  Or if  you  find some of
  1179. the names  in the library too  long, you could  define  abbreviations for
  1180. those names in '.gaprc'.  The following sample '.gaprc' file does both.
  1181.  
  1182. |    Read("/usr/you/dat/mygroups.grp");
  1183.     Op := Operation;
  1184.     OpHom := OperationHomomorphism;
  1185.     RepOp := RepresentativeOperation;
  1186.     RepsOp := RepresentativesOperation; |
  1187.  
  1188. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  1189. \Section{IBM PC Compatibles}%
  1190. \index{MSDOS}
  1191.  
  1192. {\GAP} runs on IBM PC compatibles with an Intel 80386 or 80486 processor,
  1193. running MS-DOS 5.0.   {\GAP} does *not* run on IBM PC compatibles with an
  1194. Intel  80186  or  80286  processor.   {\GAP} does  also *not*  run  under
  1195. Windows.
  1196.  
  1197. To  use {\GAP} you  need at  least 2  MByte  of  main memory (less may be
  1198. possible,  but this would make {\GAP} so slow that no serious work can be
  1199. done).   More is  preferred for serious computations.   You  also need  a
  1200. harddisk with at least 3 MByte of free space.   If you also want to  keep
  1201. the manual  online  you need an additional 2 MByte of space for that.  If
  1202. you also want to keep the source and object modules for the {\GAP} kernel
  1203. you need an  additional 3  MByte  of space for that.   Since  {\GAP} is a
  1204. plain text application either a monochrom or color monitor may be used.
  1205.  
  1206. {\GAP} will use  up to 128 MByte of extended memory (using *XMS*, *VDISK*
  1207. memory  allocation strategies) or  up  to  128 MByte  of  expanded memory
  1208. (using *VCPI* programs, such  as 'QEMM' and '386MAX') and up to 128 MByte
  1209. of disk  space for swapping.
  1210.  
  1211. If you hit <ctr>-'C' the  DOS  extender ('go32')  catches  it and  aborts
  1212. {\GAP} immediately.  The keys <ctr>-'Z' and <alt>-'C' can be used instead
  1213. to interupt {\GAP}.
  1214.  
  1215. The arrow keys <left>, <right>, <up>, <down>, <home>, <end>, and <delete>
  1216. can be used for command line editing with their intuitive meaning.
  1217.  
  1218. One of the more annyoing *features* of MS-DOS is the use of the backslash
  1219. |\| as a directory separator in  filenames  instead of the slash '/' used
  1220. in  UNIX.  To ease  this {\GAP}  allows slashes  in  filenames  and  will
  1221. silently replace them with backslashes.  Throughout this sections we will
  1222. use the slash as separator.
  1223.  
  1224. Apart  from this everything  works as  described  in this manual  and you
  1225. should not have any problems using {\GAP}.
  1226.  
  1227. The section  "Copyright of  GAP  for IBM  PC  Compatibles"  describes the
  1228. copyright as it applies to  the executable  version  that we  distribute.
  1229. The  section  "Installation on  IBM  PC  Compatibles" describes  how  you
  1230. install  {\GAP} on  the IBM PC Compatibles, and the section "Features  on
  1231. IBM PC Compatibles" describes the options that {\GAP}  accepts on the IBM
  1232. PC Compatibles.
  1233.  
  1234. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  1235. \Section{Copyright of GAP for IBM PC Compatibles}
  1236.  
  1237. The  system  dependent part of  {\GAP}  for  the  386  ('system.dos') was
  1238. written by Steve  Linton (111  Ross St., Cambridge,  CB1 3BS, UK, +44 223
  1239. 411661,   'sl25@cus.cam.ac.uk').   He  assignes   the  copyright  to  the
  1240. Lehrstuhl D fuer Mathematik.  Many thanks to Steve Linton for his work.
  1241.  
  1242. The executable of {\GAP}  for the  386 that we distribute  ('gapexe.386')
  1243. was compiled with  DJ Delorie\'s port of the Free Software  Foundation\'s
  1244. GNU C  compiler version 2.1.  The compiler can be  obtained  by anonymous
  1245. 'ftp'  from  'grape.ecs.clarkson.edu'   where  it  is  in  the  directory
  1246. 'pub/msdos/djgpp'.  Many  thanks to  the Free Software  Foundation and DJ
  1247. Delorie for this amazing piece of work.
  1248.  
  1249. The GNU C compiler is
  1250.  
  1251. *Copyright (C) 1989 Free Software Foundation, Inc.
  1252. 675 Mass Ave, Cambridge, MA 02139, USA*
  1253.  
  1254. under the  terms  of the GNU General Public License (GPL).  Note that the
  1255. GNU  GPL  states  that the  mere act  of compiling  does not  affect  the
  1256. copyright status of GAP.
  1257.  
  1258. The modifications to the compiler to make it operating under  MS-DOS, the
  1259. functions from  the standard library 'libpc.a', the  modifications of the
  1260. functions from the standard library  'libc.a' to make  them operate under
  1261. MS-DOS, and the DOS extender  'go32' (which is prepended to 'gapexe.386')
  1262. are
  1263.  
  1264. *Copyright (C) 1991 DJ Delorie,
  1265. 24 Kirsten Ave, Rochester NH 03867-2954, USA*
  1266.  
  1267. also under  the terms of the GNU GPL.  The terms of  the GPL require that
  1268. we make the source code for 'libpc.a' available.  They can be obtained by
  1269. writing to Steve Linton (however, it may be  easier for you to 'ftp' them
  1270. from  'grape.ecs.clarkson.edu'  yourself).   They  also require that  GAP
  1271. falls under the GPL too, i.e., is distributed freely,  which it basically
  1272. does anyhow.
  1273.  
  1274. The functions in 'libc.a' that GAP for the 386 uses are
  1275.  
  1276. *Copyright (c) 1988 Regents of the University of California*
  1277.  
  1278. under the following terms
  1279.  
  1280. *All rights reserved.*
  1281.  
  1282. *Redistribution and use in source and binary forms are permitted provided
  1283. that the above copyright notice and this paragraph are  duplicated in all
  1284. such forms and that  any documentation, advertising  materials, and other
  1285. materials  related to  such  distribution and  use acknowledge  that  the
  1286. software  was developed by  the University of California, Berkeley.   The
  1287. name  of the University  may not be  used to endorse or promote  products
  1288. derived from this software without specific prior written permission.*
  1289.  
  1290. *THIS  SOFTWARE  IS  PROVIDED AS IS  AND WITHOUT  ANY EXPRESS OR  IMPLIED
  1291. WARRANTIES,  INCLUDING,  WITHOUT  LIMITATION, THE  IMPLIED WARRANTIES  OF
  1292. MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.*
  1293.  
  1294. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  1295. \Section{Installation on IBM PC Compatibles}%
  1296. \index{installation!under MS-DOS}\index{MS-DOS!installation}
  1297.  
  1298. Installation of {\GAP} on IBM PC compatibles is fairly  easy.  As already
  1299. mentioned above,  {\GAP} must  be installed on a harddisk,  because it is
  1300. too large to be run from diskettes.
  1301.  
  1302. In  this section we will assume  in the examples that you  install {\GAP}
  1303. from 'command.com'.   Note  that certain  parts  of  the  output  in  the
  1304. examples should only be taken as rough outline, especially file sizes and
  1305. file  dates  are *not* to  be taken  literally.  We also assume a program
  1306. 'ls' that is used to list the files in a directory,  the output  of 'dir'
  1307. is too verbose.
  1308.  
  1309. First choose  a place where  you want   to install  {\GAP}.  You can  put
  1310. {\GAP} anywhere, however, for sake of an example we will assume here that
  1311. you have choosen |C:\GAP|, i.e., top level directory 'GAP' on drive  'C'.
  1312. Now make this directory.
  1313.  
  1314. |     C: > mkdir gap
  1315.      C: > chdir gap
  1316.      C:\GAP > |
  1317.  
  1318. The  next  step  is  to  get the  {\GAP}  distribution  on  your  IBM  PC
  1319. compatible.  How  you  can obtain  {\GAP}  is described  in  the  section
  1320. "Getting GAP".  The usual way would  be to get  the files with 'ftp' onto
  1321. some UNIX machine and then to download them, for example with 'kermit' or
  1322. a terminal  emulation program that supports downloading  of  files,  onto
  1323. your IBM PC compatible.  Remember that all the files are binary files and
  1324. that you must  transmit them in binary mode.  We are sorry, but we cannot
  1325. send out disks.
  1326.  
  1327. For  IBM PC compatibles  it is better  to  get  the  *zoo-archive*  files
  1328. instead of the *compressed-tar*  files, because 'zoo' is much more common
  1329. on  IBM  PC compatible  machines than  'compress'  and 'tar'.   Also  the
  1330. *zoo-archive*s  are  smaller.   You  need 'zoo' version  2.1 or later.  A
  1331. version  of  'zoo'  for IBM  PC  compatibles is  available  together with
  1332. {\GAP}.  Also for IBM PC compatibles you should get the executable kernel
  1333. 'gapexe.386'.  You may also get the source for the kernel to read it, but
  1334. there  is  very  little  point  in compiling  {\GAP}  again  on your  own
  1335. computer.
  1336.  
  1337. So  lets  assume  that  you have  the  files  'gapexe.386', 'lib3r2.zoo',
  1338. 'doc3r2.zoo',  and maybe also the files  'grp3r2.zoo', 'tbl3r2.zoo'  (the
  1339. sizes reported below in the example are only approximate).
  1340.  
  1341. |    C:\GAP > dir
  1342.     -a---     649958 May 13 22:45 doc3r2.zoo
  1343.     -a---     481851 May 13 22:51 gapexe.386
  1344.     -a---     725911 May 13 22:57 lib3r2.zoo
  1345.     C:\GAP > |
  1346.  
  1347. Rename the executable to 'gap.exe'.
  1348.  
  1349. |    C:\GAP > ren gapexe.386 gap.exe
  1350.     C:\GAP > |
  1351.  
  1352. Make a subdirectory  for the library.  Usually  this is  the subdirectory
  1353. 'lib'.  Other names  are possible, but then you  need to pass the name of
  1354. the library subdirectory as an option whenever you start {\GAP}.  Using a
  1355. nonstandard name only  makes sense when you  want to work  with different
  1356. libraries (as do the developers of {\GAP}), but this is very unlikely.
  1357.  
  1358. |    C:\GAP > mkdir lib
  1359.     C:\GAP > |
  1360.  
  1361. Now change  into this subdirectory  and  unpack the library from the  zoo
  1362. archive.  Note that you must be in the library subdirectory to unpack the
  1363. library.   After you have unpacked  the library remove the *archive-file*
  1364. and change back into the parent directory.
  1365.  
  1366. |    C:\GAP > chdir lib
  1367.     C:\GAP\LIB > zoo x ..\lib3r2.zoo
  1368.     # 'zoo' prints the name of each file as it is extracted
  1369.     C:\GAP\LIB > ls
  1370.     abattoir.g    ctautoms.g    fpsgpres.g    matgrp.g      permprod.g
  1371.     agcent.g      ctbasic.g     fptietze.g    matring.g     permutat.g
  1372.     agclass.g     ctcharac.g    gaussian.g    matrix.g      polyfin.g
  1373.     agcomple.g    ctfilter.g    group.g       module.g      polyfld.g
  1374.     agcoset.g     ctgapmoc.g    grpcoset.g    numfield.g    polynom.g
  1375.     agctbl.g      ctgeneri.g    grpctbl.g     numtheor.g    polyrat.g
  1376.     aggroup.g     ctlattic.g    grpelms.g     onecohom.g    pq.g
  1377.     aghall.g      ctmapcon.g    grphomom.g    operatio.g    rational.g
  1378.     aghomomo.g    ctmapusi.g    grpprods.g    permag.g      recsl.g
  1379.     aginters.g    ctpermch.g    init.g        permbckt.g    ring.g
  1380.     agnorm.g      ctpgrp.g      integer.g     permcose.g    rowmodul.g
  1381.     agprops.g     ctsymmet.g    lattag.g      permcser.g    rowspace.g
  1382.     agsubgrp.g    cyclotom.g    lattgrp.g     permctbl.g    string.g
  1383.     agwords.g     domain.g      lattperf.g    permgrp.g     tom.g
  1384.     cdaggrp.g     field.g       lattperm.g    permhomo.g    vecspace.g
  1385.     chevgrp.g     finfield.g    list.g        permnorm.g
  1386.     combinat.g    fpgrp.g       mapping.g     permoper.g
  1387.     C:\GAP\LIB > del ..\lib3r2.zoo
  1388.     C:\GAP\LIB > chdir ..
  1389.     C:\GAP > |
  1390.  
  1391. Add the following line to your 'autoexec.bat' file
  1392.  
  1393. |    SET GO32TMP=|<swap-file-directory>||
  1394.  
  1395. where <swap-file-directory> should be the directory where you want GAP to
  1396. put  the  swap  file,  e.g.,  |C:\TMP|.   The swap  file will  be  called
  1397. 'page????.386' and is normally  removed when GAP exits.  If  'GO32TMP' is
  1398. not set, 'GCCTMP', 'TMP', 'TEMP' are checked (in this order).  If neither
  1399. is set, GAP  will  not swap to disk.  Note that you must *reboot*  before
  1400. this change in 'autoexec.bat' takes effect.
  1401.  
  1402. Start {\GAP} and try a few things.  Note that {\GAP} has  to read most of
  1403. the library for the fourth statement below,  so this takes quite a while.
  1404. Subsequent definitions of groups will be much faster.
  1405.  
  1406. |    C:\GAP > gap
  1407.     gap> 2 * 3 + 4;
  1408.     10
  1409.     gap> Factorial( 30 );
  1410.     265252859812191058636308480000000
  1411.     gap> Factors( 10^42 + 1 );
  1412.     [ 29, 101, 281, 9901, 226549, 121499449, 4458192223320340849 ]
  1413.     gap> M11 := Group( (1,2,3,4,5,6,7,8,9,10,11),
  1414.     >                  (3,7,11,8)(4,10,5,6) );;
  1415.     gap> Size( M11 );
  1416.     7920
  1417.     gap> Factors( 7920 );
  1418.     [ 2, 2, 2, 2, 3, 3, 5, 11 ]
  1419.     gap> IsSimple( M11 );
  1420.     true |
  1421.  
  1422. Especially try the command  line editing  and history facilities, because
  1423. the are probably the most  machine dependent feature  of {\GAP}.  Enter a
  1424. few commands   and then make  sure  that  <ctr>-'P' redisplays   the last
  1425. command, that  <ctr>-'E'  moves the cursor  to the end  of the line, that
  1426. <ctr>-'B' moves the cursor back one character, and that <ctr>-'D' deletes
  1427. single characters.  So after entering the above three commands typing\\
  1428. <ctr>-'P' <ctr>-'P' <ctr>-'E' <ctr>-'B'
  1429. <ctr>-'B' <ctr>-'B' <ctr>-'B' <ctr>-'D' '1'\\
  1430. should give the following line.
  1431.  
  1432. |    gap> Factors( 7921 );
  1433.     [ 89, 89 ] |
  1434.  
  1435. If you start {\GAP}  from another place, i.e.,  not from within the 'gap'
  1436. directory,  you  will  have to   specify  the full  path   to the library
  1437. subdirectory.
  1438.  
  1439. |    C:\GAP > chdir ..
  1440.     C: > gap\gap
  1441.     gap: hmm, I cannot find 'lib\init.g', maybe use option '-l <libname>'?
  1442.     gap> quit;
  1443.     C: > gap\gap -l c:\gap\lib\
  1444.     gap> Gcd( 123, 66 );
  1445.     3
  1446.     gap> quit;
  1447.     C: > chdir gap
  1448.     C:\GAP > |
  1449.  
  1450. You may  want to  create  a  batch  file  that  calls the  executable and
  1451. automatically  passes  the correct library path.   It  is probably a good
  1452. idea to put this file into a directory in your default search path, e.g.,
  1453. |C:\BIN|. In the following example we use 'copy' to create this file, you
  1454. may prefer to use your favorite editor.
  1455.  
  1456. |    C:\GAP > chdir ..\bin
  1457.     C:\BIN > copy con gap.bat
  1458.     c:\gap\gap  -m 2m  -l c:\gap\lib  %1 %2 %3 %4 %5 %6 %7 %8 %9
  1459.     |<ctr>-'Z'
  1460. |    1 File(s) copied
  1461.     C:\BIN > chdir ..
  1462.     C: > gap
  1463.     gap> 2 * 3 + 4;
  1464.     10
  1465.     gap> quit;
  1466.     C: > chdir gap
  1467.     C:\GAP > |
  1468.  
  1469. The '-l' option tells {\GAP} where  to find the  library, in this case it
  1470. is in |C:\GAP\LIB|.   If you  give  a  wrong  path {\GAP}  will  complain
  1471.  
  1472. |    gap: hmm, I cannot find 'lib/init.g', maybe use option '-l <libname>'?|
  1473.  
  1474. and very little will work.
  1475.  
  1476. The  '-m' option   tells {\GAP} the  default  amount  of  initial working
  1477. memory, in this case  it is 2 MByte.   Note that  {\GAP} will expand  its
  1478. working memory as need arises.  However, before doing so it will try very
  1479. hard to succeed  with the  current amount of memory.  Since  this is very
  1480. time consuming you may  not want to  make  this value  to small.  On  the
  1481. other hand you should  not make it  too large, because  otherwise  {\GAP}
  1482. will not fit in main  memory, and will spend most  of  its  time  paging,
  1483. instead of doing useful work.
  1484.  
  1485. The |%1  %2  ...| makes the script pass all its  arguments to  {\GAP}, so
  1486. that  you can override the default  values of '-l' and  '-m' and also set
  1487. other options (see "Features on IBM PC Compatibles").
  1488.  
  1489. Unpack the documentation  into a subdirectory 'doc'.   The documentation
  1490. serves both as {\LaTeX} source for the printed manual and as online help.
  1491. Because the documentation  files also serves as  online help, you  do not
  1492. want to remove them, unless space is very tight, and you are content with
  1493. the printed manual.
  1494.  
  1495. |    C:\GAP > mkdir doc
  1496.     C:\GAP > chdir doc
  1497.     C:\GAP\DOC > zoo x ..\doc3r2.zoo
  1498.     # 'zoo' prints the name of each file as it is extracted
  1499.     C:\GAP\DOC > ls
  1500.     aboutgap.tex  environm.tex  language.tex  numfield.tex  rowspace.tex
  1501.     aggroup.tex   field.tex     list.tex      numtheor.tex  set.tex
  1502.     agwords.tex   finfield.tex  manual.bbl    operatio.tex  share.tex
  1503.     anupq.tex     fpgrp.tex     manual.bib    paramaps.tex  string.tex
  1504.     blister.tex   gaussian.tex  manual.idx    permgrp.tex   tom.tex
  1505.     boolean.tex   gentable.tex  manual.ind    permutat.tex  unknown.tex
  1506.     characte.tex  gettable.tex  manual.tex    polynom.tex   vecspace.tex
  1507.     chartabl.tex  group.tex     manual.toc    preface.tex   vector.tex
  1508.     combinat.tex  grplib.tex    mapping.tex   range.tex     weyl.tex
  1509.     copyrigh.tex  homomorp.tex  matgrp.tex    rational.tex  word.tex
  1510.     cyclotom.tex  install.tex   matring.tex   record.tex
  1511.     domain.tex    integer.tex   matrix.tex    ring.tex
  1512.     C:\GAP\DOC > del ..\doc3r2.zoo
  1513.     C:\GAP\DOC > |
  1514.  
  1515. If you have a big version of {\LaTeX} available you  may now want to make
  1516. a printed copy  of the manual.  Change into  the directory 'doc'  and run
  1517. {\LaTeX} *twice* on the source.   The  first pass with {\LaTeX}  produces
  1518. the '.aux'  files,  which resolve all the  cross  references.  The second
  1519. pass produces  the final  formatted  *dvi* file 'manual.dvi'.  This  will
  1520. take quite  a while, since  the  manual is  large.  Then print  the *dvi*
  1521. file.  How you actually print the 'dvi' file produced by {\LaTeX} depends
  1522. on the  printer you have, the version  of {\LaTeX}  you have, and whether
  1523. you use a {\TeX}-shell   or not, so  we will  not attempt to  describe it
  1524. here.
  1525.  
  1526. |    C:\GAP\DOC > latex manual
  1527.     # about 2000 messages about undefined references
  1528.     C:\GAP\DOC > latex manual
  1529.     # there should be no warnings this time
  1530.     C:\GAP\DOC > dir manual.dvi
  1531.     -a---   2591132 May 13 23:29 manual.dvi
  1532.     C:\GAP\DOC > chdir ..
  1533.     C:\GAP > |
  1534.  
  1535. Note that because of the large  number of  cross references in the manual
  1536. you need a *big*  {\LaTeX} to format the {\GAP}  manual.  If you  see the
  1537. error message  'TeX capacity  exceeded', you do  not have a big {\LaTeX}.
  1538. In this case  you  may also  obtain the  already    formatted *dvi*  file
  1539. 'manual.dvi' from  the  same place where   you obtained the   rest of the
  1540. {\GAP} distribution.
  1541.  
  1542. Note that, apart   from   the  '\*.tex' files  and the file  'manual.bib'
  1543. (bibliography database),  which you absolutely need, we  supply  also the
  1544. files 'manual.toc' (table of   contents), 'manual.ind' (unsorted  index),
  1545. 'manual.idx' (sorted  index), and  'manual.bbl' (bibliography).  If those
  1546. files are missing, or  if you prefer  to do everything  yourself, here is
  1547. what you will have to do.  After  the first  pass with {\LaTeX}, you will
  1548. have  preliminary 'manual.toc' and  'manual.ind'  files.   All  the  page
  1549. numbers are  still incorrect, because the  do not account  for  the pages
  1550. used by  the table of contents itself.   Now 'bibtex  manual' will create
  1551. 'manual.bbl' from 'manual.bib'.  After  the second pass with {\LaTeX} you
  1552. will  have a  correct   'manual.toc'  and 'manual.ind'.  'makeindex'  now
  1553. produces the sorted index 'manual.idx' from 'manual.ind'.  The third pass
  1554. with {\LaTeX} incorporates this index into the manual.
  1555.  
  1556. |    C:\GAP\DOC > latex manual
  1557.     # about 2000 messages about undefined references
  1558.     C:\GAP\DOC > bibtex manual
  1559.     # 'bibtex' prints the name of each file it is scanning
  1560.     C:\GAP\DOC > latex manual
  1561.     # still some messages about undefined citations
  1562.     C:\GAP\DOC > makeindex manual
  1563.     # 'makeindex' prints some diagnostic output
  1564.     C:\GAP\DOC > latex manual
  1565.     # there should be no warnings this time
  1566.     C:\GAP\DOC > chdir ..
  1567.     C:\GAP > |
  1568.  
  1569. If you have also fetched 'grp3r2.zoo', 'two3r2.zoo', and/or 'tbl3r2.zoo',
  1570. you may now want to unpack those into subdirectories 'grp', 'two', and/or
  1571. 'tbl' in  a corresponding  way.  Alternatively  you can  do this  anytime
  1572. later.
  1573.  
  1574. Thats  all, finally you  are  done.  We  hope  that you  will enjoy using
  1575. {\GAP}.  If you have problems, do not hesitate to contact us.
  1576.  
  1577. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  1578. \Section{Features on IBM PC Compatibles}
  1579. \index{features!under MS-DOS}\index{MS-DOS!features}%
  1580. \index{options!under MS-DOS}\index{MS-DOS!options}%
  1581. \index{.gaprc}
  1582.  
  1583. When you start {\GAP} on IBM PC compatibles,  you may specify a number of
  1584. options  on the command-line to change the  default  behaviour of {\GAP}.
  1585. All these options  start with a  hyphen '-', followed by a single letter.
  1586. Options must not be grouped,  e.g., 'gap -gq' is illegal, use 'gap -g -q'
  1587. instead.  Some options require an argument,  this must  follow the option
  1588. and must be separated by  a  <space>,  e.g.,  'gap  -m 256k',  it is  not
  1589. correct to say 'gap -m256k' instead.
  1590.  
  1591. {\GAP} on IBM PC compatibles will only accept lower case options.
  1592.  
  1593. '-g'
  1594.  
  1595. The options '-g' tells {\GAP} to print a information message every time a
  1596. garbage collection is performed.
  1597.  
  1598. |    #G collect garbage, 1931 used, 5012 dead, 912 KB free, 3072 KB total|
  1599.  
  1600. For example, this tells you that there are 1931 live objects that surived
  1601. a garbage collection, that 5012 unused objects  were reclaimed by it, and
  1602. that 912 KByte of totally allocated 3072 KBytes are available afterwards.
  1603.  
  1604. '-l <libname>'
  1605.  
  1606. The option '-l' tells {\GAP}  that the library  of {\GAP} functions is in
  1607. the  directory <libname>.  Per  default  <libname> is  'lib/', i.e.,  the
  1608. library  is normally expected in the subdirectory  'lib/'  of the current
  1609. directory.  {\GAP} searches for the library files, whose filenames end in
  1610. '.g', and which contain the functions initially known to  {\GAP}, in this
  1611. directory.   <libname> should end  with a  pathname separator, i.e., '/',
  1612. but {\GAP} will silently add one  if it is missing.  {\GAP} will read the
  1613. file '<libname>/init.g' during startup.  If {\GAP} cannot find this  file
  1614. it will print the following warning
  1615.  
  1616. |    gap: hmm, I cannot find 'lib/init.g', maybe use option '-l <lib>'?|
  1617.  
  1618. If you  want a bare bones {\GAP},  i.e., if you do  not  need any library
  1619. functions, you may ignore this warning, otherwise you should leave {\GAP}
  1620. and start  it again, specifying the correct  library path  using the '-l'
  1621. option.
  1622.  
  1623. It is  also possible  to  specify several  alternative library  pathes by
  1624. separating them  with semicolons ';'.   Note  that in this case  all path
  1625. names must end with the pathname separator '/'.   {\GAP} will then search
  1626. for its library files in all those directories in turn, reading the first
  1627. it finds.  E.g., if you specify '-l \"lib/;/usr/local/lib/gap/3.2/lib/\"'
  1628. {\GAP} will search for a library file first in the subdirectory 'lib/' of
  1629. the current directory, and if it does not find it there in the  directory
  1630. '/usr/local/lib/gap/3.2/lib/'.  This way you can built your own directory
  1631. of {\GAP} library files that override the standard ones.
  1632.  
  1633. {\GAP}  searches for the group files,  whose filenames end in '.grp', and
  1634. which contain the groups initially known to  {\GAP}, in the directory one
  1635. gets by replacing the string 'lib' in <libname> by the  string 'grp'.  If
  1636. you do not want  to put the group  directory 'grp/' in the same directory
  1637. as the 'lib/' directory,  for example if you want  to put the groups onto
  1638. another   hard  disk  partition,  you have  to   edit the   assignment in
  1639. '<libname>/init.g' that reads
  1640.  
  1641. |    GRPNAME := ReplacedString( LIBNAME, "lib/;", "grp/;" );|
  1642.  
  1643. This path  can also consist of  several  alternative  pathes, just as the
  1644. library path.  If the library path consists of several alternative pathes
  1645. the default value for this path will consist of the same pathes, where in
  1646. each component the last occurrence of 'lib/' is replaced by 'grp/'.
  1647.  
  1648. Similar considerations    apply to   the  character  table  files.  Those
  1649. filenames end in '.tbl'.   {\GAP} looks for  those files in the directory
  1650. given  by 'TBLNAME'.  The default  value   for 'TBLNAME'  is  obtained by
  1651. replacing 'lib' in <libname> with 'tbl'.
  1652.  
  1653. '-h <docname>'
  1654.  
  1655. The  option '-h' tells {\GAP} that the on-line documenation for {\GAP} is
  1656. in  the directory  <docname>.   Per  default  <docname>  is  obtained  by
  1657. replacing 'lib' in <libname>  with 'doc'.   <docname> should  end  with a
  1658. pathname separator, i.e., '/', but {\GAP} will silently  add one if it is
  1659. missing.  {\GAP} will read the file '<docname>/manual.toc' when you first
  1660. use the help system.  If {\GAP} cannot find this file  it will print  the
  1661. following warning
  1662.  
  1663. |    help: hmm, I cannot open the table of contents file 'doc/manual.toc'
  1664.     maybe you should use the option '-h <docname>'?|
  1665.  
  1666. '-m <memory>'
  1667.  
  1668. The option '-m' tells {\GAP} to  allocate <memory> bytes at startup time.
  1669. If the last character of <memory> is 'k' or 'K' it is taken in KBytes and
  1670. if the last character is 'm' or 'M' <memory> is taken in MBytes.
  1671.  
  1672. On IBM PC compatibles {\GAP} will by default allocate 2 MBytes of memory.
  1673. If you specify '-m <memory>' {\GAP} will only allocate that  much memory.
  1674. The amount of memory  should be large  enough so that computations do not
  1675. require  too  many  garbage  collections.  On the   other hand  if {\GAP}
  1676. allocates more virtual memory than  is physically available it will spend
  1677. most of  the  time  paging.
  1678.  
  1679. '-n'
  1680.  
  1681. The  options  '-n' tells {\GAP} to  disable  the line editing and history
  1682. (see "Line Editing").
  1683.  
  1684. There does not seem to be a good reason to do this on IBM PC compatibles.
  1685.  
  1686. '-b'
  1687.  
  1688. The option '-b'  tells {\GAP} to  surpress the banner.  That  means  that
  1689. {\GAP} immediately prints the prompt.  This is useful  when you get tired
  1690. of the banner after a while.
  1691.  
  1692. '-q'
  1693.  
  1694. The  option '-q' tells  {\GAP} to be quiet.  This  means that {\GAP} does
  1695. not  display the banner and the  prompts 'gap>'.  This  is useful  if you
  1696. want to run {\GAP} as a filter with input and output redirection and want
  1697. to avoid the the banner and the prompts clobber the output file.
  1698.  
  1699. '-x <length>'
  1700.  
  1701. With this  option you can tell  {\GAP} how long   lines are.  {\GAP} uses
  1702. this value to decide when to split long lines.
  1703.  
  1704. The default value is 80,  which  is correct if  you start {\GAP} from the
  1705. desktop or one of the usual shells.  However, if you  start {\GAP} from a
  1706. window shell such as 'gemini', you may want to decrease  this  value.  If
  1707. you have a larger monitor, or use a smaller font, or  redirect the output
  1708. to a printer, you may want to increase this value.
  1709.  
  1710. '-y <length>'
  1711.  
  1712. With this  option you can  tell {\GAP} how  many lines  your  screen has.
  1713. {\GAP} uses this value to decide after how  many lines of on-line help it
  1714. should display |-- <space> for more --|.
  1715.  
  1716. The default value is  24, which is  the right value  if  you start {\GAP}
  1717. from the desktop or one  of  the  usual shells.   However, if  you  start
  1718. {\GAP} from a window  shell such as 'gemini',   you may want  to decrease
  1719. this value.  If  you  have a larger monitor,  or use  a smaller  font, or
  1720. redirect the output to a printer, you may want to increase this value.
  1721.  
  1722. '-z <freq>'
  1723.  
  1724. {\GAP} checks in regular intervals whether the user has entered <ctr>-'Z'
  1725. or <alt>-'C'  to interrupt an  ongoing computation.   Under  MS-DOS  this
  1726. requires reading the keyboard status (UNIX on the other hand will deliver
  1727. a  signal  to {\GAP} when the user  entered <ctr>-'C'),  which is  rather
  1728. expensive.   Therefor  {\GAP}  only  reads   the  keyboard  status  every
  1729. <freq>-th time.   The default is 20.  With the option '-z' this value can
  1730. be  changed.   Lower values  make  {\GAP} more responsive  to interrupts,
  1731. higher values make {\GAP} a little bit faster.
  1732.  
  1733. Further arguments are taken as filenames of files that are read by {\GAP}
  1734. during startup, after '<libname>/init.g' is read,  but  before  the first
  1735. prompt is  printed.  The files are read in the order in  that they appear
  1736. on  the command line.  {\GAP}  only  accepts 14 filenames on the  command
  1737. line.  If a file  cannot be opened {\GAP} will print an error message and
  1738. will abort.
  1739.  
  1740. When you start {\GAP}, it looks  for  the file  with the name 'gap.rc' in
  1741. your  homedirectory (i.e., the   directory   defined by  the  environment
  1742. variable     'HOME').  If  such   a file  is    found it   is read  after
  1743. '<libname>/init.g', but before any of the  files mentioned on the command
  1744. line are read.   You can use  this file for your private  customizations.
  1745. For example, if you  have a file  containing  functions  or data that you
  1746. always need, you could read this from 'gap.rc'.   Or if you find  some of
  1747. the names in  the  library too long,  you could define abbreviations  for
  1748. those names in 'gap.rc'.  The following sample 'gap.rc' file does both.
  1749.  
  1750. |    Read("c:\\gap\\dat\\mygroups.grp");
  1751.     Op := Operation;
  1752.     OpHom := OperationHomomorphism;
  1753.     RepOp := RepresentativeOperation;
  1754.     RepsOp := RepresentativesOperation; |
  1755.  
  1756. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  1757. \Section{Atari ST}%
  1758. \index{TOS}
  1759.  
  1760. {\GAP} runs really  nice on the Atari ST  computers.   Those machines are
  1761. cheap yet reasonably powerful  and can be extended with  up to 4 MByte of
  1762. memory.  Several of the developers of {\GAP} have an Atari ST computer at
  1763. home, which probably is the main reason for the support of this machine.
  1764.  
  1765. To use {\GAP} on an Atari ST you need a machine with  at least 2 MByte of
  1766. main memory, more is preferred for serious computations.  You also need a
  1767. harddisk with at least 3  MByte of free space.  If  you also want to keep
  1768. the manual online you need an  additional 2 MByte of space  for that.  If
  1769. you also want to keep the source and object modules for the {\GAP} kernel
  1770. you need an  additional 3 MBytes  of space for  that.  Since {\GAP} is  a
  1771. plain text application a monochrom monitor is probably  best, but you may
  1772. also use a color monitor.
  1773.  
  1774. {\GAP} runs as an ordinary TOS program on  the Atari ST.  That means that
  1775. it does not open windows  or display a  menu  bar etc.  The advantage  of
  1776. this  is that no  valuable memory space is   wasted for the windows.  The
  1777. disadvantage  is that GEM programs with  windows are certainly more sexy.
  1778. A GEM version is being developed, but don\'t hold your breath.
  1779.  
  1780. {\GAP} usually grabs all  available memory when  it is started.  This  is
  1781. sensible when you want to solve some  medium to big problems with {\GAP}.
  1782. However, if you want to call other programms, for example an editor, from
  1783. inside {\GAP} or run under an multitasking system,  for example MiNT, you
  1784. may want to reduce this using the '-m' option described below.
  1785.  
  1786. One of the more  annyoing *features* of TOS  is  the use of the backslash
  1787. |\| as  a directory separator in filenames instead of the slash  '/' used
  1788. in UNIX.   To ease  this  {\GAP}  allows  slashes in  filenames and  will
  1789. silently replace them with backslashes.  Throughout this sections we will
  1790. use the slash as separator.
  1791.  
  1792. Apart  from this everything  works as  described  in this manual  and you
  1793. should not have any problems using {\GAP}.
  1794.  
  1795. The  section   "Installation on the Atari  ST"  describes how you install
  1796. {\GAP} on   the  Atari  ST, and  the section  "Features  on the Atari ST"
  1797. describes the options that {\GAP} accepts on the Atari ST.
  1798.  
  1799. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  1800. \Section{Installation on the Atari ST}%
  1801. \index{installation!under TOS}\index{TOS!installation}
  1802.  
  1803. Installation  of  {\GAP} on  the Atari   ST is  fairly easy.   As already
  1804. mentioned above,  {\GAP} must be  installed on a  harddisk, because it is
  1805. too large to be run from diskettes.
  1806.  
  1807. In this section  we will assume in  the examples that you install  {\GAP}
  1808. using some shell, e.g.  'tcsh', 'ksh',  'bash', or 'gulam'.  Installation
  1809. from the desktop is also possible, but it would be much more difficult to
  1810. give examples, because you have to use the mouse in this case.  Note that
  1811. certain parts of the output in the examples should only be taken as rough
  1812. outline,  especially  file sizes  and file dates   are *not* to  be taken
  1813. literally.
  1814.  
  1815. First choose  a place where  you want   to install  {\GAP}.  You can  put
  1816. {\GAP} anywhere, however, for sake of an example we will assume here that
  1817. you have choosen |c:\gap|, i.e., top level directory 'gap' on drive  'C'.
  1818. Now make this directory.
  1819.  
  1820. |     c:\ > pwd
  1821.      c:\
  1822.      c:\ > mkdir gap
  1823.      c:\ > cd gap
  1824.      c:\gap\ > |
  1825.  
  1826. The next step is to  get the {\GAP} distribution on  your Atari ST.   How
  1827. you can  obtain {\GAP} is described  in  the section "Getting  GAP".  The
  1828. usual way would be to get the files with 'ftp' onto some UNIX machine and
  1829. then to download them, for example with  'kermit' or a terminal emulation
  1830. program  that supports downloading of files,  onto  your Atari.  Remember
  1831. that all  the files are  binary files and that you  must transmit them in
  1832. binary mode.  We are sorry, but we cannot send out disks.
  1833.  
  1834. For the Atari ST it  is better to get the  *zoo-archive* files instead of
  1835. the *compressed-tar* files, because 'zoo' is much more common on Atari ST
  1836. machines than 'compress' and 'tar'.  Also the *zoo-archive*s are smaller.
  1837. You need 'zoo' version 2.1 or later.  A version of 'zoo' for the Atari ST
  1838. is available together with {\GAP}.  Also for the Atari  ST you should get
  1839. the executable kernel  'gapexe.st'.  You may also get  the source for the
  1840. kernel to  read it,  but there is  very little  point in compiling {\GAP}
  1841. again on your own computer.
  1842.  
  1843. So  lets  assume  that  you  have  the files  'gapexe.st',  'lib3r2.zoo',
  1844. 'doc3r2.zoo', and maybe also  the  files 'grp3r2.zoo', 'tbl3r2.zoo'  (the
  1845. sizes reported below in the example are only approximate).
  1846.  
  1847. |    c:\gap\ > ls -l
  1848.     -rw     649958 Apr  7 22:45 doc3r2.zoo
  1849.     -rw     431851 Apr  7 22:51 gapexe.st
  1850.     -rw     725911 Apr  7 22:57 lib3r2.zoo
  1851.     c:\gap\ > |
  1852.  
  1853. Rename the executable  to something more  sensible.  If you want to start
  1854. {\GAP} from the desktop you should use the name 'gap.ttp' so that you can
  1855. pass options (see "Features on the Atari ST").  If  you only start {\GAP}
  1856. from within a shell the name probably does not matter.
  1857.  
  1858. |    c:\gap\ > mv gapexe.st gap.ttp
  1859.     c:\gap\ > |
  1860.  
  1861. Make a subdirectory  for the library.  Usually  this is  the subdirectory
  1862. 'lib'.  Other names  are possible, but then you  need to pass the name of
  1863. the library subdirectory as an option whenever you start {\GAP}.  Using a
  1864. nonstandard name only  makes sense when you  want to work  with different
  1865. libraries (as do the developers of {\GAP}), but this is very unlikely.
  1866.  
  1867. |    c:\gap\ > mkdir lib
  1868.     c:\gap\ > |
  1869.  
  1870. Now  change  into  this subdirectory and unpack the library from the  zoo
  1871. archive.  Note that you must be in the library subdirectory to unpack the
  1872. library.  After you have unpacked the library  remove  the *archive-file*
  1873. and change back into the parent directory.
  1874.  
  1875. |    c:\gap\ > cd lib
  1876.     c:\gap\lib\ > zoo x ..\lib3r2.zoo
  1877.     # 'zoo' prints the name of each file as it is extracted
  1878.     c:\gap\lib\ > ls
  1879.     abattoir.g    ctautoms.g    fpsgpres.g    matgrp.g      permprod.g
  1880.     agcent.g      ctbasic.g     fptietze.g    matring.g     permutat.g
  1881.     agclass.g     ctcharac.g    gaussian.g    matrix.g      polyfin.g
  1882.     agcomple.g    ctfilter.g    group.g       module.g      polyfld.g
  1883.     agcoset.g     ctgapmoc.g    grpcoset.g    numfield.g    polynom.g
  1884.     agctbl.g      ctgeneri.g    grpctbl.g     numtheor.g    polyrat.g
  1885.     aggroup.g     ctlattic.g    grpelms.g     onecohom.g    pq.g
  1886.     aghall.g      ctmapcon.g    grphomom.g    operatio.g    rational.g
  1887.     aghomomo.g    ctmapusi.g    grpprods.g    permag.g      recsl.g
  1888.     aginters.g    ctpermch.g    init.g        permbckt.g    ring.g
  1889.     agnorm.g      ctpgrp.g      integer.g     permcose.g    rowmodul.g
  1890.     agprops.g     ctsymmet.g    lattag.g      permcser.g    rowspace.g
  1891.     agsubgrp.g    cyclotom.g    lattgrp.g     permctbl.g    string.g
  1892.     agwords.g     domain.g      lattperf.g    permgrp.g     tom.g
  1893.     cdaggrp.g     field.g       lattperm.g    permhomo.g    vecspace.g
  1894.     chevgrp.g     finfield.g    list.g        permnorm.g
  1895.     combinat.g    fpgrp.g       mapping.g     permoper.g
  1896.     c:\gap\lib\ > rm ..\lib3r2.zoo
  1897.     c:\gap\lib\ > cd ..
  1898.     c:\gap\ > |
  1899.  
  1900. Start {\GAP} and try a few things.  Note that {\GAP} has  to read most of
  1901. the library for the fourth statement below,  so this takes quite a while.
  1902. Subsequent definitions of groups will be much faster.
  1903.  
  1904. |    c:\gap\ > gap
  1905.     gap> 2 * 3 + 4;
  1906.     10
  1907.     gap> Factorial( 30 );
  1908.     265252859812191058636308480000000
  1909.     gap> Factors( 10^42 + 1 );
  1910.     [ 29, 101, 281, 9901, 226549, 121499449, 4458192223320340849 ]
  1911.     gap> M11 := Group( (1,2,3,4,5,6,7,8,9,10,11),
  1912.     >                  (3,7,11,8)(4,10,5,6) );;
  1913.     gap> Size( M11 );
  1914.     7920
  1915.     gap> Factors( 7920 );
  1916.     [ 2, 2, 2, 2, 3, 3, 5, 11 ]
  1917.     gap> IsSimple( M11 );
  1918.     true |
  1919.  
  1920. Especially try the command  line editing  and history facilities, because
  1921. the are probably the most  machine dependent feature  of {\GAP}.  Enter a
  1922. few commands   and then make  sure  that  <ctr>-'P' redisplays   the last
  1923. command, that  <ctr>-'E'  moves the cursor  to the end  of the line, that
  1924. <ctr>-'B' moves the cursor back one character, and that <ctr>-'D' deletes
  1925. single characters.  So after entering the above three commands typing\\
  1926. <ctr>-'P' <ctr>-'P' <ctr>-'E' <ctr>-'B'
  1927. <ctr>-'B' <ctr>-'B' <ctr>-'B' <ctr>-'D' '1'\\
  1928. should give the following line.
  1929.  
  1930. |    gap> Factors( 7921 );
  1931.     [ 89, 89 ] |
  1932.  
  1933. If you start {\GAP}  from another place, i.e.,  not from within the 'gap'
  1934. directory,  you  will  have to   specify  the full  path   to the library
  1935. subdirectory.
  1936.  
  1937. |    c:\gap\ > cd ..
  1938.     c:\ > gap\gap
  1939.     gap: hmm, I cannot find 'lib\init.g', maybe use option '-l <libname>'?
  1940.     gap> quit;
  1941.     c:\ > gap\gap -l c:\gap\lib\
  1942.     gap> Gcd( 123, 66 );
  1943.     3
  1944.     gap> quit;
  1945.     c:\ > cd gap
  1946.     c:\gap\ > |
  1947.  
  1948. Unpack the documentation into  a  subdirectory 'doc'.  The  documentation
  1949. serves both as {\LaTeX} source for the printed manual and as online help.
  1950. Because the documentation files also  serves  as online  help, you do not
  1951. want to remove them, unless space is very tight, and you are content with
  1952. the printed manual.
  1953.  
  1954. |    c:\gap\ > mkdir doc
  1955.     c:\gap\ > cd doc
  1956.     c:\gap\doc\ > zoo x ..\doc3r2.zoo
  1957.     # 'zoo' prints the name of each file as it is extracted
  1958.     c:\gap\doc\ > ls
  1959.     aboutgap.tex  environm.tex  language.tex  numfield.tex  rowspace.tex
  1960.     aggroup.tex   field.tex     list.tex      numtheor.tex  set.tex
  1961.     agwords.tex   finfield.tex  manual.bbl    operatio.tex  share.tex
  1962.     anupq.tex     fpgrp.tex     manual.bib    paramaps.tex  string.tex
  1963.     blister.tex   gaussian.tex  manual.idx    permgrp.tex   tom.tex
  1964.     boolean.tex   gentable.tex  manual.ind    permutat.tex  unknown.tex
  1965.     characte.tex  gettable.tex  manual.tex    polynom.tex   vecspace.tex
  1966.     chartabl.tex  group.tex     manual.toc    preface.tex   vector.tex
  1967.     combinat.tex  grplib.tex    mapping.tex   range.tex     weyl.tex
  1968.     copyrigh.tex  homomorp.tex  matgrp.tex    rational.tex  word.tex
  1969.     cyclotom.tex  install.tex   matring.tex   record.tex
  1970.     domain.tex    integer.tex   matrix.tex    ring.tex
  1971.     c:\gap\doc\ > rm ..\doc3r2.zoo
  1972.     c:\gap\doc\ > |
  1973.  
  1974. If you have a big version of {\LaTeX} available you  may now want to make
  1975. a printed copy  of the manual.  Change into  the directory 'doc/' and run
  1976. {\LaTeX} *twice* on the source.   The  first pass with {\LaTeX}  produces
  1977. the '.aux'  files,  which resolve all the  cross  references.  The second
  1978. pass produces  the final  formatted  *dvi* file 'manual.dvi'.  This  will
  1979. take quite  a while, since  the  manual is  large.  Then print  the *dvi*
  1980. file.  How you actually print the 'dvi' file produced by {\LaTeX} depends
  1981. on the  printer you have, the version  of {\LaTeX}  you have, and whether
  1982. you use a {\TeX}-shell   or not, so  we will  not attempt to  describe it
  1983. here.
  1984.  
  1985. |    c:\gap\doc\ > latex manual
  1986.     # about 2000 messages about undefined references
  1987.     c:\gap\doc\ > latex manual
  1988.     # there should be no warnings this time
  1989.     c:\gap\doc\ > ls -l manual.dvi
  1990.     -rw   2591132 Apr  7 23:29 manual.dvi
  1991.     c:\gap\doc\ > cd ..
  1992.     c:\gap\ > |
  1993.  
  1994. Note that because of the large  number of  cross references in the manual
  1995. you need a *big*  {\LaTeX} to format the {\GAP}  manual.  If you  see the
  1996. error message  'TeX capacity  exceeded', you do  not have a big {\LaTeX}.
  1997. In this case  you  may also  obtain the  already    formatted *dvi*  file
  1998. 'manual.dvi' from  the  same place where   you obtained the   rest of the
  1999. {\GAP} distribution.
  2000.  
  2001. Note that, apart   from   the  '\*.tex' files  and the file  'manual.bib'
  2002. (bibliography database),  which you absolutely need, we  supply  also the
  2003. files 'manual.toc' (table of   contents), 'manual.ind' (unsorted  index),
  2004. 'manual.idx' (sorted  index), and  'manual.bbl' (bibliography).  If those
  2005. files are missing, or  if you prefer  to do everything  yourself, here is
  2006. what you will have to do.  After  the first  pass with {\LaTeX}, you will
  2007. have  preliminary 'manual.toc' and  'manual.ind'  files.   All  the  page
  2008. numbers are  still incorrect, because the  do not account  for  the pages
  2009. used by  the table of contents itself.   Now 'bibtex  manual' will create
  2010. 'manual.bbl' from 'manual.bib'.  After  the second pass with {\LaTeX} you
  2011. will  have a  correct   'manual.toc'  and 'manual.ind'.  'makeindex'  now
  2012. produces the sorted index 'manual.idx' from 'manual.ind'.  The third pass
  2013. with {\LaTeX} incorporates this index into the manual.
  2014.  
  2015. |    c:\gap\doc\ > latex manual
  2016.     # about 2000 messages about undefined references
  2017.     c:\gap\doc\ > bibtex manual
  2018.     # 'bibtex' prints the name of each file it is scanning
  2019.     c:\gap\doc\ > latex manual
  2020.     # still some messages about undefined citations
  2021.     c:\gap\doc\ > makeindex manual
  2022.     # 'makeindex' prints some diagnostic output
  2023.     c:\gap\doc\ > latex manual
  2024.     # there should be no warnings this time
  2025.     c:\gap\doc\ > lp -dvi manual.dvi
  2026.     c:\gap\doc\ > cd ..
  2027.     c:\gap\ > |
  2028.  
  2029. If you have also fetched 'grp3r2.zoo', 'two3r2.zoo', and/or 'tbl3r2.zoo',
  2030. you may now want to unpack those into subdirectories 'grp', 'two', and/or
  2031. 'tbl' in  a corresponding  way.  Alternatively  you can  do this  anytime
  2032. later.
  2033.  
  2034. Thats  all, finally you  are  done.  We  hope  that you  will enjoy using
  2035. {\GAP}.  If you have problems, do not hesitate to contact us.
  2036.  
  2037. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  2038. \Section{Features on the Atari ST}%
  2039. \index{features!under TOS}\index{TOS!features}%
  2040. \index{options!under TOS}\index{TOS!options}%
  2041. \index{.gaprc}
  2042.  
  2043. When you  start  {\GAP} on  the Atari  ST, you may   specify a  number of
  2044. options  on the command-line to  change the default  behaviour of {\GAP}.
  2045. All these  options start with a hyphen  '-', followed by a single letter.
  2046. Options must not be grouped, e.g., 'gap -gq' is  illegal, use 'gap -g -q'
  2047. instead.   Some options require an argument,  this must follow the option
  2048. and  must  be separated by a   <space>, e.g., 'gap  -m  256k',  it is not
  2049. correct to say 'gap -m256k' instead.
  2050.  
  2051. You must declare {\GAP}  as TOS-takes-parameter program   if you want  to
  2052. specify command-line options  when you start  {\GAP}  by double clicking.
  2053. This means that the  name of the {\GAP} program  file must be  'gap.ttp'.
  2054. When you start {\GAP} from a shell, such  as 'gulam.tos', the name of the
  2055. program file  does  not matter.  The   Atari ST version, unlike  the UNIX
  2056. versions, does not distuingish upper and lower case for options.
  2057.  
  2058. '-g'
  2059.  
  2060. The options '-g' tells {\GAP} to print a information message every time a
  2061. garbage collection is performed.
  2062.  
  2063. |    #G collect garbage, 1931 used, 5012 dead, 912 KB free, 3072 KB total|
  2064.  
  2065. For example, this tells you that there are 1931 live objects that surived
  2066. a garbage collection, that 5012 unused objects  were reclaimed by it, and
  2067. that 912 KByte of totally allocated 3072 KBytes are available afterwards.
  2068.  
  2069. '-l <libname>'
  2070.  
  2071. The option '-l'  tells {\GAP} that the library of {\GAP} functions  is in
  2072. the  directory <libname>.  Per  default  <libname> is 'lib/',  i.e.,  the
  2073. library is normally  expected  in the  subdirectory 'lib/' of the current
  2074. directory.  {\GAP} searches for the library files, whose filenames end in
  2075. '.g', and which contain the functions initially known to {\GAP},  in this
  2076. directory.  <libname> should  end with a  pathname separator,  i.e., '/',
  2077. but {\GAP} will silently add one if it is missing.   {\GAP} will read the
  2078. file '<libname>/init.g' during  startup.  If {\GAP} cannot find this file
  2079. it will print the following warning
  2080.  
  2081. |    gap: hmm, I cannot find 'lib/init.g', maybe use option '-l <lib>'?|
  2082.  
  2083. If you  want a bare bones {\GAP},  i.e., if you do  not  need any library
  2084. functions, you may ignore this warning, otherwise you should leave {\GAP}
  2085. and start  it again, specifying the correct  library path  using the '-l'
  2086. option.
  2087.  
  2088. It is  also possible  to  specify several  alternative library  pathes by
  2089. separating them  with semicolons ';'.   Note  that in this case  all path
  2090. names must end with the pathname separator '/'.   {\GAP} will then search
  2091. for its library files in all those directories in turn, reading the first
  2092. it finds.  E.g., if you specify '-l \"lib/;/usr/local/lib/gap/3.2/lib/\"'
  2093. {\GAP} will search for a library file first in the subdirectory 'lib/' of
  2094. the current directory, and if it does not find it there in the  directory
  2095. '/usr/local/lib/gap/3.2/lib/'.  This way you can built your own directory
  2096. of {\GAP} library files that override the standard ones.
  2097.  
  2098. {\GAP}  searches for the group files,  whose filenames end in '.grp', and
  2099. which contain the groups initially known to  {\GAP}, in the directory one
  2100. gets by replacing the string 'lib' in <libname> by the  string 'grp'.  If
  2101. you do not want  to put the group  directory 'grp/' in the same directory
  2102. as the 'lib/' directory,  for example if you want  to put the groups onto
  2103. another   hard  disk  partition,  you have  to   edit the   assignment in
  2104. '<libname>/init.g' that reads
  2105.  
  2106. |    GRPNAME := ReplacedString( LIBNAME, "lib/;", "grp/;" );|
  2107.  
  2108. This path  can also consist of  several  alternative  pathes, just as the
  2109. library path.  If the library path consists of several alternative pathes
  2110. the default value for this path will consist of the same pathes, where in
  2111. each component the last occurrence of 'lib/' is replaced by 'grp/'.
  2112.  
  2113. Similar considerations    apply to   the  character  table  files.  Those
  2114. filenames end in '.tbl'.   {\GAP} looks for  those files in the directory
  2115. given  by 'TBLNAME'.  The default  value   for 'TBLNAME'  is  obtained by
  2116. replacing 'lib' in <libname> with 'tbl'.
  2117.  
  2118. '-h <docname>'
  2119.  
  2120. The option '-h' tells {\GAP} that the on-line  documenation for {\GAP} is
  2121. in  the  directory <docname>.   Per  default  <docname>  is  obtained  by
  2122. replacing 'lib' in  <libname> with 'doc'.  <docname>  should  end with  a
  2123. pathname  separator, i.e., '/', but {\GAP} will silently add one if it is
  2124. missing.  {\GAP} will read the file '<docname>/manual.toc' when you first
  2125. use the help system.  If {\GAP}  cannot find this file it  will print the
  2126. following warning
  2127.  
  2128. |    help: hmm, I cannot open the table of contents file 'doc/manual.toc'
  2129.     maybe you should use the option '-h <docname>'?|
  2130.  
  2131. '-m <memory>'
  2132.  
  2133. The option '-m' tells {\GAP} to  allocate <memory> bytes at startup time.
  2134. If the last character of <memory> is 'k' or 'K' it is taken in KBytes and
  2135. if the last character is 'm' or 'M' <memory> is taken in MBytes.
  2136.  
  2137. On the Atari ST {\GAP} will by default allocate all available memory.  If
  2138. you specify  '-m <memory>'  {\GAP} will only  allocate  that much memory,
  2139. unless <memory> is  larger  than the  default,  in that case  {\GAP} will
  2140. fail.   If you speficy a negative  amount  {\GAP} leaves that much memory
  2141. unallocated.  You may want to do this so that it is possible to run other
  2142. programs from inside {\GAP} with the  'Exec' command, for example 'gap -m
  2143. -256k'  will leave 256 KByte unallocated,  enough to  run MicroEMACS from
  2144. inside {\GAP}.
  2145.  
  2146. '-n'
  2147.  
  2148. The  options  '-n' tells {\GAP} to  disable  the line editing and history
  2149. (see "Line Editing").
  2150.  
  2151. There does not seem to be a good reason to do this on the Atari ST.
  2152.  
  2153. '-b'
  2154.  
  2155. The option '-b'  tells {\GAP} to  surpress the banner.  That  means  that
  2156. {\GAP} immediately prints the prompt.  This is useful  when you get tired
  2157. of the banner after a while.
  2158.  
  2159. '-q'
  2160.  
  2161. The  option '-q' tells  {\GAP} to be quiet.  This  means that {\GAP} does
  2162. not  display the banner and the  prompts 'gap>'.  This  is useful  if you
  2163. want to run {\GAP} as a filter with input and output redirection and want
  2164. to avoid the the banner and the prompts clobber the output file.
  2165.  
  2166. '-x <length>'
  2167.  
  2168. With this  option you can tell  {\GAP} how long   lines are.  {\GAP} uses
  2169. this value to decide when to split long lines.
  2170.  
  2171. The default value is 80,  which  is correct if  you start {\GAP} from the
  2172. desktop or one of the usual shells.  However, if you  start {\GAP} from a
  2173. window shell such as 'gemini', you may want to decrease  this  value.  If
  2174. you have a larger monitor, or use a smaller font, or  redirect the output
  2175. to a printer, you may want to increase this value.
  2176.  
  2177. '-y <length>'
  2178.  
  2179. With this  option you can  tell {\GAP} how  many lines  your  screen has.
  2180. {\GAP} uses this value to decide after how  many lines of on-line help it
  2181. should display |-- <space> for more --|.
  2182.  
  2183. The default value is  24, which is  the right value  if  you start {\GAP}
  2184. from the desktop or one  of  the  usual shells.   However, if  you  start
  2185. {\GAP} from a window  shell such as 'gemini',   you may want  to decrease
  2186. this value.  If  you  have a larger monitor,  or use  a smaller  font, or
  2187. redirect the output to a printer, you may want to increase this value.
  2188.  
  2189. Further arguments are taken as filenames of files that are read by {\GAP}
  2190. during startup, after '<libname>/init.g'  is  read, but before the  first
  2191. prompt is printed.  The files are read in the order  in  that they appear
  2192. on the  command  line.   {\GAP} only accepts 14  filenames on the command
  2193. line.  If a file cannot be opened {\GAP} will print an error  message and
  2194. will abort.
  2195.  
  2196. When you start {\GAP}, it looks  for  the file  with the name 'gap.rc' in
  2197. your  homedirectory (i.e., the   directory   defined by  the  environment
  2198. variable     'HOME').  If  such   a file  is    found it   is read  after
  2199. '<libname>/init.g', but before any of the  files mentioned on the command
  2200. line are read.   You can use  this file for your private  customizations.
  2201. For example, if you  have a file  containing  functions  or data that you
  2202. always need, you could read this from 'gap.rc'.   Or if you find  some of
  2203. the names in  the  library too long,  you could define abbreviations  for
  2204. those names in 'gap.rc'.  The following sample 'gap.rc' file does both.
  2205.  
  2206. |    Read("c:\\gap\\dat\\mygroups.grp");
  2207.     Op := Operation;
  2208.     OpHom := OperationHomomorphism;
  2209.     RepOp := RepresentativeOperation;
  2210.     RepsOp := RepresentativesOperation; |
  2211.  
  2212. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  2213. \Section{Porting GAP}
  2214.  
  2215. Porting {\GAP}  to a new operating  system should not  be very difficult.
  2216. However,  {\GAP} expects some features from the  operating system and the
  2217. compiler  and porting {\GAP}  to a system or with  a compiler that do not
  2218. have those features may prove very difficult.
  2219.  
  2220. The design of {\GAP} makes it quite portable.  {\GAP} consists of a small
  2221. kernel written in the programming language C  and a large library written
  2222. in the programming language provided by  the {\GAP} kernel, which is also
  2223. called {\GAP}.
  2224.  
  2225. Once the kernel has been ported, the library poses no additional problem,
  2226. because all those functions  only need the kernel to  work, they  need no
  2227. additional support from the environment.
  2228.  
  2229. The  kernel  itself is  separated   into a large    part that  is largely
  2230. operating system and compiler independent, and one file that contains all
  2231. the operating system and compiler dependent functions.  Usually only this
  2232. file must be modified to port {\GAP} to a new operating system.
  2233.  
  2234. Now lets take  a look at the minimal  support that {\GAP} needs from  the
  2235. operating system and the machine.
  2236.  
  2237. First  of all  you need enough   filespace.  The  kernel sources  and the
  2238. object files need between 3 MByte and 3.5 MByte, depending on the size of
  2239. object  files produced  by  your compiler.    The   library takes up   an
  2240. additional 2 MBytes, and the online documentation also needs 2 MByte.  So
  2241. you need about 8 MByte of available filespace, for example on a harddisk.
  2242.  
  2243. Next  you need  enough main memory  in  your computer.   The  size of the
  2244. {\GAP} kernel  varies between different  machine,  with as little as  300
  2245. KByte  (compiled with GNU C  on  an Atari ST)   and as much  as 600 KByte
  2246. (compiled with UNIX  cc  on a  HP 9000/800).   Add  to that the fact  the
  2247. library of functions that {\GAP} loads takes up another 400 KByte.  So it
  2248. is  clear that at least 2   MByte of main memory   are required to do any
  2249. serious work with {\GAP}.
  2250.  
  2251. Note that this implies that there is no point in trying to port {\GAP} to
  2252. plain MS-DOS running  on IBM PCs and compatibles.   The version of {\GAP}
  2253. for IBM PC compatibles that  we  provide runs on  machines with the Intel
  2254. 80386  or Intel  80486  processor under  extended DOS in protected 32 bit
  2255. mode.  (This is also necessary, because, as mentioned below, {\GAP} wants
  2256. to view its memory as a large flat address space.)
  2257.  
  2258. Next lets turn to the requirements for the C compiler and its library.
  2259.  
  2260. As was already mentioned, the {\GAP} kernel is written in the C language.
  2261. We  have tried  to use  as few features  of  the C language as  possible.
  2262. {\GAP} has  been compiled without  problems with compilers that adhere to
  2263. the old  definition from Kernighan and Ritchie,  and with  compilers that
  2264. adhere to the new definition from the ANSI-C standard.
  2265.  
  2266. However, it is probably necessary that the compiler has a default integer
  2267. size of 32   bits, i.e., 'sizeof(int)'  should be  4  not 2.  It  may  be
  2268. possible  to fix all the  places where 32 bit  'int's are assumed, but we
  2269. assume that it will be easier to get a 32 bit compiler.
  2270.  
  2271. The most critical aspect probably is that  the {\GAP} kernel needs a flat
  2272. address space.  There are especially two systems where this is a problem.
  2273.  
  2274. The first is MS-DOS with its segments.  As  was already  mentioned above,
  2275. we circumvent this by using an extended DOS in protected  32 bit  mode on
  2276. PC compatibles with an Intel 386 or Intel 486 processor.
  2277.  
  2278. The other system is the Macintosh.  On the Macintosh the operating system
  2279. wants   to deal out   the  memory only in  small  chunks,  and also wants
  2280. programs to allow it to move those chunks to the  disk temporarily.  This
  2281. is because Apple  wanted to support programs  that used quite some memory
  2282. on its  initial Macs, which had  only 512 KByte   of memory, without true
  2283. virtual memory  support.  Thus  they forced  the application programs  to
  2284. simulate virtual memory.  {\GAP} does not do this.  Probably the best way
  2285. to  deal with that  is to allocate  as much memory  as one can get in one
  2286. large chunk,  while leaving enough memory  free for the operating system,
  2287. and to    lock  this chunk  in   memory.  Such  behaviour   is considered
  2288. uncooperative, but it is the best {\GAP} can do without a major rewrite.
  2289.  
  2290. The  two points  mentioned above  are necessary,   because  most parts of
  2291. {\GAP} depend on those features.  All other dependencies on the operating
  2292. system or  compiler should be  separated   in one  special file which  is
  2293. called the  'system' file.   When  you  port  {\GAP}  to a  new operating
  2294. system, you  probably  have to create  a  new 'system' file.  You  should
  2295. however look through the  'system' files that  we supply and take as much
  2296. code   from  them  as  possible.  Currently   we supply  'system.bsd' for
  2297. Berkeley  UNIX, 'system.usg' for System V  UNIX, and  'system.st' for the
  2298. Atari ST running TOS with the  GNU C compiler.  As  you will notice, when
  2299. you do this, most of  the code in those  three files is again  identical.
  2300. This is not surprising.  Most C compilers today  come with a library that
  2301. more or less resembles the standard library available under UNIX.
  2302.  
  2303. The 'system' file contains the following functions.
  2304.  
  2305. First  file  input and output.  The   functions used by  the three system
  2306. files mentioned above are 'fopen', 'fclose',  'fgets', and 'fputs'.  They
  2307. are pretty standard, and in fact are in the ANSI C standard library.  The
  2308. only thing that may be necessary is to make sure that files are opened in
  2309. text  mode.  However, the most  important transformation  applied in text
  2310. mode seems to be to replace  the end of line sequence <newline>-<return>,
  2311. used in some  operating  systems, with a  single  <newline>, used  in  C.
  2312. However, since  {\GAP} treats <newline> and  <return> both as whitespaces
  2313. even this is not absolutely necessary.
  2314.  
  2315. Second you need  character oriented input  from the keyboard   and to the
  2316. screen.  This is not absolutely necessary, you can  use the line oriented
  2317. input and output described above.  However, if  you want the  history and
  2318. the command  line editing, {\GAP}  must  be  able   to read every  single
  2319. character as the user types it without echo, and also must be able to put
  2320. single characters  to  the screen.    Reading  characters  unblocked  and
  2321. without echo is very  system dependent  (and  is  in fact the reason  why
  2322. there are   two 'system' files for  UNIX,  one for  Berkeley  and one for
  2323. System V).
  2324.  
  2325. Third you need a  way to detect if the  user typed <ctr>-'C' to interrupt
  2326. an   ongoing  computation   in  {\GAP}.  Again    this is not  absolutely
  2327. necessary,  you can   do without.   However  if you want  to   be able to
  2328. interrupt computations,  {\GAP} must be able to  receive  the  interrupt.
  2329. This can be done in two ways.  Under  UNIX you can  catch the signal that
  2330. is   generated  if   the  user types <ctr>-'C'  ('SIGINT').   Under other
  2331. operating systems that do not support such signals you can poll the input
  2332. stream at regular intervals and simply look for <ctr>-'C'.
  2333.  
  2334. Fourth you need a  way  to find out  how  long  {\GAP} has been  running.
  2335. Again this is not absolutely necessary.  You can  simply always return 0,
  2336. fooling  {\GAP} into  thinking that it  is extremly fast.  However if you
  2337. want timing statistics, {\GAP} must be able to find out how much CPU time
  2338. it has spent.
  2339.  
  2340. The  last and most important function  is the function to allocate memory
  2341. for {\GAP}.  {\GAP}  assumes that  it can allocate the initial  workspace
  2342. with the function  'SyGetmem' and expand this workspace  on  demand  with
  2343. further calls to 'SyGetmem'.  The  memory allocated by consequitive calls
  2344. to 'SyGetmem' must be  adjacent, because {\GAP}  wants to manage a single
  2345. large  block  of memory.  Usually this   can be done  with  the C library
  2346. function 'sbrk'.  If this does  not work, you  can define a  large static
  2347. array in  the  'system'  file and return  this  on    the  first call  to
  2348. 'SyGetmem' and return 0  on subsequent calls  to indicate that this array
  2349. cannot dynamically be expanded.
  2350.  
  2351. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  2352. %%
  2353. %E  Emacs . . . . . . . . . . . . . . . . . . . . . local Emacs variables
  2354. %%
  2355. %%  Local Variables:
  2356. %%  mode:               outline
  2357. %%  outline-regexp:     "\\\\Chapter\\|\\\\Section"
  2358. %%  fill-column:        73
  2359. %%  eval:               (hide-body)
  2360. %%  End:
  2361. %%
  2362.  
  2363.  
  2364.  
  2365.