/
ci-prepare.sh
executable file
·107 lines (83 loc) · 2.54 KB
/
ci-prepare.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
#!/usr/bin/env bash
set -ex
SRCDIR=${SRCDIR:-$PWD}
# print some data useful for debugging issues with the build
gcov --version
printenv | sort
git show --pretty=fuller -s
# prepare the build system
cd $SRCDIR
./autogen.sh
# change into BUILDDIR (creating it if necessary), and turn it into an absolute path
if [[ -n "$BUILDDIR" ]]
then
mkdir -p "$BUILDDIR"
cd "$BUILDDIR"
fi
BUILDDIR=$PWD
if [[ $HPCGAP = yes ]]
then
CONFIGFLAGS="--enable-hpcgap $CONFIGFLAGS"
fi
if [[ $JULIA = yes ]]
then
pushd extern
wget https://julialang-s3.julialang.org/bin/linux/x64/1.4/julia-1.4.2-linux-x86_64.tar.gz
tar xvf julia-*.tar.gz
rm julia-*.tar.gz
cd julia-*
JULIA_PATH=$(pwd)
popd
CONFIGFLAGS="--with-gc=julia --with-julia=${JULIA_PATH}/bin/julia $CONFIGFLAGS"
fi
# configure and make GAP
time "$SRCDIR/configure" --enable-Werror $CONFIGFLAGS
time make V=1 -j4
# Use alternative downloader which retries on failure and uses the Travis cache
DOWNLOAD="$SRCDIR/dev/ci-download.sh"
# if requested, bootstrap with minimal set of packages
if [[ $BOOTSTRAP_MINIMAL = yes ]]
then
make bootstrap-pkg-minimal DOWNLOAD="$DOWNLOAD"
else
make bootstrap-pkg-full DOWNLOAD="$DOWNLOAD"
fi
# check that GAP is at least able to start
echo 'Print("GAP started successfully\n");QUIT_GAP(0);' | ./gap -T
# packages must be placed inside SRCDIR, as only that
# is a GAP root, while BUILDDIR is not.
if [[ ! -d "$SRCDIR/pkg" ]]
then
mv pkg "$SRCDIR/"
fi
echo "ls $SRCDIR/pkg"
ls $SRCDIR/pkg
# compile IO and profiling package, unless NO_COVERAGE is given
if [[ -z ${NO_COVERAGE} ]]
then
# TODO: get rid of this hack (packages should set 32bit flags themselves)
if [[ $ABI == 32 ]]
then
CONFIGFLAGS="CFLAGS=-m32 LDFLAGS=-m32 LOPTS=-m32 CXXFLAGS=-m32"
fi
# We need to compile the profiling package in order to generate coverage
# reports; and also the IO package, as the profiling package depends on it.
pushd "$SRCDIR/pkg"
rm -rf io*
time git clone https://github.com/gap-packages/io
rm -rf profiling*
time git clone https://github.com/gap-packages/profiling
# Compile io and profiling packages
# we deliberately reset CFLAGS, CXXFLAGS, LDFLAGS to prevent them from being
# compiled with coverage gathering, because otherwise gcov may confuse
# IO's src/io.c with GAP's.
CFLAGS= CXXFLAGS= LDFLAGS= "$SRCDIR/bin/BuildPackages.sh" --strict --with-gaproot="$BUILDDIR" io* profiling*
#
# Factint is incompatible with HPCGAP and interferes with some tests
#
if [[ $HPCGAP = yes ]]
then
rm -rf $SRCDIR/pkg/FactInt*
fi
popd
fi