Using rsync for a binary installation of GAP

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

Last changes --- Fri, 06 Jan 2012 17:44:17 +0100    (Details)

This is a private service for installing GAP 4.4 on Linux PCs with i686 or x86_64 compatible processors (Pentium, Athlon, Xeon, Opteron, ...). 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 650 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 by

   rsync --port=8731 -azv beteigeuze.math.rwth-aachen.de::gap4r4/gapsync/gapsync .

Call this script:

   ./gapsync

You are asked for two directories. The first is for the installation. Everything is copied into a subdirectory gap4r4 of this directory (the default is /usr/local/lib). The second directory should be one in your standard path of executable programs. The following scripts are put in that directory (the default is /usr/local/bin):

gap
for calling GAP
gapL
for calling GAP, loading a workspace and then reading a users ~/.gaprc file (if it exists)
This is the recommended way to start GAP, it is much faster than calling gap.
gapsync
for updating this GAP installation
xgap
using GAP via an X11 interface with graphical capabilities (this does no longer work on newer systems and it may be quite difficult to fix this, sorry)
pargap
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

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 two to ... minutes (about 180 MB must be transferred via the internet).

Updating

You can update the installation by calling the script

   gapsync

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.

A note on updating from a version before GAP 4.4.10 (October 2007)

There are two reasons to update the gapsync script itself:

This is easy to achieve, just follow the instructions for the first installation above: Get the current script by rsync --port=8731 -azv beteigeuze.math.rwth-aachen.de::gap4r4/gapsync/gapsync ., call this script ./gapsync, give the same two paths as in your original installation, and when you are asked if the existing start scripts should be deleted answer y. That's it, from then just call the newly installed gapsync for further updates.

Customization

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/CreateWorkspace.sh 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.

If you have the pager program less available, you probably want to put the lines

    PAGER := "less";
    PAGER_OPTIONS := ["-f", "-r", "-a", "-i", "-M", "-j2"];

in your ~/.gaprc file.

Many people like to have the prompt, input and output in different colors, add the following line to your ~/.gaprc file to use this:

    ColorPrompt(true);

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 gap4r4), so including any custom installations in the gap4r4/local subdirectory.

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

Feedback

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

Notes on this Installation, in Particular Packages

The GAP version is 4.4.12.

Within GAP the command SuggestUpgrades([]); shows which packages are in the distribution.

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

The package linboxing currently doesn't work with this installation (with statically linked kernel modules).

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. Also, it does no longer work on some newer systems and it is not possible to compile it on 64-bit architectures.

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:

How to use dynamic modules?

The executables in this distribution are statically linked to make them as independent as possible of other files in your operating system. But this means for the GAP executable that you cannot use additional packages with kernel modules (LoadDynamicModule in GAP does not work).

If you want to use such packages or develop and test your own, you must compile GAP on your system. An easy way to do that is the following (assuming you have standard tools like gcc, make installed):

cd <path to directory containing your gap4r4>
cp -lR gap4r4 gap4r4dyn   # hard links, needs almost no memory
cd gap4r4dyn
rm -rf bin/x86* bin/i686*
make clean
./configure
make
ln -s `pwd`/bin/gap.sh <your bin dir>/gap.dyn

Repeat this (except the last line) whenever you change your gap4r4 installation.

A few packages may not work with gap.dyn, you have to recompile them as well. See the files gap4r4/gapsync/InstForRsync{32,64} to see how I compiled the packages.