-
Notifications
You must be signed in to change notification settings - Fork 5
/
build_madlib.sh
55 lines (42 loc) · 1.15 KB
/
build_madlib.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
set -e
TOPDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
INSTALLDIR=$(< INSTALLDIR)
INSTALLDIR="$INSTALLDIR/madlib"
function fail
{
echo
echo "ERROR: " "$@"
echo
exit 1
}
if [ "$GPHOME" == "" ]; then
echo
echo GPHOME env missing
exit 1
fi
if [ "$INSTALLDIR" == "" ]; then
echo
echo 'missing INSTALLDIR ... check ./INSTALLDIR file'
exit 1
fi
echo Installing into $INSTALLDIR
echo Configuring
( cd madlib && mkdir -p build && \
( cat boost_1_61_0.[ab] > boost_1_61_0.tar.gz ) ) 2>&1 > madlib.out \
|| fail untar
( cd madlib && \
./configure \
-DCMAKE_INSTALL_PREFIX=$INSTALLDIR \
-DEIGEN_TAR_SOURCE=$TOPDIR/madlib/eigen.3.2.10.tar.gz \
-DBOOST_TAR_SOURCE=$TOPDIR/madlib/boost_1_61_0.tar.gz \
-DPYXB_TAR_SOURCE=$TOPDIR/madlib/PyXB-1.2.4.tar.gz \
) 2>&1 > madlib.out || fail configure
echo Making
( cd madlib/build && \
make clean && \
(make -j8 || make -j8 || make) && \
make install ) 2>&1 >> madlib.out || fail make
( cd $INSTALLDIR && rm Current && ln -s Versions/1.9.1 Current &&
rm bin && ln -s ./Current/bin &&
rm doc && ln -s ./Current/doc ) 2>&1 >> madlib.out || fail linkup
echo "SUCCESS"