-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgpbuild-release.sh
executable file
·62 lines (48 loc) · 1.83 KB
/
gpbuild-release.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
#!/usr/bin/env bash
gpsrc=$HOME/gpdb
echo 'We are going to build gpdb from the source code under '$gpsrc','
echo 'If this is not correct, please set the right path for gpsrc in gpbuild.sh'
gpbin=$HOME/penguindb/gpdb-release
while getopts ":d:" opts; do
case $opts in
d) deploy=$OPTARG ;;
?) ;;
esac
done
gpstate=$(gpstate | grep "Master instance")
if [[ $gpstate =~ "Active" ]]
then
echo 'gp is running, try to stop it...'
sleep 5
gpstop -a
fi
#rm -f $gptmp/gpAux/gpdemo/demo_cluster.sh
#rm -rf $gptmp/src
##rm -rf $gptmp/tdsqlcontrib
#rm -f $gptmp/GNUmakefile.in
#cp $gpsrc/gpAux/gpdemo/demo_cluster.sh $gptmp/gpAux/gpdemo/
#cp -r $gpsrc/src $gptmp/
##cp -r $gpsrc/tdsqlcontrib $gptmp/
#cp $gpsrc/GNUmakefile.in $gptmp/GNUmakefile.in
cd $gpsrc
./configure --prefix=$gpbin --with-perl --with-gssapi --with-python --with-libxml --with-includes=/usr/local/include --disable-cassert --disable-orca --disable-pxf --disable-gpfdisk --without-zstd CFLAGS='-O3' CXXFLAGS='-O3'
# echo 'LIBS += -lzstd -llz4 -lsnappy -lpthread -lprotobuf -lrocksdb' >> ./src/Makefile.global
sed -i 's/LIBS = -lbz2 -lxml2 -lrt -lgssapi_krb5 -lz -lreadline -lrt -lcrypt -ldl -lm -lcurl/LIBS = -lbz2 -lxml2 -lrt -lgssapi_krb5 -lz -lreadline -lrt -lcrypt -ldl -lm -lcurl -lzstd -llz4 -lsnappy -lpthread -lprotobuf -lrocksdb/g' ./src/Makefile.global
# > ./src/Makefile.global.bk
#mv ./src/Makefile.global.bk ./src/Makefile.global
make -j4
make -j4 install
source $gpbin/greenplum_path.sh
if [ $deploy = "y" -o $deploy = "Y" ]
then
echo 'Deploying demo cluster...'
sleep 5
make destroy-demo-cluster
make create-demo-cluster
source $gpbin/greenplum_path.sh
source $gpsrc/gpAux/gpdemo/gpdemo-env.sh
echo 'Demo cluster has been deployed and started.'
else
echo 'gpdb has been built and installed, you may want to start it with: gpstart'
fi
exit 0