GAP 4.8.9 installation with standard packages -- copy to your CoCalc project to get it
\Chapter{Installing XGAP}12Installing {\XGAP} should be easy once you have installed {\GAP} itself. We3assume here that you want to install {\XGAP} in its standard location,4which is in the ``pkg'' subdirectory of the main {\GAP4} installation.56%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%7\Section{Overview}89You have to perform the following steps to install {\XGAP}:1011\beginlist12\item{--} Get the sources13\item{--} Unpack the sources14\item{--} Use the <configure> script to adjust everything to your specific15system16\item{--} Compile the C part of {\XGAP}17\item{--} Edit a certain startup script (if necessary) and install it in18an executable location in your system19\endlist2021%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%22\Section{What you need to install XGAP}2324Being a graphical user interface to {\GAP}, {\XGAP} of course needs25graphics. At the moment this means that you need the X window system in the26Version 11 Release 5 or newer. On the other hand the type of Unix you use27should not matter. Please file an issue report on28\begintt29https://github.com/gap-packages/xgap/issues30\endtt31if you encounter problems with certain system configurations.32Note that usage on33a computer running Microsoft Windows is not officially supported.34See the file `xgap/README.Windows' for a report how it could35still work on Windows.3637Because {\XGAP} contains a C-part you need a C compiler.3839%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%40\Section{Getting and unpacking the sources}4142In most cases, the {\XGAP} package will already be included in the main43distribution. However, you can also download the sources of the latest44version from4546\begintt47https://gap-packages.github.io/xgap/48\endtt4950You need only one file with the name ``xgap-4.26.tar.gz''51which is in the subdirectory for the packages.52You now change your current directory to the `pkg' subdirectory of the53location where you installed54{\GAP}55Now you extract the sources for the {\XGAP} package:5657\begintt58# tar xzvf xgap-4.26.tar.gz59...60\endtt6162The <tar> utility unpacks the files and stores them into the apropriate63subdirectories. {\XGAP} resides completely in the following subdirectory64(assuming standard location):6566\begintt67gap4r8/pkg/xgap68\endtt6970%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%71\Section{Configuring and Compiling the C part}7273You have to change your current working directory to the ``xgap''74subdirectory. You do this by7576\begintt77# cd xgap78\endtt7980if your current working directory is the one, where you used81<tar>. There you invoke the <configure> script by:8283\begintt84# ./configure85creating cache ./config.cache86checking for make... make87checking build system type... x86_64-unknown-linux-gnu88checking host system type... x86_64-unknown-linux-gnu89checking target system type... x86_64-unknown-linux-gnu90checking for gcc... gcc91checking whether the C compiler (gcc ) works... yes92checking whether the C compiler (gcc ) is a cross-compiler... no93checking whether we are using GNU C... yes94...95updating cache ./config.cache96creating ./config.status97creating Makefile98creating xgap.sh99\endtt100101$\ldots$ indicate omissions.102This script tries to determine, which kind of operating system and103libraries you have installed and configures the source104accordingly. Normally this should produce some output but no error105messages.106107Note that you can add ``CONFIGNAME=default64'' after the <./configure>108command (with ``default64'' replaced by a configuration name you used109to compile {\GAP} with) to compile for a different than the standard110configuration.111112The last step of the script produces some makefiles which are113used to compile the code. You do this by typing114115\begintt116# make117mkdir -p bin/x86_64-unknown-linux-gnu-gcc118cp cnf/configure.out bin/x86_64-unknown-linux-gnu-gcc/configure119( cd bin/x86_64-unknown-linux-gnu-gcc ; CC=gcc ./configure )120checking for gcc... gcc121checking whether the C compiler works... yes122...123creating ./config.status124creating Makefile125creating config.h126( cd bin/x86_64-unknown-linux-gnu-gcc ; make CC=gcc )127make[1]: Entering directory128`/scratch/neunhoef/4.0/pkg/xgap/bin/x86_64-unknown-linux-gnu-gcc'129gcc -I. -g -O2 -o xcmds.o -c ../../src.x11/xcmds.c130...131make[1]: Leaving directory \ # line broken for this manual!132`/usr/local/lib/gap4/pkg/xgap/bin/i686-unknown-linux2.0.34-gcc'133\endtt134135(a few lines were broken for typesetting purposes in this manual, the136position is marked by a backslash)137138Now all C sources are compiled and a binary executable is built. It is139stored in a subdirectory of the ``bin'' subdirectory in your ``xgap''140directory. The name of this location has something to do with your141installation. It could for example be142143\begintt144bin/x86_64-unknown-linux-gnu-gcc/xgap145\endtt146147if you compile on a 64-bit Linux system using the GNU-C-Compiler.148149%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%150\Section{Installing the Startup Script}151152To make the startup of {\XGAP} more convenient there is a startup script153which contains also some configuration information like the position of154your {\GAP} installation. It is in the ``xgap'' directory155and is called ``xgap.sh''. This file is automatically generated156by the `configure' script and normally you should *not* have to change157anything in it. Just copy it to some location that people have in their158``PATH'' environment variable, for example to ``/usr/local/bin''.159This completes the installation.160161If you want to change anything in the installation, you162can also edit the script until the line163164\begintt165## STOP EDITING HERE !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!166\endtt167168You can specify the directory where {\GAP} is installed (``GAP\_DIR''),169the amount of memory that {\GAP} should use as initial workspace170(``GAP\_MEM''), the name of the {\GAP}-executable (``GAP\_PRG'') and the171name of the {\XGAP}-executable (``XGAP\_PRG''). The first three are exactly172the same things that you could edit in the main {\GAP} startup script.173After that you have the possibility to control the behaviour of the {\XGAP}174startup script. You can specify whether {\XGAP} goes into the background175(``DAEMON'') and whether it prints out information about its parameters176(``VERBOSE''). Note that it is possible to combine ``DAEMON=YES''177and ``VERBOSE=YES'' because the script actually runs in the foreground and178only the C program is put into the background.179180181%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%182\Section{Installing in a different than the standard location}183184It could happen that you do not want to install {\XGAP} in its185standard location, perhaps because you do not want to bother your186system administrator and have no access to the {\GAP} directory. In187this case you can unpack {\XGAP} in any other location within a188``pkg'' directory with the <tar> command as described above. Let us189call this directory ``pkg'' for the moment. You get an ``xgap''190subdirectory with all the files of {\XGAP} in it. You follow the191standard procedure with one exception:192193In the ``./configure'' command, add the following option:194195\begintt196./configure --with-gaproot=/usr/local/lib/gap4r8197\endtt198199if `/usr/local/lib/gap4r8' is the location of the main {\GAP} installation.200You can find out where the main {\GAP4} installation is by starting201{\GAP} as usual and looking at the variable `GAPInfo.RootPaths'202within {\GAP}.203204205