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

Views: 418346
1
#!/usr/bin/env bash
2
3
set -e
4
5
# This script attempts to build all GAP packages contained in the current
6
# directory. Normally, you should run this script from the 'pkg'
7
# subdirectory of your GAP installation.
8
9
# You can also run it from other locations, but then you need to tell the
10
# script where your GAP root directory is, by passing it as first argument
11
# to the script. By default, the script assumes that the parent of the
12
# current working directory is the GAP root directory.
13
14
# You need at least 'gzip', GNU 'tar', a C compiler, sed, pdftex to run this.
15
# Some packages also need a C++ compiler.
16
17
# Contact [email protected] for questions and complaints.
18
19
# Note, that this isn't and is not intended to be a sophisticated script.
20
# Even if it doesn't work completely automatically for you, you may get
21
# an idea what to do for a complete installation of GAP.
22
23
24
if [ $# -eq 0 ]
25
then
26
echo "Assuming default GAP location: ../.."
27
GAPDIR=../..
28
else
29
echo "Using GAP location: $1"
30
GAPDIR="$1"
31
fi
32
33
# Is someone trying to run us from inside the 'bin' directory?
34
if [ -f gapicon.bmp ]
35
then
36
echo "This script must be run from inside the pkg directory"
37
echo "Type: cd ../pkg; ../bin/BuildPackages.sh"
38
exit 1
39
fi
40
41
# We need any subdirectory, to test if $GAPDIR is right
42
SUBDIR=`ls -d */ | head -n 1`
43
if ! (cd $SUBDIR && [ -f $GAPDIR/sysinfo.gap ])
44
then
45
echo "$GAPDIR is not the root of a gap installation (no sysinfo.gap)"
46
echo "Please provide the absolute path of your GAP root directory as"
47
echo "first argument to this script."
48
exit 1
49
fi
50
51
if (cd $SUBDIR && grep 'ABI_CFLAGS=-m32' $GAPDIR/Makefile > /dev/null) ; then
52
echo "Building with 32-bit ABI"
53
ABI32=YES
54
CONFIGFLAGS="CFLAGS=-m32 LDFLAGS=-m32 LOPTS=-m32 CXXFLAGS=-m32"
55
fi;
56
57
# Many package require GNU make. So use gmake if available,
58
# for improved compatibility with *BSD systems where "make"
59
# is BSD make, not GNU make.
60
if ! [ x`which gmake` = "x" ] ; then
61
MAKE=gmake
62
else
63
MAKE=make
64
fi
65
66
cat <<EOF
67
Attempting to build GAP packages.
68
Note that many GAP packages require extra programs to be installed,
69
and some are quite difficult to build. Please read the documentation for
70
packages which fail to build correctly, and only worry about packages
71
you require!
72
EOF
73
74
build_carat() {
75
(
76
# TODO: FIX Carat
77
# Installation of Carat produces a lot of data, maybe you want to leave
78
# this out until a user complains.
79
# It is not possible to move around compiled binaries because these have the
80
# path to some data files burned in.
81
zcat carat-2.1b1.tgz | tar pxf -
82
ln -s carat-2.1b1/bin bin
83
cd carat-2.1b1
84
make TOPDIR=`pwd`
85
chmod -R a+rX .
86
cd bin
87
aa=`./config.guess`
88
for x in "`ls -d1 $GAPDIR/bin/${aa}*`"; do
89
ln -s "$aa" "`basename $x`"
90
done
91
)
92
}
93
94
build_cohomolo() {
95
(
96
./configure $GAPDIR
97
cd standalone/progs.d
98
cp makefile.orig makefile
99
cd ../..
100
$MAKE
101
)
102
}
103
104
build_fail() {
105
echo "= Failed to build $dir"
106
}
107
108
run_configure_and_make() {
109
# We want to know if this is an autoconf configure script
110
# or not, without actually executing it!
111
if [ -f autogen.sh ] && ! [ -f configure ] ; then
112
./autogen.sh
113
fi;
114
if [ -f configure ]; then
115
if grep Autoconf ./configure > /dev/null; then
116
./configure $CONFIGFLAGS --with-gaproot=$GAPDIR
117
else
118
./configure $GAPDIR
119
fi;
120
$MAKE
121
else
122
echo "No building required for $dir"
123
fi;
124
}
125
126
for dir in `ls -d */`
127
do
128
if [ -e $dir/PackageInfo.g ]; then
129
dir="${dir%/}"
130
echo "==== Checking $dir"
131
( # start subshell
132
set -e
133
cd $dir
134
case $dir in
135
atlasrep*)
136
chmod 1777 datagens dataword
137
;;
138
139
carat*)
140
build_carat
141
;;
142
143
cohomolo*)
144
build_cohomolo
145
;;
146
147
fplsa*)
148
./configure $GAPDIR &&
149
$MAKE CC="gcc -O2 "
150
;;
151
152
kbmag*)
153
./configure $GAPDIR &&
154
$MAKE COPTS="-O2 -g"
155
;;
156
157
NormalizInterface*)
158
./build-normaliz.sh $GAPDIR &&
159
run_configure_and_make
160
;;
161
162
pargap*)
163
./configure $GAPDIR &&
164
$MAKE &&
165
cp bin/pargap.sh $GAPDIR/bin &&
166
rm -f ALLPKG
167
;;
168
169
xgap*)
170
./configure &&
171
$MAKE &&
172
rm -f $GAPDIR/bin/xgap.sh &&
173
cp bin/xgap.sh $GAPDIR/bin
174
;;
175
176
simpcomp*)
177
;;
178
179
*)
180
run_configure_and_make
181
;;
182
esac;
183
) || build_fail
184
# end subshell
185
else
186
echo "$dir is not a GAP package -- no PackageInfo.g"
187
fi;
188
done;
189
190