From cf67ac8b098c23d8baab249be9bbeb69e25fa748 Mon Sep 17 00:00:00 2001 From: groot Date: Sun, 14 Apr 2019 20:21:07 +0800 Subject: [PATCH] add readme Former-commit-id: f19468d07eea35f9f7a9ffbf8462458842754d36 --- cpp/README.md | 34 ++++++++++++++++++++++++++++++++++ cpp/build.sh | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 85 insertions(+) create mode 100755 cpp/build.sh diff --git a/cpp/README.md b/cpp/README.md index e69de29bb2..e5173cc31a 100644 --- a/cpp/README.md +++ b/cpp/README.md @@ -0,0 +1,34 @@ +# vecwise_engine_server + +### Build and Install +Firstly download zdb_server to under same parent folder with zdb_build + + git clone git@192.168.1.105:jinhai/vecwise_engine.git + +Install necessery tools + + centos7 : yum install gfortran + ubunut : sudo apt-install install gfortran + +Build third-parties + + cd [sourcecode path]/cpp/thid_party + ./build.sh + +Then run build.sh scripts under cpp folder: + + cd [sourcecode path]/cpp + ./build.sh -t Debug + ./build.sh -t Release + +To run unittest: + + ./build.sh -u + or + ./build.sh --unittest + + +### Luanch server +Set config in cpp/conf/server_config.yaml +Then luanch server with config: + vecwise_engine_server -c [sourcecode path]/cpp/conf/server_config.yaml \ No newline at end of file diff --git a/cpp/build.sh b/cpp/build.sh new file mode 100755 index 0000000000..e10545fa30 --- /dev/null +++ b/cpp/build.sh @@ -0,0 +1,51 @@ +#!/bin/bash + +BUILD_TYPE="Debug" +BUILD_UNITTEST="off" + +while getopts "p:t:uh" arg +do + case $arg in + t) + BUILD_TYPE=$OPTARG # BUILD_TYPE + ;; + u) + echo "Build and run unittest cases" ; + BUILD_UNITTEST="on"; + ;; + h) # help + echo " + +parameter: +-t: build type +-u: building unit test options + +usage: +./build.sh -t \${BUILD_TYPE} [-u] [-h] + " + exit 0 + ;; + ?) + echo "unkonw argument" + exit 1 + ;; + esac +done + +if [[ -d cmake_build ]]; then + rm cmake_build -r +fi + +rm -rf ./cmake_build +mkdir cmake_build +cd cmake_build + +CMAKE_CMD="cmake -DBUILD_UNIT_TEST=${BUILD_UNITTEST} \ +-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \ +$@ ../" +echo ${CMAKE_CMD} + +${CMAKE_CMD} + +make clean && make -j || exit 1 +