Installation of GAP for UNIX is fairly easy.
First go to the directory where you want to install GAP. If you will
be the only user using GAP, you probably should install it in you
homedirectory. If other users will be using GAP also, you should
install it in a public place, such as /usr/local/lib/
. GAP will be
installed in a subdirectory gap3r4p4
of this directory. You can later
move GAP to a different location. For example you can first install
it in your homedirectory and when it works move it to /usr/local/lib/
.
In the following example we will assume that you, as user you
, want to
install GAP for your own use in your homedirectory on a DECstation
called ernie
. Note that certain parts of the output in the examples
should only be taken as rough outline, especially file sizes and file
dates are not to be taken literally.
Get the distribution gap3r4p4.zoo
and the source for the zoo archive
extractor unzoo.c
. How you can get those files is described in the
section Getting GAP. The usual way would be to get it with ftp
onto
your machine. Remember that the distribution consists of binary files
and that you must transmit them in binary mode.
Compile the zoo archive extractor unzoo
with the command
you@ernie:~ > cc -o unzoo -DSYS_IS_UNIX -O unzoo.c you@ernie:~ > ls -l unzoo -rwxr-xr-x you 45056 Nov 3 10:11 unzoo you@ernie:~ >
Unpack the distribution with the command
you@ernie:~ > unzoo -x gap3r4p4.zoo gap3r4p4/bin/gap.sh -- extracted as text gap3r4p4/doc/aboutgap.tex -- extracted as text gap3r4p4/doc/aggroup.tex -- extracted as text # about 500 more lines gap3r4p4/two/twogpd8.grp -- extracted as text you@ernie:~ >
Change into the source directory gap3r4p4/src/
and execute make
to
see which compilation targets are predefined.
you@ernie:~ > cd gap3r4p4/src you@ernie:~/gap3r4p4/src > make usage: 'make <target>' where target is one of 'atari-m68k-tos-gcc2' for Atari ST under TOS with GNU cc 2 'dec-mips-ultrix-gcc2' for DECstation under Ultrix with GNU cc 2 'dec-mips-ultrix-cc' for DECstation under Ultrix with cc 'hp-hppa1.0-hpux-cc' for HP 9000/800 under HP-UX with cc 'hp-hppa1.1-hpux-cc' for HP 9000/700 under HP-UX with cc 'ibm-power-aix-cc' for IBM RS/6000 under AIX with cc 'ibm-i386-386bsd-gcc2' for IBM PC under 386BSD with GNU cc 2 'ibm-i386-386bsd-cc' for IBM PC under 386BSD with cc (GNU) 'ibm-i386-linux-gcc2' for IBM PC under Linux with GNU cc 2 'ibm-i386-dos-djgpp' for IBM PC under MSDOS with DJ GNU cc 'ibm-i386-os2-emx' for IBM PC under OS/2 with EMX GNU cc 'mips-mips-bsd-cc' for MIPS under RISC/os Berkeley with cc 'mips-mips-sysv-cc' for MIPS under RISC/os System V with cc 'next-m68k-mach-gcc2' for NEXTSTEP 3 on NeXT with GNU cc 2 'next-m68k-mach-cc' for NEXTSTEP 3 on NeXT with cc (GNU) 'next-i386-mach-gcc2' for NEXTSTEP 3 on IBM PC with GNU cc 2 'next-i386-mach-cc' for NEXTSTEP 3 on IBM PC with cc (GNU) 'sequent-i386-dynix-cc' for Sequent Symmetry under Dynix with cc 'sgi-mips-irix-gcc2' for SGI under Irix with GNU cc 2 'sgi-mips-irix-cc' for SGI under Irix with cc 'sun-m68k-sunos-gcc2' for SUN 3 under SunOS with GNU cc 2 'sun-m68k-sunos-cc' for SUN 3 under SunOS with cc 'sun-sparc-sunos-gcc2' for SUN 4 under SunOS with GNU cc 2 'sun-sparc-sunos-cc' for SUN 4 under SunOS with cc 'bsd' for others under Berkeley UNIX with cc 'usg' for others under System V UNIX with cc targets are listed according to preference, i.e., 'sun-sparc-sunos-gcc2' is better than 'sun-sparc-sunos-cc'. additional C compiler and linker flags can be passed with 'make <target> COPTS=<compiler-opts> LOPTS=<linker-opts>', i.e., 'make sun-sparc-sunos-gcc2 COPTS=-g LOPTS=-g.' you@ernie:~/gap3r4p4/src >
Choose the best matching target. If nothing matches precisely, use bsd
(if your UNIX is more Berkeley) or usg
(if your UNIX is more System V).
If compilation of the file system.c
fails or the command line editing
does not work, remove the file system.o
and try the other target. If
system.c
cannot be compiled neither with target bsd
nor with target
usg
, look at this file and try to modify it so that compilation works.
If you can compile but command line editing does not work with either
target, we suggest that you always start GAP with option -n
to
disable command line editing. In any case we would like to hear about
such problems.
In our example the right target is obviously dec-mips-ultrix-cc
(remember ernie
was assumed to be a DECstation). Compile GAP.
you@ernie:~/gap3r4p4/src > make dec-mips-ultrix-cc cc -DSYS_IS_BSD -DSYS_HAS_ANSI=1 -c system.c cc -O2 -c gap.c # about 30 more lines you@ernie:~/gap3r4p4/src > ls -l gap -rwxr-xr-x you 711620 Nov 13 12:47 gap you@ernie:~/gap3r4p4/src >
You may want to keep the source and object files around until you are
certain that everything works. However if space is a tight resource on
your system you may remove the source and object files now. All you need
in the src/
subdirectory from now on is (are) the executable(s).
Copy or move the executable to the gap3r4p4/bin/
directory.
you@ernie:~/gap3r4p4/src > mv gap ../bin you@ernie:~/gap3r4p4/src > cd ../.. you@ernie:~ >
Then edit the shell script gap.sh
in the gap3r4p4/bin/
directory
according to the instructions in this file. This script will start
GAP and is the place for all necessary configurations. Then copy
this script to a directory in your search path, i.e., ~/bin/
. (If you
are using the C-shell, you will also have to rehash
, so that the
C-shell adds gap
to its internal tables).
you@ernie:~ > cd gap3r4p4/bin you@ernie:~/gap3r4p4/bin > cp gap.sh ~/bin/gap you@ernie:~/gap3r4p4/bin > cd ../.. you@ernie:~ >
When you later move GAP to another location you must only edit this script.
Now start GAP and try a few things. The -b
option suppresses the
banner. Note that GAP has to read most of the library for the fourth
statement below, so this takes quite a while. Subsequent definitions of
groups will be much faster.
you@ernie:~ > gap -b gap> 2 * 3 + 4; 10 gap> Factorial( 30 ); 265252859812191058636308480000000 gap> Factors( 10^42 + 1 ); [ 29, 101, 281, 9901, 226549, 121499449, 4458192223320340849 ] gap> m11 := Group((1,2,3,4,5,6,7,8,9,10,11),(3,7,11,8)(4,10,5,6));; gap> Size( m11 ); 7920 gap> Factors( 7920 ); [ 2, 2, 2, 2, 3, 3, 5, 11 ] gap> Number( ConjugacyClasses( m11 ) ); 10
Especially try the command line editing and history facilities, because
the are probably the most machine dependent feature of GAP. Enter a
few commands and then make sure that ctr-P
redisplays the last
command, that ctr-E
moves the cursor to the end of the line, that
ctr-B
moves the cursor back one character, and that ctr-D
deletes
single characters. So, after entering the above commands, typing
ctr-P
ctr-P
ctr-E
ctr-B
ctr-B
ctr-B
ctr-B
ctr-D
1
should give the following line.
gap> Factors( 7921 ); [ 89, 89 ]
If command line editing does not work, remove the file system.o
and try
to compile with a different target, i.e., bsd
instead of usg
or vice
versa. If neither works, we suggest that you disable command line
editing by calling GAP always with the -n
option. In any case we
would like to hear about such problems.
If your operating system has job control, make sure that you can still
stop GAP, which is usually done by pressing ctr-Z
.
If you have a big version of LaTeX available, you may now want to make
a printed copy of the manual. Change into the directory gap3r4p4/doc/
and run LaTeX twice on the source. The first pass with LaTeX
produces the .aux
files, which resolve all the cross references. The
second pass produces the final formatted dvi file manual.dvi
. Then
print the dvi file. How this is done depends on your local TeX
installation, if in doubt ask your local computer guru.
you@ernie:~ > cd gap3r4p4/doc you@ernie:~/gap3r4p4/doc > latex manual # about 2400 messages about undefined references you@ernie:~/gap3r4p4/doc > latex manual # there should be no warnings this time you@ernie:~/gap3r4p4/doc > ls -l manual.dvi -rw-r--r-- you 4806136 Nov 3 23:28 manual.dvi you@ernie:~/gap3r4p4/doc > lp -dvi manual.dvi you@ernie:~/gap3r4p4/doc > cd ../.. you@ernie:~ >
Note that because of the large number of cross references in the manual
you need a big LaTeX to format the GAP manual. If you see the
error message TeX capacity exceeded
, you do not have a big LaTeX;
again ask your local computer guru to provide a big version of LaTeX.
If this is not possible, you may also obtain the already formatted dvi
file manual.dvi
from the same place where you obtained the rest of the
GAP distribution.
Note that, apart from the *.tex
files and the file manual.bib
(bibliography database), which you absolutely need, we supply also the
files manual.toc
(table of contents), manual.ind
(unsorted index),
manual.idx
(sorted index), and manual.bbl
(bibliography). If those
files are missing, or if you prefer to do everything yourself, here is
what you will have to do. After the first pass with LaTeX, you will
have preliminary manual.toc
and manual.ind
files. All the page
numbers are still incorrect, because the do not account for the pages
used by the table of contents itself. Now bibtex manual
will create
manual.bbl
from manual.bib
. After the second pass with LaTeX you
will have a correct manual.toc
and manual.ind
. makeindex
now
produces the sorted index manual.idx
from manual.ind
. The third pass
with LaTeX incorporates this index into the manual.
you@ernie:~ > cd gap3r4p4/doc you@ernie:~/gap3r4p4/doc > latex manual # about 2000 messages about undefined references you@ernie:~/gap3r4p4/doc > bibtex manual # 'bibtex' prints the name of each file it is scanning you@ernie:~/gap3r4p4/doc > latex manual # still some messages about undefined citations you@ernie:~/gap3r4p4/doc > makeindex manual # 'makeindex' prints some diagnostic output you@ernie:~/gap3r4p4/doc > latex manual # there should be no warnings this time you@ernie:~/gap3r4p4/doc > lp -dvi manual.dvi you@ernie:~/gap3r4p4/doc > cd ../.. you@ernie:~ >
The full manual is, to put it mildly, now rather long (almost 1600
pages). For this reason, it may be more convenient just to print
selected chapters. This can be done using the \includeonly
LaTeX
command, which is present in manual.tex
(around line 240), but
commented out. To use this, you must first LaTeX the whole manual as
normal, to obtain the complete set of .aux
files and determine the
pages and numbers of all the chapters and sections. After that, you can
edit manual.tex
to uncomment the \includeonly
command and select the
chapters you want. A good start can be to include only the first chapter,
from the file aboutgap.tex
, by editing the line to read
\includeonly{aboutgap}
. The next step is to LaTeX the manual again.
This time only the selected chapter(s) and the table of contents and
indices will be processed, producing a shorter dvi
file that you can
print by whatever means applies locally.
you@ernie:~/gap3r4p4/doc > latex manual # many messages about undefined references, 1600 pages output you@ernie:~/gap3r4p4/doc > vi manual.tex # edit line 241 to include only 'aboutgap' you@ernie:~/gap3r4p4/doc > latex manual # pages 0-196 and 1503-1553 only output no warnings you@ernie:~/gap3r4p4/doc > ls -l manual.dvi -rw-rw-r-- 1 you 1277496 Apr 3 14:48 manual.dvi # the full manual is nearly 5MB you@ernie:~/gap3r4p4/doc > lp -d manual.dviThats all, finally you are done. We hope that you will enjoy using GAP. If you have problems, do not hesitate to contact us.
GAP 3.4.4