forked from openmit/openmit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·44 lines (35 loc) · 1.01 KB
/
build.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
#!/bin/bash -x
cd $(dirname `ls -l $0 | awk '{print $NF;}'`)
wk_dir=`pwd`
set -o pipefail
set -o errexit
is_all_build=0
if [ $# > 1 ]; then
is_all_build=$1
fi
GCC=`which gcc`
GXX=`which g++`
# env conf
source $wk_dir/make/config.mk
export JAVA_HOME=$JAVA_HOME
export LD_LIBRARY_PATH=$JAVA_HOME/jre/lib/amd64/server:$LD_LIBRARY_PATH
export HADOOP_HOME=$HADOOP_HOME
export HADOOP_HDFS_HOME=$HADOOP_HOME
export LD_LIBRARY_PATH=$HADOOP_HOME/lib/native:$LD_LIBRARY_PATH
export LIBRARY_PATH=$HADOOP_HOME/lib/native:$LIBRARY_PATH
export HDFS_INC_PATH=${HADOOP_HOME}/include
export HDFS_LIB_PATH=${HADOOP_HOME}/lib/native
# step1: compile protobuf
#sh ${wk_dir}/message/compile-pb.sh $wk_dir/test
# step2: build openmit by cmake
if [ "X$is_all_build" == "X1" ] || [ ! -d $wk_dir/build ]; then
echo "all build ..."
rm -rf $wk_dir/build || true
mkdir -p $wk_dir/build
cd $wk_dir/build
cmake -D CMAKE_C_COMPILER=${GCC} -D CMAKE_CXX_COMPILER=${GXX} $wk_dir
else
cd $wk_dir/build
fi
make
echo "======== $0 done ========="