-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathbuildimpala.sh
More file actions
executable file
·143 lines (120 loc) · 3.65 KB
/
buildimpala.sh
File metadata and controls
executable file
·143 lines (120 loc) · 3.65 KB
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
#!/usr/bin/env bash
# Copyright 2014 GISTIC.
INSTALL_PACKAGES=1
CLEAN_ACTION=1
TEST_ACTION=1
BUILD_THIRDPARTY=1
FORMAT_METASTORE=0
BUILD_IMPALA_ARGS=""
ROOT=`dirname "$0"`
ROOT=`cd "$ROOT"; pwd`
export IMPALA_HOME=$ROOT
# Exit on reference to uninitialized variable
set -u
# Exit on non-zero return value
set -e
# Always run in debug mode
set -x
# parse command line options
for ARG in $*
do
case "$ARG" in
-noclean)
CLEAN_ACTION=0
BUILD_IMPALA_ARGS="${BUILD_IMPALA_ARGS} -noclean"
;;
-notests)
TESTS_ACTION=0
BUILD_IMPALA_ARGS="${BUILD_IMPALA_ARGS} -notests"
;;
-format_metastore)
FORMAT_METASTORE=1
BUILD_IMPALA_ARGS="${BUILD_IMPALA_ARGS} -format_metastore"
;;
-nopackages)
INSTALL_PACKAGES=0
;;
-nothirdparty)
BUILD_THIRDPARTY=0
;;
-help|*)
echo "buildimpala.sh - Setups the environment for Impala, builds Impala and runs all tests."
echo "[-noclean] : Omits cleaning all packages before building. Will not kill"\
"running Hadoop service."
echo "[-notests] : Skips building and execution of all tests"
echo "[-format_metastore] : Formats the hive metastore and recreates it"
echo "[-nopackages] : Skips installing needed packages for impala,"\
" used if they're already installed"
echo "[-nothirdparty] : Skips building thirdparty libraries"
echo "-----------------------------------------------------------------------------
Examples of common tasks:
# Setup environment, build and run all tests
./buildimpala.sh
# Setup environment, build and doens't run tests
./buildall.sh -notests
# Build with no cleaning and doens't run tests
# -noclean is useless if -nothirdparty isn't provided
./buildall.sh -nopackages -noclean -nothirdparty -notests"
exit 1
;;
esac
done
if [ $INSTALL_PACKAGES -eq 1 ]
then
echo "Installing packages needed for impala"
apt-get install \
build-essential automake libtool flex bison \
git subversion \
unzip \
libboost-test-dev libboost-program-options-dev libboost-filesystem-dev libboost-system-dev \
libboost-regex-dev libboost-thread-dev \
protobuf-compiler \
libsasl2-dev \
libbz2-dev \
libevent1-dev \
pkg-config \
doxygen \
python-setuptools \
libssl-dev \
python-dev
echo "Installing cmake."
apt-get install cmake
echo "Installing/Updating protobuf."
add-apt-repository ppa:chris-lea/protobuf
apt-get update
apt-get install libprotoc-dev protobuf-compiler libprotoc7
echo "Installing and building LLVM-COMPILER."
wget http://llvm.org/releases/3.3/llvm-3.3.src.tar.gz
tar xvzf llvm-3.3.src.tar.gz
cd llvm-3.3.src/tools
svn co http://llvm.org/svn/llvm-project/cfe/tags/RELEASE_33/final/ clang
cd ../projects
svn co http://llvm.org/svn/llvm-project/compiler-rt/tags/RELEASE_33/final/ compiler-rt
cd ..
mkdir ~/contrib
./configure --with-pic --prefix=$HOME/contrib/
make -j4 REQUIRES_RTTI=1
make install
cd ..
echo "Installing and configuring Java 7."
add-apt-repository ppa:webupd8team/java
apt-get update
apt-get install oracle-java7-installer
echo "Installing and configuring Maven."
apt-get install maven
echo "Installing postgreSQL."
apt-get install postgresql-client
fi
export PATH=$PATH:$HOME/contrib/bin/
export JAVA_HOME=/usr/lib/jvm/java-7-oracle
export M2_HOME=/usr/share/maven
. $IMPALA_HOME/bin/impala-config.sh
if [ $BUILD_THIRDPARTY -eq 1 ]
then
echo "Building third-party libraries ..."
$IMPALA_HOME/bin/build_thirdparty.sh
fi
mkdir -p /var/lib/hadoop-hdfs
echo "Building Impala ..."
cd $IMPALA_HOME
./buildall.sh $BUILD_IMPALA_ARGS