Goto Chapter: Top 1 2 Ind
 [Top of Book]  [Contents]   [Previous Chapter]   [Next Chapter] 

2 Installing and Loading the Example Package
 2.1 Unpacking the Example Package
 2.2 Compiling Binaries of the Example Package
 2.3 Loading the Example Package

2 Installing and Loading the Example Package

2.1 Unpacking the Example Package

If the Example package was obtained as a part of the GAP distribution from the "Download" section of the GAP website, you may proceed to Section 2.2. Alternatively, the Example package may be installed using a separate archive, for example, for an update or an installation in a non-default location (see Reference: GAP Root Directories).

Below we describe the installation procedure for the .tar.gz archive format. Installation using other archive formats is performed in a similar way.

To install the Example package, unpack the archive file, which should have a name of form example-XXX.tar.gz for some version number XXX, by typing

  gzip -dc example-XXX.tar.gz | tar xpv

It may be unpacked in one of the following locations:

In the latter case one one must start GAP with the -l option, e.g. if your private pkg directory is a subdirectory of mygap in your home directory you might type:

  gap -l ";myhomedir/mygap"

where myhomedir is the path to your home directory, which (since GAP 4.3) may be replaced by a tilde (the empty path before the semicolon is filled in by the default path of the GAP 4 home directory).

2.2 Compiling Binaries of the Example Package

After unpacking the archive, go to the newly created example directory and call ./configure to use the default ../.. path to the GAP home directory or ./configure path where path is the path to the GAP home directory, if the package is being installed in a non-default location. So for example if you install the package in the ~/.gap/pkg directory and the GAP home directory is ~/gap4r5 then you have to call

./configure ../../../gap4r5/

This will fetch the architecture type for which GAP has been compiled last and create a Makefile. Now simply call

make

to compile the binary and to install it in the appropriate place.

2.3 Loading the Example Package

To use the Example Package you have to request it explicitly. This is done by calling LoadPackage (Reference: LoadPackage):

gap> LoadPackage("example");
----------------------------------------------------------------
Loading  Example 4.3.3 (Example/Template of a GAP Package)
by Werner Nickel (http://www.mathematik.tu-darmstadt.de/~nickel),
   Greg Gamble (http://www.math.rwth-aachen.de/~Greg.Gamble), and
   Olexandr Konovalov (https://alex-konovalov.github.io/).
maintained by:
   Greg Gamble (http://www.math.rwth-aachen.de/~Greg.Gamble) and
   Olexandr Konovalov (https://alex-konovalov.github.io/).
Homepage: https://gap-packages.github.io/example
Report issues at https://github.com/gap-packages/example/issues
----------------------------------------------------------------
true

If GAP cannot find a working binary, the call to LoadPackage will still succeed but a warning is issued informing that the HelloWorld() function will be unavailable.

If you want to load the Example package by default, you can put the LoadPackage command into your gaprc file (see Section Reference: The gap.ini and gaprc files).

 [Top of Book]  [Contents]   [Previous Chapter]   [Next Chapter] 
Goto Chapter: Top 1 2 Ind

generated by GAPDoc2HTML