Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge 2.9 to master #1320

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
95 changes: 79 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ ifndef CC
CC = gcc
endif

INCPATH += -I./src -I./include -I./src/leveldb/include -I./src/leveldb \
INCPATH += -I./src -I./include -I./src/leveldb/include -I./src/leveldb -I./src/sdk \
-I./src/sdk/java/native-src $(DEPS_INCPATH)
CFLAGS += $(OPT) $(INCPATH) -fPIC -fvisibility=hidden # hide internal symbol of tera
CXXFLAGS += -std=gnu++11 $(CFLAGS)
Expand All @@ -28,28 +28,42 @@ PROTO_OUT_H := $(PROTO_FILES:.proto=.pb.h)
MASTER_SRC := $(wildcard src/master/*.cc)
TABLETNODE_SRC := $(wildcard src/tabletnode/*.cc)
IO_SRC := $(wildcard src/io/*.cc)
SDK_SRC := $(wildcard src/sdk/*.cc)
SDK_SRC := $(wildcard src/sdk/*.cc) $(wildcard src/sdk/test/global_txn_testutils.cc) \
src/observer/rowlocknode/zk_rowlock_client_zk_adapter.cc src/observer/rowlocknode/ins_rowlock_client_zk_adapter.cc
HTTP_SRC := $(wildcard src/sdk/http/*.cc)
PROTO_SRC := $(filter-out %.pb.cc, $(wildcard src/proto/*.cc)) $(PROTO_OUT_CC)
JNI_TERA_SRC := $(wildcard src/sdk/java/native-src/*.cc)
VERSION_SRC := src/version.cc
OTHER_SRC := $(wildcard src/zk/*.cc) $(wildcard src/utils/*.cc) $(VERSION_SRC) \
src/tera_flags.cc
src/tera_flags.cc src/sdk/test/global_txn_testutils.cc
COMMON_SRC := $(wildcard src/common/base/*.cc) $(wildcard src/common/net/*.cc) \
$(wildcard src/common/file/*.cc) $(wildcard src/common/file/recordio/*.cc) \
$(wildcard src/common/console/*.cc)
$(wildcard src/common/console/*.cc) $(wildcard src/common/log/*.cc) \
$(wildcard src/common/metric/*.cc)
SERVER_WRAPPER_SRC := src/tera_main_wrapper.cc
SERVER_SRC := src/tera_main.cc src/tera_entry.cc
CLIENT_SRC := src/teracli_main.cc
TERAUTIL_SRC := src/terautil.cc
GTXN_TEST_SRC := src/sdk/test/global_txn_test_tool.cc
TEST_CLIENT_SRC := src/tera_test_main.cc
TERA_C_SRC := src/tera_c.cc
MONITOR_SRC := src/monitor/teramo_main.cc
MARK_SRC := src/benchmark/mark.cc src/benchmark/mark_main.cc
COMMON_TEST_SRC := $(wildcard src/common/test/*.cc)
TEST_SRC := src/utils/test/prop_tree_test.cc src/utils/test/tprinter_test.cc \
src/io/test/tablet_io_test.cc src/io/test/tablet_scanner_test.cc \
src/io/test/load_test.cc src/master/test/master_test.cc \
src/master/test/master_impl_test.cc src/master/test/trackable_gc_test.cc \
src/common/test/thread_pool_test.cc
src/observer/test/rowlock_test.cc src/observer/test/scanner_test.cc \
src/observer/test/observer_test.cc \
$(wildcard src/sdk/test/*_test.cc) $(COMMON_TEST_SRC)

TIMEORACLE_SRC := $(wildcard src/timeoracle/*.cc) src/tera_entry.cc
TIMEORACLE_BENCH_SRC := src/timeoracle/bench/timeoracle_bench.cc
ROWLOCK_SRC := $(wildcard src/observer/rowlocknode/*.cc) src/sdk/rowlock_client.cc
ROWLOCK_PROXY_SRC := $(wildcard src/observer/rowlockproxy/*.cc)
OBSERVER_SRC := src/observer/executor/scanner_impl.cc src/observer/executor/random_key_selector.cc
OBSERVER_DEMO_SRC := $(wildcard src/observer/observer_demo.cc)

TEST_OUTPUT := test_output
UNITTEST_OUTPUT := $(TEST_OUTPUT)/unittest
Expand All @@ -65,39 +79,53 @@ COMMON_OBJ := $(COMMON_SRC:.cc=.o)
SERVER_WRAPPER_OBJ := $(SERVER_WRAPPER_SRC:.cc=.o)
SERVER_OBJ := $(SERVER_SRC:.cc=.o)
CLIENT_OBJ := $(CLIENT_SRC:.cc=.o)
TERAUTIL_OBJ := $(TERAUTIL_SRC:.cc=.o)
GTXN_TEST_OBJ := $(GTXN_TEST_SRC:.cc=.o)
TEST_CLIENT_OBJ := $(TEST_CLIENT_SRC:.cc=.o)
TERA_C_OBJ := $(TERA_C_SRC:.cc=.o)
MONITOR_OBJ := $(MONITOR_SRC:.cc=.o)
MARK_OBJ := $(MARK_SRC:.cc=.o)
HTTP_OBJ := $(HTTP_SRC:.cc=.o)
COMMON_TEST_OBJ := $(COMMON_TEST_SRC:.cc=.o)
TEST_OBJ := $(TEST_SRC:.cc=.o)
TIMEORACLE_OBJ := $(TIMEORACLE_SRC:.cc=.o)
TIMEORACLE_BENCH_OBJ := $(TIMEORACLE_BENCH_SRC:.cc=.o)
ROWLOCK_OBJ := $(ROWLOCK_SRC:.cc=.o)
ROWLOCK_PROXY_OBJ := $(ROWLOCK_PROXY_SRC:.cc=.o)
OBSERVER_OBJ := $(OBSERVER_SRC:.cc=.o)
OBSERVER_DEMO_OBJ := $(OBSERVER_DEMO_SRC:.cc=.o)
ALL_OBJ := $(MASTER_OBJ) $(TABLETNODE_OBJ) $(IO_OBJ) $(SDK_OBJ) $(PROTO_OBJ) \
$(JNI_TERA_OBJ) $(OTHER_OBJ) $(COMMON_OBJ) $(SERVER_OBJ) $(CLIENT_OBJ) \
$(JNI_TERA_OBJ) $(OTHER_OBJ) $(COMMON_OBJ) $(SERVER_OBJ) $(CLIENT_OBJ) $(TERAUTIL_OBJ) \
$(TEST_CLIENT_OBJ) $(TERA_C_OBJ) $(MONITOR_OBJ) $(MARK_OBJ) \
$(SERVER_WRAPPER_OBJ)
$(SERVER_WRAPPER_OBJ) $(TIMEORACLE_OBJ) $(ROWLOCK_OBJ) $(ROWLOCK_PROXY_OBJ) $(OBSERVER_OBJ) $(OBSERVER_DEMO_OBJ)
LEVELDB_LIB := src/leveldb/libleveldb.a
LEVELDB_UTIL := src/leveldb/util/histogram.o src/leveldb/port/port_posix.o

PROGRAM = tera_main tera_master tabletserver teracli teramo tera_test
PROGRAM = tera_main tera_master tabletserver teracli terautil teramo tera_test timeoracle timeoracle_bench rowlock observer_demo rowlock_proxy
TEST_PROGRAM=gtxn_test_tool

LIBRARY = libtera.a
SOLIBRARY = libtera.so
TERA_C_SO = libtera_c.so
JNILIBRARY = libjni_tera.so
OBSERVER_LIBRARY = libobserver.a
BENCHMARK = tera_bench tera_mark
TESTS = prop_tree_test tprinter_test string_util_test tablet_io_test \
tablet_scanner_test fragment_test progress_bar_test master_test load_test \
thread_pool_test
tablet_scanner_test fragment_test progress_bar_test master_test load_test observer_test \
common_test sdk_test

.PHONY: all clean cleanall test

all: $(PROGRAM) $(LIBRARY) $(SOLIBRARY) $(TERA_C_SO) $(JNILIBRARY) $(BENCHMARK)
all: $(PROGRAM) $(TEST_PROGRAM) $(LIBRARY) $(SOLIBRARY) $(TERA_C_SO) $(JNILIBRARY) $(BENCHMARK) $(OBSERVER_LIBRARY)
mkdir -p build/include build/lib build/bin build/log build/benchmark
cp $(PROGRAM) build/bin
cp $(LIBRARY) $(SOLIBRARY) $(TERA_C_SO) $(JNILIBRARY) build/lib
cp $(LIBRARY) $(SOLIBRARY) $(TERA_C_SO) $(JNILIBRARY) $(OBSERVER_LIBRARY) build/lib
cp src/leveldb/tera_bench .
cp -r benchmark/*.sh benchmark/ycsb4tera/ $(BENCHMARK) build/benchmark
cp -r include build/
cp -r conf build
mkdir -p test/tools
cp $(TEST_PROGRAM) test/tools
echo 'Done'

test: $(TESTS)
Expand All @@ -115,11 +143,12 @@ check: test
clean:
rm -rf $(ALL_OBJ) $(TEST_OBJ) $(PROTO_OUT_CC) $(PROTO_OUT_H) $(TEST_OUTPUT)
$(MAKE) clean -C src/leveldb
rm -rf $(PROGRAM) $(LIBRARY) $(SOLIBRARY) $(TERA_C_SO) $(JNILIBRARY) $(BENCHMARK) $(TESTS) terahttp
rm -rf $(PROGRAM) $(TEST_PROGRAM) $(LIBRARY) $(OBSERVER_LIBRARY) $(SOLIBRARY) $(TERA_C_SO) $(JNILIBRARY) $(BENCHMARK) $(TESTS) terahttp

cleanall:
$(MAKE) clean
rm -rf build
rm -rf test/tools

tera_main: src/tera_main_wrapper.o src/version.o src/tera_flags.o
$(CXX) -o $@ $^ $(LDFLAGS)
Expand All @@ -135,6 +164,13 @@ tabletserver: $(SERVER_OBJ) $(TABLETNODE_OBJ) $(IO_OBJ) $(SDK_OBJ) \
libtera.a: $(SDK_OBJ) $(PROTO_OBJ) $(OTHER_OBJ) $(COMMON_OBJ) $(LEVELDB_UTIL)
$(AR) -rs $@ $^

observer_demo : $(OBSERVER_DEMO_OBJ) $(OBSERVER_LIBRARY) $(LIBRARY)
$(CXX) -o $@ $^ $(LDFLAGS)

libobserver.a: $(OBSERVER_OBJ) $(SDK_OBJ) $(PROTO_OBJ) $(OTHER_OBJ) $(COMMON_OBJ) $(LEVELDB_UTIL) \
$(IO_OBJ) $(SDK_OBJ)
$(AR) -rs $@ $^

libtera.so: $(SDK_OBJ) $(PROTO_OBJ) $(OTHER_OBJ) $(COMMON_OBJ) $(LEVELDB_UTIL)
$(CXX) -o $@ $^ $(SO_LDFLAGS)

Expand All @@ -144,6 +180,12 @@ libtera_c.so: $(TERA_C_OBJ) $(LIBRARY)
teracli: $(CLIENT_OBJ) $(LIBRARY)
$(CXX) -o $@ $^ $(LDFLAGS)

terautil: $(TERAUTIL_OBJ) $(LIBRARY)
$(CXX) -o $@ $^ $(LDFLAGS)

gtxn_test_tool: $(GTXN_TEST_OBJ) $(LIBRARY)
$(CXX) -o $@ $^ $(LDFLAGS)

teramo: $(MONITOR_OBJ) $(LIBRARY)
$(CXX) -o $@ $^ $(LDFLAGS)

Expand All @@ -153,6 +195,18 @@ tera_mark: $(MARK_OBJ) $(LIBRARY) $(LEVELDB_LIB)
tera_test: $(TEST_CLIENT_OBJ) $(LIBRARY)
$(CXX) -o $@ $(TEST_CLIENT_OBJ) $(LIBRARY) $(LDFLAGS)

timeoracle: $(TIMEORACLE_OBJ) $(PROTO_OBJ) $(COMMON_OBJ) $(OTHER_OBJ)
$(CXX) -o $@ $^ $(LDFLAGS)

timeoracle_bench : $(TIMEORACLE_BENCH_OBJ) $(LIBRARY)
$(CXX) -o $@ $^ $(LDFLAGS)

rowlock : $(SERVER_OBJ) $(ROWLOCK_OBJ) $(PROTO_OBJ) $(OTHER_OBJ) $(COMMON_OBJ)
$(CXX) -o $@ $^ $(LDFLAGS)

rowlock_proxy : $(SERVER_OBJ) $(ROWLOCK_PROXY_OBJ) $(PROTO_OBJ) $(OTHER_OBJ) $(COMMON_OBJ) $(OBSERVER_LIBRARY)
$(CXX) -o $@ $^ $(LDFLAGS)

terahttp: $(HTTP_OBJ) $(PROTO_OBJ) $(LIBRARY)
$(CXX) -o $@ $^ $(LDFLAGS)

Expand All @@ -165,7 +219,7 @@ src/leveldb/libleveldb.a: FORCE
tera_bench:

# unit test
thread_pool_test: src/common/test/thread_pool_test.o $(LIBRARY)
common_test: $(COMMON_TEST_OBJ) $(LIBRARY)
$(CXX) -o $@ $^ $(LDFLAGS)

prop_tree_test: src/utils/test/prop_tree_test.o $(LIBRARY)
Expand Down Expand Up @@ -200,6 +254,15 @@ master_test: src/master/test/master_test.o src/master/test/master_impl_test.o \
$(PROTO_OBJ) $(OTHER_OBJ) $(COMMON_OBJ) $(LEVELDB_LIB)
$(CXX) -o $@ $^ $(LDFLAGS)

sdk_test: src/sdk/test/global_txn_internal_test.o src/sdk/test/global_txn_test.o \
src/sdk/test/filter_utils_test.o src/sdk/test/scan_impl_test.o \
src/sdk/test/sdk_timeout_manager_test.o src/sdk/test/sdk_test.o $(SDK_OBJ) \
$(PROTO_OBJ) $(OTHER_OBJ) $(COMMON_OBJ) $(LEVELDB_LIB)
$(CXX) -o $@ $^ $(LDFLAGS)

observer_test: src/observer/test/rowlock_test.o src/observer/test/scanner_test.o src/observer/test/observer_test.o src/observer/observer_demo/demo_observer.o $(PROTO_OBJ) $(COMMON_OBJ) $(OTHER_OBJ) $(OBSERVER_OBJ) $(LIBRARY)
$(CXX) -o $@ $^ $(LDFLAGS)

$(ALL_OBJ): %.o: %.cc $(PROTO_OUT_H)
$(CXX) $(CXXFLAGS) -c $< -o $@

Expand All @@ -222,8 +285,8 @@ proto: $(PROTO_OUT_CC) $(PROTO_OUT_H)

# install output into system directories
.PHONY: install
install: $(PROGRAM) $(LIBRARY) $(SOLIBRARY) $(TERA_C_SO) $(JNILIBRARY)
install: $(PROGRAM) $(LIBRARY) $(SOLIBRARY) $(TERA_C_SO) $(JNILIBRARY)
mkdir -p $(INSTALL_PREFIX)/bin $(INSTALL_PREFIX)/include $(INSTALL_PREFIX)/lib
cp -rf $(PROGRAM) $(INSTALL_PREFIX)/bin
cp -rf include/* $(INSTALL_PREFIX)/include
cp -rf $(LIBRARY) $(SOLIBRARY) $(TERA_C_SO) $(JNILIBRARY) $(INSTALL_PREFIX)/lib
cp -rf $(LIBRARY) $(SOLIBRARY) $(TERA_C_SO) $(JNILIBRARY) $(INSTALL_PREFIX)/lib
23 changes: 14 additions & 9 deletions benchmark/run_test.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/bin/bash

if [[ $# != 7 || $6 -lt 0 || $6 -gt 100 ]]; then
echo "$0 DIST[zipfian, uniform, latest] ROW_NUM OP_NUM VALUE_SIZE COLUMN_NUM UPDATE_PROPORTION[0~100] TABLE_NAME"
exit 0
if [[ $# != 9 || $6 -lt 0 || $6 -gt 100 ]]; then
echo "$0 DIST[zipfian, uniform, latest] ROW_NUM OP_NUM VALUE_SIZE COLUMN_NUM UPDATE_PROPORTION[0~100] OP_SPEED THREAD_NUM TABLE_NAME"
exit 1
fi

DIST=$1
Expand All @@ -11,11 +11,12 @@ OP_NUM=$3
VALUE_SIZE=$4
COLUMN_NUM=$5
UPDATE_PROPORTION=$6
TABLE_NAME=$7
OP_SPEED=$7
THREAD_NUM=$8
TABLE_NAME=$9

UPDATE_PROPORTION=`printf "%02d" $6`
READ_PROPORTION=`expr 100 - $UPDATE_PROPORTION`
READ_PROPORTION=`printf "%02d" $READ_PROPORTION`
UPDATE_PROPORTION=`echo $6 | awk '{printf("%.2f",$1/100)}'`
READ_PROPORTION=`echo $6 | awk '{printf("%.2f",(100-$1)/100)}'`

echo "$UPDATE_PROPORTION"
echo "$READ_PROPORTION"
Expand All @@ -30,8 +31,12 @@ bin/ycsb run tera -p workload=com.yahoo.ycsb.workloads.CoreWorkload \
-p operationcount=$OP_NUM \
-p fieldlength=$VALUE_SIZE \
-p fieldcount=$COLUMN_NUM \
-p updateproportion=0.$UPDATE_PROPORTION \
-p readproportion=0.$READ_PROPORTION \
-p updateproportion=$UPDATE_PROPORTION \
-p readproportion=$READ_PROPORTION \
-p target=$OP_SPEED \
-p thread=$THREAD_NUM \
-p exportfile=ycsb.out \
| ./tera_mark --mode=m --tablename=$TABLE_NAME --type=async --verify=false

exit $?

7 changes: 7 additions & 0 deletions benchmark/ycsb4tera.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@

更新(写入)占所有操作的比例
updateproportion: what proportion of operations should be updates (default: 0.05)

每秒总共操作的次数
target: target ops/sec all threads (default: unthrottled)

客户端线程数
thread: number of client threads (default: 1)

```
以下参数对于tera的测试意义不大,使用默认值即可:

Expand Down
16 changes: 3 additions & 13 deletions build.conf.template
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ LIBUNWIND_VERSION=0.99
GPERFTOOLS_VERSION=2.5
INS_VERSION=0.17
NOSE_VERSION=1.3.7
MONGOOSE_VERSION=6.8

if [ $MIRROR == "china" ]; then
BOOST_URL=http://mirrors.tuna.tsinghua.edu.cn/macports/distfiles/boost/boost_${BOOST_VERSION}.tar.bz2
Expand All @@ -32,6 +33,7 @@ if [ $MIRROR == "china" ]; then
GPERFTOOLS_URL=https://github.com/00k/gperftools/raw/master/gperftools-${GPERFTOOLS_VERSION}.tar.gz
INS_URL=https://github.com/baidu/ins/archive/${INS_VERSION}.tar.gz
NOSE_URL=http://mirrors.163.com/gentoo/distfiles/nose-${NOSE_VERSION}.tar.gz
MONGOOSE_URL=https://github.com/cesanta/mongoose/archive/${MONGOOSE_VERSION}.tar.gz
elif [ $MIRROR == "origin" ]; then
BOOST_URL=http://downloads.sourceforge.net/project/boost/boost/1.58.0/boost_${BOOST_VERSION}.tar.bz2
PROTOBUF_URL=https://github.com/google/protobuf/releases/download/v${PROTOBUF_VERSION}/protobuf-${PROTOBUF_VERSION}.tar.bz2
Expand All @@ -45,19 +47,7 @@ elif [ $MIRROR == "origin" ]; then
GPERFTOOLS_URL=https://github.com/gperftools/gperftools/releases/download/gperftools-${GPERFTOOLS_VERSION}/gperftools-${GPERFTOOLS_VERSION}.tar.gz
INS_URL=https://github.com/baidu/ins/archive/${INS_VERSION}.tar.gz
NOSE_URL=https://pypi.python.org/packages/58/a5/0dc93c3ec33f4e281849523a5a913fa1eea9a3068acfa754d44d88107a44/nose-${NOSE_VERSION}.tar.gz
elif [ $MIRROR == "baidu" ]; then
BOOST_URL=http://gitlab.baidu.com/baidups/third/raw/master/boost_${BOOST_VERSION}.tar.bz2
PROTOBUF_URL=http://gitlab.baidu.com/baidups/third/raw/master/protobuf-${PROTOBUF_VERSION}.tar.bz2
SNAPPY_URL=http://gitlab.baidu.com/baidups/third/raw/master/snappy-${SNAPPY_VERSION}.tar.gz
SOFA_PBRPC_URL=http://gitlab.baidu.com/baidups/third/raw/master/sofa-pbrpc-${SOFA_PBRPC_VERSION}.tar.gz
ZOOKEEPER_URL=http://gitlab.baidu.com/baidups/third/raw/master/zookeeper-${ZOOKEEPER_VERSION}.tar.gz
GFLAGS_URL=http://gitlab.baidu.com/baidups/third/raw/master/gflags-${GFLAGS_VERSION}.tar.gz
GLOG_URL=http://gitlab.baidu.com/baidups/third/raw/master/glog-${GLOG_VERSION}.tar.gz
GTEST_URL=http://gitlab.baidu.com/baidups/third/raw/master/googletest-release-${GTEST_VERSION}.tar.gz
LIBUNWIND_URL=http://gitlab.baidu.com/baidups/third/raw/master/libunwind-${LIBUNWIND_VERSION}.tar.gz
GPERFTOOLS_URL=http://gitlab.baidu.com/baidups/third/raw/master/gperftools-${GPERFTOOLS_VERSION}.tar.gz
INS_URL=http://gitlab.baidu.com/baidups/third/raw/master/ins-${INS_VERSION}.tar.gz
NOSE_URL=http://gitlab.baidu.com/baidups/third/raw/master/nose-${NOSE_VERSION}.tar.gz
MONGOOSE_URL=https://github.com/cesanta/mongoose/archive/${MONGOOSE_VERSION}.tar.gz
else
return 1
fi
Expand Down
19 changes: 18 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ elif [ ! -f "${FLAG_DIR}/ins_${INS_VERSION}" ] \
sed -i "s|^PROTOBUF_PATH ?=.*|PROTOBUF_PATH ?=${DEPS_PREFIX}|" Makefile
sed -i "s|^PBRPC_PATH ?=.*|PBRPC_PATH ?=${DEPS_PREFIX}|" Makefile
sed -i "s|^GTEST_PATH ?=.*|GTEST_PATH ?=${DEPS_PREFIX}|" Makefile
#BOOST_PATH=${DEPS_PREFIX}/boost_${BOOST_VERSION} make install_sdk
# BOOST_PATH=${DEPS_PREFIX}/boost_${BOOST_VERSION} make install_sdk
make -j4 install_sdk
cd -
touch "${FLAG_DIR}/ins_${INS_VERSION}"
Expand All @@ -239,6 +239,23 @@ elif [ ! -f "${FLAG_DIR}/nose_${NOSE_VERSION}" ] \
touch "${FLAG_DIR}/nose_${NOSE_VERSION}"
fi

# mongoose
if [ ${MONGOOSE_VERSION} == "DISABLE" ]; then
echo "Disable mongoose."
elif [ ! -f "${FLAG_DIR}/mongoose_${MONGOOSE_VERSION}" ] \
|| [ ! -f "${DEPS_PREFIX}/include/mongoose.h" ] \
|| [ ! -f "${DEPS_PREFIX}/lib/libmongoose.a" ]; then
wget --no-check-certificate -O mongoose-${MONGOOSE_VERSION}.tar.gz ${MONGOOSE_URL}
tar zxf mongoose-${MONGOOSE_VERSION}.tar.gz --recursive-unlink
cd mongoose-${MONGOOSE_VERSION}
cp -af mongoose.h ${DEPS_PREFIX}/include
gcc -c mongoose.c -o mongoose.o -g2 -pipe -Wall -Werror -fPIC
ar -rv libmongoose.a mongoose.o
cp -af libmongoose.a ${DEPS_PREFIX}/lib
cd -
touch "${FLAG_DIR}/mongoose_${MONGOOSE_VERSION}"
fi

cd ${WORK_DIR}

########################################
Expand Down
2 changes: 1 addition & 1 deletion build_version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ GIT_INFO_FILE=git_info.tmp
VERSION_CPP_FILE=src/version.cc

# generate template file
git log | head -n 6 | sed 's/$/&\\n\\/g' > $GIT_INFO_FILE
git log | head -n 6 | sed 's/"/\\"/g' | sed 's/$/&\\n\\/g' > $GIT_INFO_FILE
gen_info_template_header > $TEMPLATE_HEADER_FILE
gen_info_template_foot > $TEMPLATE_FOOT_FILE
gen_info_print_template >> $TEMPLATE_FOOT_FILE
Expand Down
11 changes: 7 additions & 4 deletions depends.mk.template
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,19 @@ GLOG_PREFIX=./thirdparty
GTEST_PREFIX=./thirdparty
GPERFTOOLS_PREFIX=./thirdparty
INS_PREFIX=./thirdparty
MONGOOSE_PREFIX=./thirdparty
BOOST_INCDIR=./thirdparty/boost_1_57_0

SOFA_PBRPC_INCDIR = $(SOFA_PBRPC_PREFIX)/include
PROTOBUF_INCDIR = $(PROTOBUF_PREFIX)/include
SNAPPY_INCDIR = $(SNAPPY_PREFIX)/include
ZOOKEEPER_INCDIR = $(ZOOKEEPER_PREFIX)/include
ZOOKEEPER_INCDIR = $(ZOOKEEPER_PREFIX)/include/zookeeper
GFLAGS_INCDIR = $(GFLAGS_PREFIX)/include
GLOG_INCDIR = $(GLOG_PREFIX)/include
GTEST_INCDIR = $(GTEST_PREFIX)/include
GPERFTOOLS_INCDIR = $(GPERFTOOLS_PREFIX)/include
INS_INCDIR = $(INS_PREFIX)/include
MONGOOSE_INCDIR = $(MONGOOSE_PREFIX)/include

SOFA_PBRPC_LIBDIR = $(SOFA_PBRPC_PREFIX)/lib
PROTOBUF_LIBDIR = $(PROTOBUF_PREFIX)/lib
Expand All @@ -35,6 +37,7 @@ GLOG_LIBDIR = $(GLOG_PREFIX)/lib
GTEST_LIBDIR = $(GTEST_PREFIX)/lib
GPERFTOOLS_LIBDIR = $(GPERFTOOLS_PREFIX)/lib
INS_LIBDIR = $(INS_PREFIX)/lib
MONGOOSE_LIBDIR = $(MONGOOSE_PREFIX)/lib

PROTOC = $(PROTOBUF_PREFIX)/bin/protoc

Expand All @@ -45,13 +48,13 @@ PROTOC = $(PROTOBUF_PREFIX)/bin/protoc
DEPS_INCPATH = -I$(SOFA_PBRPC_INCDIR) -I$(PROTOBUF_INCDIR) \
-I$(SNAPPY_INCDIR) -I$(ZOOKEEPER_INCDIR) \
-I$(GFLAGS_INCDIR) -I$(GLOG_INCDIR) -I$(GTEST_INCDIR) \
-I$(GPERFTOOLS_INCDIR) -I$(BOOST_INCDIR) -I$(INS_INCDIR)
-I$(GPERFTOOLS_INCDIR) -I$(BOOST_INCDIR) -I$(INS_INCDIR) -I$(MONGOOSE_INCDIR)
DEPS_LDPATH = -L$(SOFA_PBRPC_LIBDIR) -L$(PROTOBUF_LIBDIR) \
-L$(SNAPPY_LIBDIR) -L$(ZOOKEEPER_LIBDIR) \
-L$(GFLAGS_LIBDIR) -L$(GLOG_LIBDIR) -L$(GTEST_LIBDIR) \
-L$(GPERFTOOLS_LIBDIR) -L$(INS_LIBDIR)
-L$(GPERFTOOLS_LIBDIR) -L$(INS_LIBDIR) -L$(MONGOOSE_LIBDIR)
SO_DEPS_LDFLAGS = -lins_sdk -lsofa-pbrpc -lprotobuf -lsnappy -lzookeeper_mt \
-lgtest_main -lgtest -lglog -lgflags
-lgtest_main -lgtest -lglog -lgflags -lmongoose
DEPS_LDFLAGS = $(SO_DEPS_LDFLAGS) -ltcmalloc_minimal -lunwind

################################################################
Expand Down
Loading