Using rsync for a binary installation of GAP

Getting a fully installed GAP on Linux with two simple commands!

Last changes --- Mon, 29 Sep 2014 11:31:34 +0200    (Details)

This is a binary distribution of GAP 4.7 on Linux PCs with i686 or x86_64 compatible processors (Pentium, Athlon, Xeon, Opteron, ...). It is maintained by Frank Lübeck. Any reports or suggestions are welcome.

The idea is to install GAP on Linux by syncronizing via the internet with a reference installation. Some features are:

How to Get GAP via this Service

(and not directly from the GAP site.)

You need: a machine with PC architecture (i686 or x86_64 compatible) running under Linux, a directory with about 1600 MB of free space and the rsync program (if you don't have rsync, there is certainly a package with this name in your Linux distribution).

Then copy the start script, called gapsync, into the current directory using the following command (don't forget the trailing dot):

   rsync --port=8731 -azv .

Now call this script:


You are asked for two directories. The first is for the installation. Everything is copied into a subdirectory gap4r5 of this directory (the default is /usr/local/lib). The second directory should be one in your standard path of executable programs, the scripts to start GAP will be put there (the default is /usr/local/bin).
Note: We will use the directory name gap4r5 also for the next GAP releases (4.6.x, 4.7.x and so on) such that updates can be made more easily by calling the gapsync script.

If some of these scripts exist already you will be asked if they can be deleted. Move them away first if you want to keep them.

After giving these two directories, answer y to the next question to start the installation. Depending on your network connection you can use GAP after three to ... minutes (about 360 MB must be transferred via the internet).

Upgrading from the rsync distribution of GAP 4.4

The rsync distribution for GAP 4.4 will not automatically upgrade to GAP 4.5. Please, follow the two step procedure above to install GAP 4.5.

You can keep the GAP 4.4 installation together with the new GAP 4.5 for a while. In that case you probably want to rename some of the start scripts for GAP 4.4 before installing 4.5 (e.g., find them with which gapL and rename gapL to gap44L or similar).

You can remove your GAP 4.4 installation with its remove script. Use the following command in a GAP 4.4 session to find out how this script can be called:

    Print(Concatenation(First(GAPInfo.RootPaths, p->
                    Filename([Directory(p)],"lib/init.g") <> fail), 

How to call GAP

The following scripts are provided by this distribution:

for calling GAP with a saved workspace. This is the recommended way to start GAP, it is much faster than calling gap.
for calling GAP
for updating this GAP installation
for using GAP via an X11 interface with graphical capabilities (but no terminal capabilities in its main window).
for the variant of GAP provided by the ParGAP package, see the package documentation
gap64, gap64L, pargap64
(only on x86_64 based 64-bit architecture) the scripts above always call the 32-bit version of GAP, use these scripts to call the 64-bit version


You can update the installation by calling the script


which was installed during initialization and mentioned above. The syncronization will usually take just a few seconds. A new workspace is created after each syncronization locally.

An update should not be made while a GAP job is running. If you have long running jobs do not use an automatic, say nightly, update.

User customization

Starting from GAP 4.5 the old ~/.gaprc file is substituted by a much more flexible setup. Instead of just this file a whole directory ~/.gap/ is used. An easy way to make use of this is to call in a GAP 4.5 session the command


This creates the ~/.gap/ directory (if necessary) and the file ~/.gap/gap.ini. Look into this file and adjust some of the settings as you like (e.g., specify packages (not) to load, color prompt, less as pager, ...). If your old ~/.gaprc contained code that is not covered by the configuration options in ~/.gap/gap.ini, then copy that code into the file ~/.gap/gaprc.

Customization of this installation

You can customize the gap, gap64, gapL, gap64L, gapsync scripts by editing the files in the local/bin subdirectory of this GAP installation.

You can customize the workspace used in your installation by copying gapsync/ to local/bin/CreateWorkspace (for 32-bit version) or local/bin/CreateWorkspace64 (for 64-bit version) and editing the latter. For example, you may want another set of packages preloaded.

Additional packages can be installed in the local/pkg subdirectory.

Whenever you have changed something in the installation call gapsync which will produce an updated workspace.

If you change things outside the local subdirectory they are deleted with the next call of gapsync. If you find errors in this part, please report them.

Removing this installation

To remove this GAP installation use the script remove in the subdirectory gapsync of your installation:

   <path to your installation>/gapsync/remove

This just deletes the links to the scripts mentioned above and the whole installation directory (starting gap4r5), so including any custom installations in the gap4r5/local subdirectory.

You can also just delete or forget about the gapsync script and use the installed GAP like any standard installation.


Please send comments and suggestions to Frank.Luebeck@Math.RWTH-Aachen.De.

Notes on this installation, in particular packages

The GAP version is 4.5.6.

It is an installation of the archive ~/tmp/gap4r5p6_2012_09_16-01_02.tar.gz plus version 1.4.5 of the homology package.

The packages Alnuth, HAP, polymaking, PolymakeInterface qaos, singular, and SgpViz need or suggest further external software, and may not work immediately with full functionality. More details: Pari/GP, HAP, polymaking, qaos, singular, graphviz

The package linboxing currently doesn't work with this installation.

The package PolymakeInterface is currently only unpacked but not installed.

Note that the AtlasRep package contains directories gap4r4/pkg/atlasrep/data* which are world writable (for caching downloaded representations). These are emptied with any update of this distribution.

If you don't want this you can customize the script gap4r4/local/bin/gapsync in your installation, add the options --exclude=pkg/atlasrep/datagens --exclude=pkg/atlasrep/dataword to the rsync call (search the line containing --port).

The Carat package also needs further installation. (The external binaries hard code their installation path, so I cannot prepare them for you.) You need a C-compiler (probably gcc) and tar. After update go in the subdirectory ./gapsync from the root of your GAP installation and call there the script ./FinishInstallCarat. This will install Carat on i686 systems and install it for the gap64 version on x86_64 systems. The script produces the necessary binaries and unpacks about 150 MB of data files. Finally, call gapsync to update your workspace.

XGap: There were reports that it doesn't work properly on Linux systems using the /dev file system, due to file permission problems. A proper fix is not yet available.

You can customize details of the installation of any package by copying that package to the directory gap4r4/local/pkg. You can also install additional packages there.

Shall I use the 32-bit or 64-bit version of GAP?

If you have an x86_64 based system you can use both. The 64-bit version uses for many GAP objects twice the memory as the 32-bit version and this can also make it a bit slower. The 32-bit version of GAP can, depending on the configuration of the Linux kernel, use at most 2 or 3 Gigabyte of memory (and almost 4 GB on x86_64 systems). So, there are two sitations where you want to use the 64-bit version: