CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

| Download

GAP 4.8.9 installation with standard packages -- copy to your CoCalc project to get it

Path: gap4r8 / bin / xgap.sh
Views: 418346
1
#!/bin/sh
2
#############################################################################
3
##
4
#A xgap XGAP source Frank Celler
5
##
6
##
7
#Y Copyright (C) 1998, Lehrstuhl D fuer Mathematik, RWTH, Aachen, Germany
8
##
9
10
11
#############################################################################
12
##
13
## xgap.sh GAP Max Neunhoeffer
14
##
15
## This is a shell script for the UNIX operating system that starts XGAP.
16
## This is the place where you make all the necessary customizations.
17
## Then copy this file to a directory in your search path, e.g., '~/bin'.
18
## If you later move GAP to another location you must only change this file.
19
##
20
21
#############################################################################
22
##
23
## GAP_DIR . . . . . . . . . . . . . . . . . . . . directory where GAP lives
24
##
25
## Set 'GAP_DIR' to the name of the directory where you have installed GAP,
26
## i.e., the directory with the subdirectories 'lib', 'grp', 'doc', etc.
27
## The default is '/home/user/gap4r8', which is the root directory if you install
28
## XGAP in the default `pkg' directory.
29
## If you install XGAP in a private directory you have to change this.
30
##
31
if [ "x$GAP_DIR" = "x" ]; then
32
GAP_DIR="/home/user/gap4r8"
33
fi
34
35
36
#############################################################################
37
##
38
## GAP_PRG . . . . . . . . . . . . . . . . . name of the executable program
39
##
40
## Set 'GAP_PRG' to the name of the executable program of the GAP kernel.
41
## The default is '`hostname'/gap'. You can either change this to
42
## '<target>/gap' where <target> is the target you have selected during the
43
## compilation or create a symbolic link from <target> to '`hostname`' in
44
## the 'bin' directory.
45
##
46
if [ "x$GAP_PRG" = "x" ]; then
47
GAP_PRG=x86_64-pc-linux-gnu-gcc-default64/gap
48
fi
49
50
51
#############################################################################
52
##
53
## XGAP_PRG . . . . . . . . . . . . . . . . . name of the executable program
54
##
55
## Set 'XGAP_PRG' to the name of the executable program of the XGAP kernel.
56
## The default is '`hostname'/gap'. You can either change this to
57
## '<target>/gap' where <target> is the target you have selected during the
58
## compilation or create a symbolic link from <target> to '`hostname`' in
59
## the 'bin' directory.
60
##
61
if [ "x$XGAP_PRG" = "x" ]; then
62
XGAP_PRG=x86_64-unknown-linux-gnu-gcc/xgap
63
fi
64
65
66
#############################################################################
67
##
68
## DAEMON . . . . . . . . . . . . . . flag, whether xgap goes to background
69
##
70
## Set 'DAEMON' to "NO" if you don't want the usual behaviour, that xgap
71
## goes to the background directly after starting up.
72
##
73
DAEMON="YES"
74
75
#############################################################################
76
##
77
## VERBOSE . . . . . . . . . . . . . . flag, whether lots of messages appear
78
##
79
## Set 'VERBOSE' to "YES", if you want exact information about the options
80
## with which the xgap executable is executed. Mainly used for debugging
81
## purposes.
82
##
83
VERBOSE="NO"
84
85
86
#############################################################################
87
##
88
## STOP EDITING HERE !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
89
##
90
## Unless you know what you are doing! This should not be necessary if you
91
## installed GAP and XGAP in the standard way as a share package within the
92
## GAP directory.
93
## If you really want to edit the variables below, insert additional
94
## definitions above, they will *not* be overwritten!
95
##
96
#############################################################################
97
98
#############################################################################
99
##
100
#F options . . . . . . . . . . . . . . . . . parse the command line options
101
##
102
## GAP accepts the following options:
103
##
104
## -b toggle banner supression
105
## -q toggle quiet mode
106
## -e toggle quitting on <ctr>-D
107
## -f force line editing
108
## -n disable line editing
109
## -x <num> set line width
110
## -y <num> set number of lines
111
##
112
## -g toggle GASMAN messages
113
## -m <mem> set the initial workspace size
114
## -o <mem> set the maximal workspace size
115
## -c <mem> set the cache size value
116
## -a <mem> set amount to pre-malloc-ate
117
## postfix 'k' = *1024, 'm' = *1024*1024
118
## -l <paths> set the GAP root paths
119
## -r toggle reading of the '.gaprc' file
120
## -D toggle debuging the loading of library files
121
## -B <name> current architecture
122
## -M toggle loading of compiled modules
123
## -N toggle check for completion files
124
## -X toggle CRC for comp. files while reading
125
## -Y toggle CRC for comp. files while completing
126
## -i <file> change the name of the init file
127
##
128
## -L <file> restore a saved workspace
129
##
130
##
131
## XGAP accepts the following options:
132
##
133
## -display <dis>, --display <dis>
134
## set the display
135
##
136
## -geometry <geo>, --geometry <geo>
137
## set the geometry
138
##
139
## -normal <font>, --normal <font>
140
## set the normal font
141
##
142
## -huge <font>, --huge <font>
143
## set the huge font
144
##
145
## -large <font>, --large <font>
146
## set the large font
147
##
148
## -small <font>, --small <font>
149
## set the small font
150
##
151
## -tiny <font>, --tiny <font>
152
## set the tiny font
153
##
154
##
155
## XGAP accepts the following debug options:
156
##
157
## --debug <num>
158
## enter debug mode (XGAP must be compiled with DEBUG_ON)
159
##
160
## -G <exec>, --gap-exec <exec>, --gap-prg <exec>
161
## use another GAP executable
162
##
163
## -X <exec>, --xgap-exec <exec>, --xgap-prg <exec>
164
## use another XGAP executable
165
##
166
##
167
## this scripts accepts the following debug options:
168
##
169
## -V, --verbose
170
## be verbose
171
##
172
## --stay
173
## don't put XGAP into the backgroup
174
##
175
176
## we parse all options:
177
178
XP=""
179
GP=""
180
181
while [ $# -gt 0 ]; do
182
case $1 in
183
184
# GAP options
185
-b|-q|-e|-f|-n|-g|-r|-D|-M|-N|-X|-Y) GP="$GP $1" ;;
186
-x|-y|-o|-c|-a|-B|-i|-L) GP="$GP $1 $2"; shift ;;
187
-l|--gap-lib) GAP_DIR="$2"; shift ;;
188
189
# XGAP options
190
-display|--display) XP="$XP -display $2"; shift ;;
191
-geometry|--geometry) XP="$XP -geometry $2"; shift ;;
192
-huge|--huge*) XP="$XP -huge $2"; shift ;;
193
-large|--large*) XP="$XP -large $2"; shift ;;
194
-normal|--normal*) XP="$XP -normal $2"; shift ;;
195
-small|--small*) XP="$XP -small $2"; shift ;;
196
-tiny|--tiny*) XP="$XP -tiny $2"; shift ;;
197
198
# DEBUG options
199
--debug) XP="$XP -D $2"; shift ;;
200
-G|--gap-exec|--gap-prg) GAP_PRG="$2"; shift ;;
201
-X|--xgap-exec|--xgap-prg) XGAP_PRG="$2"; shift ;;
202
203
# script options
204
-V|--verbose) VERBOSE="YES" ;;
205
--stay) DAEMON="NO" ;;
206
207
# everything else is passed to GAP:
208
*) GP="$GP $1" ;;
209
210
esac
211
shift
212
done
213
214
215
#############################################################################
216
##
217
#V DISPLAY . . . . . . . . . . . . . . . . . . display variable must be set
218
##
219
if [ "x$DISPLAY" = "x" ]; then
220
echo 'sorry: xgap is a program running under the X Window System, so'
221
echo 'you need a graphics display.'
222
echo 'you must either set $DISPLAY or use "-display HOST:0.0"'
223
echo 'where you replace HOST by the name of your machine.'
224
exit 1;
225
fi;
226
227
228
#############################################################################
229
##
230
##
231
XGAP=/home/user/gap4r8/pkg/xgap-4.26/bin/$XGAP_PRG
232
GAP=$GAP_DIR/bin/$GAP_PRG
233
234
#############################################################################
235
##
236
#F verbose . . . . . . . . . . . . . . . . . . . . . print some information
237
##
238
if [ $VERBOSE = "YES" ]; then
239
echo
240
echo "XGAP executable: $XGAP"
241
echo "GAP path: $GAP_DIR"
242
echo "GAP executable: $GAP"
243
echo "GAP library arg: $LIBARG"
244
echo "Display: $DISPLAY"
245
echo "XGAP parameters: $XP"
246
echo "GAP parameters: $GP"
247
echo
248
fi
249
250
251
#############################################################################
252
##
253
#F XGAP . . . . . . . . . . . . . . . . . . . . . . . . . . . . start XGAP
254
##
255
256
export TERM=dumb
257
258
if [ $DAEMON = "YES" ]; then
259
$XGAP -G $GAP $XP -- -l "$GAP_DIR" $GP &
260
else
261
$XGAP -G $GAP $XP -- -l "$GAP_DIR" $GP
262
fi
263
264
exit 0
265
266