55.4 Features of GAP for UNIX

When you start GAP for UNIX, you may specify a number of options on the command-line to change the default behaviour of GAP. All these options start with a hyphen -, followed by a single letter. Options must not be grouped, e.g., gap -gq is illegal, use gap -g -q instead. Some options require an argument, this must follow the option and must be separated by a space, e.g., gap -m 256k, it is not correct to say gap -m256k instead.

GAP for UNIX will only accept lower case options.

Installation of GAP for UNIX) usually you will not execute GAP directly. Instead you will call a shell script, with the name gap, which in turn executes GAP. This shell script sets some options as necessary to make GAP work on your system. This means that the default settings mentioned below may not be what you experience when you execute GAP on your system.

-g

The option -g tells GAP to print a information message every time a garbage collection is performed.

#G collect garbage, 1931 used, 5012 dead, 912 KB free, 4096 KB total

For example, this tells you that there are 1931 live objects that survived a garbage collection, that 5012 unused objects were reclaimed by it, and that 912 KByte of totally allocated 4096 KBytes are available afterwards.

-l libname The option -l tells GAP that the library of GAP functions is in the directory libname. Per default libname is lib/, i.e., the library is normally expected in the subdirectory lib/ of the current directory. GAP searches for the library files, whose filenames end in .g, and which contain the functions initially known to GAP, in this directory. libname should end with a pathname separator, i.e., /, but GAP will silently add one if it is missing. GAP will read the file libname/init.g during startup. If GAP cannot find this file it will print the following warning

gap: hmm, I cannot find 'lib/init.g', maybe use option '-l <lib>'?

If you want a bare bones GAP, i.e., if you do not need any library functions, you may ignore this warning, otherwise you should leave GAP and start it again, specifying the correct library path using the -l option.

It is also possible to specify several alternative library paths by separating them with semicolons ;. Note that in this case all path names must end with the pathname separator /. GAP will then search for its library files in all those directories in turn, reading the first it finds. E.g., if you specify -l "lib/;/usr/local/lib/gap3r4p4/lib/" GAP will search for a library file first in the subdirectory lib/ of the current directory, and if it does not find it there in the directory /usr/local/lib/gap3r4p4/lib/. This way you can built your own directory of GAP library files that override the standard ones.

GAP searches for the group files, whose filenames end in .grp, and which contain the groups initially known to GAP, in the directory one gets by replacing the string lib in libname with the string grp. If you do not want to put the group directory grp/ in the same directory as the lib/ directory, for example if you want to put the groups onto another hard disk partition, you have to edit the assignment in libname/init.g that reads

GRPNAME := ReplacedString( LIBNAME, "lib", "grp" );

This path can also consist of several alternative paths, just as the library path. If the library path consists of several alternative paths the default value for this path will consist of the same paths, where in each component the last occurrence of lib/ is replaced by grp/.

Similar considerations apply to the character table files. Those filenames end in .tbl. GAP looks for those files in the directory given by TBLNAME. The default value for TBLNAME is obtained by replacing lib in libname with tbl.

-h docname

The option -h tells GAP that the on-line documentation for GAP is in the directory docname. Per default docname is obtained by replacing lib in libname with doc. docname should end with a pathname separator, i.e., /, but GAP will silently add one if it is missing. GAP will read the file docname/manual.toc when you first use the help system. If GAP cannot find this file it will print the following warning

    help: hmm, I cannot open the table of contents file 'doc/manual.toc'
    maybe you should use the option '-h <docname>'?

-m memory

The option -m tells GAP to allocate memory bytes at startup time. If the last character of memory is k or K it is taken in KBytes and if the last character is m or M memory is taken in MBytes.

Under UNIX the default amount of memory allocated by GAP is 4 MByte. The amount of memory should be large enough so that computations do not require too many garbage collections. On the other hand if GAP allocates more virtual memory than is physically available it will spend most of the time paging.

-n

The option -n tells GAP to disable the line editing and history (see Line Editing).

You may want to do this if the command line editing is incompatible with another program that is used to run GAP. For example if GAP is run from inside a GNU Emacs shell window, -n should be used since otherwise every input line will be echoed twice, once by Emacs and once by GAP.

-b

The option -b tells GAP to suppress the banner. That means that GAP immediately prints the prompt. This is useful when you get tired of the banner after a while.

-q

The option -q tells GAP to be quiet. This means that GAP does not display the banner and the prompts gap. This is useful if you want to run GAP as a filter with input and output redirection and want to avoid the the banner and the prompts clobbering the output file.

-x length

With this option you can tell GAP how long lines are. GAP uses this value to decide when to split long lines.

The default value is 80, which is the right value if you have a standard ASCII terminal. If you have a larger monitor, or use a smaller font, or redirect the output to a printer, you may want to increase this value.

-y length

With this option you can tell GAP how many lines your screen has. GAP uses this value to decide after how many lines of on-line help it should display -- <space> for more --.

The default value is 24, which is the right value if you have a standard ASCII terminal. If you have a larger monitor, or use a smaller font, or redirect the output to a printer, you may want to increase this value.

Further arguments are taken as filenames of files that are read by GAP during startup, after libname/init.g is read, but before the first prompt is printed. The files are read in the order in that they appear on the command line. GAP only accepts 14 filenames on the command line. If a file cannot be opened GAP will print an error message and will abort.

When you start GAP, it looks for the file with the name .gaprc in your homedirectory. If such a file is found it is read after libname/init.g, but before any of the files mentioned on the command line are read. You can use this file for your private customizations. For example, if you have a file containing functions or data that you always need, you could read this from .gaprc. Or if you find some of the names in the library too long, you could define abbreviations for those names in .gaprc. The following sample .gaprc file does both.

    Read("/usr/you/dat/mygroups.grp");
    Op := Operation;
    OpHom := OperationHomomorphism;
    RepOp := RepresentativeOperation;
    RepsOp := RepresentativesOperation; 

Previous Up Top Next
Index

GAP 3.4.4
April 1997