72.4 Installation of GAP for UNIX

Installing GAP on a UNIX machine is fairly easy. Get the files described in Getting GAP and decide into which directory you want to install GAP 4.2. If you will be the only user using GAP, you probably should install it in your home directory. If other users will be also using GAP, you should install it in a public place, such as /usr/local/lib/. GAP will be installed in a subdirectory gap4r2 of this directory. You can later move GAP to a different location. For example you can first install it in your home directory and when it works move it to /usr/local/lib/.

The following installation example assumes that you (as user you on the machine unix) are installing GAP into the directory /usr/local/lib on a Pentium Pro running Linux.

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.

If you encounter problems please also see section If Things Go Wrong of this document.

Get the distribution gap4r2.zoo and the source for the zoo archive extractor unzoo.c. How you can get those files is described in the section Getting GAP. 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@unix> cc -o unzoo -DSYS_IS_UNIX -O unzoo.c
you@unix> ls -l unzoo
-rwxr-xr-x you 45056 Nov 3 10:11 unzoo
you@unix> 

Now unpack the distribution with the command

you@unix> ./unzoo -x gap4r2.zoo
gap4r2/doc/aboutgap.tex -- extracted as text
gap4r2/doc/aggroup.tex  -- extracted as text
[many more lines]
you@unix> 

If you got not the full distribution file but several small files, extract all of them (except the bug fixes and share packages!) in this way.

(Afterwards you will not need the file gap4r2.zoo any longer. If you are short of disk space you can remove it now.)

you@unix> rm gap4r2.zoo

Now go in the directory gap4r2 If you got any bug fixes (there are none in the initial release but doubtlessly some will follow. You can find them in the bugfixes directory on our ftp server(s).) extract these there. (The bug fixes extract only on this level to make them applicable even if you chose later to rename the root directory of your GAP distribution.)

If there is more than one fix file, first unpack fix1, then fix2, an so on.

you@unix> cd gap4r2
you@unix> ../unzoo -x ../fixXX4r2.zoo
[again extraction information]

If you got any share packages, extract them in the pkg subdirectory in the same way. For example if you got the allshare4r2.zoo and submitshare4r2.zoo archives, you would issue:

you@unix> cd pkg
you@unix> ../../unzoo -x ../../allshare4r2.zoo
you@unix> ../../unzoo -x ../../submitshare4r2.zoo
you@unix> cd ..

The directories tbl, tom, trans, small and prim contain data libraries. If you are short of disk space you can erase some of them, but then of course you will not be able to access this data.

Under UNIX, we now use the ``autoconfig'' method to take care of system dependencies. (See Porting GAP if this is not working on your machine.)

If you are installing GAP on various systems that share a file system and if you have installed GAP already on another machine you must remove the files config.cache and config.status first!

Then run the shell script configure:

you@unix> ./configure
checking host system type... i686-unknown-linux2.0.27
[many more lines]

This will automatially detect the machine and compiler target. The process will automatically create an appropriate binary subdirectory. It also creates a Makefile that will be used to compile GAP on this machine. Simply call make:

you@unix> make
[many lines of further configuration and compilation]

If configure or make fails, see section Known Problems of the Configure Process for a description of some remedies.

If you have UNIX experience you might want to change the compilation options to obtain a better performance. Section Optimization and Compiler Options explains how to do this.

The compilation process creates the object files and the executable in the directory /usr/local/lib/gap4r2/bin/target/, where target is the name printed by the first configure. In our example the executable will be created as /usr/local/lib/gap4r2/bin/i686-unknown-linux2.0.27/gap

The automatic configuration should work on any UNIX system. If it does not, please inform us at gap-trouble@dcs.st-and.ac.uk.

In order to test your compilation now run the newly created executable. You should get the GAP banner and then the GAP prompt. (The process of starting GAP may take a little while.)

you@unix> cd ..
you@unix> bin/i686-unknown-linux2.0.27/gap -l /usr/local/lib/gap4r2
[... lines deleted]
gap>
(Having to give the library path with the -l option each time would be a bit tedious. Below we will therefore install a shell script to start GAP.)

Try a few things to see if the compilation succeeded.

gap> 2 * 3 + 4;
10
gap> Factorial( 30 );
265252859812191058636308480000000
gap> Size( SymmetricGroup( 10 ) );
3628800
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> Length( ConjugacyClasses( m11 ) );
10 

Especially try the command line editing and history facilities, because they 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 return

should give the following lines:

gap> Factors( 7921 );
[ 89, 89 ] 

If you can compile but command line editing does not work you can always start GAP with option -n to disable command line editing. In such a case however 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.

The make process should also have created a shell script gap.sh in the bin subdirectory. This file already contains proper directory paths and it should be possible to start GAP by simply calling this script. Still, you might want to edit it to give further default command line options or modify the default memory.

Execute the script to start GAP again

you@unix> bin/gap.sh
If the shell complains that it cannot execute or find gap.sh check the permissions of the file by doing a ls -l bin/gap.sh. The permissions should include execute permissions, if they don't you can set them by
you@unix> chmod +x bin/gap.sh

Then copy this script into a directory in your search path, for example /usr/local/bin/ as gap (or gap4 if you also have GAP 3 running on the same machine). (If you are using the C-shell, you will also have to rehash, so that the C-shell adds gap to its internal tables). When you later move GAP to another location you only need to edit this script.

There also is a shell script gac in the same place that can be used to invoke the compiler. Depending on your installation you also might want to copy it in a directory in your search path.

Now you should be able to start GAP by its name:

you@unix> cd ~
you@unix> gap

(If you get an error message ``hmm, I cannot find lib/init.g'' you are starting the pure binary. It needs to find the library which is given via the command line parameter -l.)

A set of test files is provided, running them all takes some 40 minutes on a Pentium Pro 200 Mhz. As a quick test we start combinat.tst first.

gap> Filename( DirectoriesLibrary("tst"), "combinat.tst" );
"/usr/local/lib/gap4r2/tst/combinat.tst"
gap> ReadTest(last);
+ $ld: combinat.tst,v 4.7 1997/11/21 10:19:47 ahulpke Exp $
+ GAP4stones: 27801
true

The number given as GAP4stones will vary, depending on the speed of your machine.

Now use Read (not ReadTest) to read the file testall.g to run all available test files. This is not a necessary part of the installation, it only serves as a confirmation that everything went OK. The full test suite takes some time (almost 2 hours on a Pentium III/500) and uses quite a bit of memory (around 100MB), so you may wish to skip this step or run only part of the tests. This does no harm)

gap> Filename( DirectoriesLibrary("tst"), "testall.g" );
"/usr/local/lib/gap4r2/tst/testall.g"
gap> Read(last);
[lines omitted]
test file         GAP4stones     time(msec)
-------------------------------------------
testing: ./tst/boolean.tst
boolean.tst                0              0
testing: ./tst/unknown.tst
unknown.tst                0             10
testing: ./tst/gaussian.tst
gaussian.tst               0            250
[further lines omitted]

You can ignore warnings from weakptr.tst, which stem from garbage collections occurring at different times, and those from grpconst.tst which stem from differences in available share packages.

The information about the manual is system independent, you can find it in section The Documentation.

If you also installed share packages which require external binaries now go to the share packages directories (the directories under pkg) and follow the instructions given there to compile their binaries.

Some share packages are set up to load (or provide the documentation) automatically. To enable this you have to list all packages in a file ALLPKG in the pkg directory (see section Loading a Share Package in the reference manual for details), the easiest way to do this under UNIX is by issuing the command

find * -type d -maxdepth 0 -print > ALLPKG
in the pkg directory.

If you want to install GAP also on different architectures, which share the same file system with the machine on which you just installed GAP log into these machines and go to the GAP home directory. You do not need to extract any new files, simply execute the same ``configure/make'' process which has been described above again. Make sure, however that you copy the bin/gap.sh and bin/gac shell scripts created by the make process because they are system dependent and will be overwritten when compiling on another system.

A few final reminders: Make sure that you got and installed all bugfixes. We would appreciate if after installation you could send us a short note at gap@dcs.st-and.ac.uk (even if you had installed GAP3 before). We also suggest that you subscribe to our gap-forum mailing list, see the GAP web pages for details.

Thats all, the installation is complete. We hope that you will enjoy using GAP. If you have problems, do not hesitate to contact us at gap-trouble@dcs.st-and.ac.uk.

[Top] [Previous] [Up] [Next] [Index]

GAP 4 manual
February 2000