diff --git a/.arcconfig b/.arcconfig deleted file mode 100644 index 577944ead4..0000000000 --- a/.arcconfig +++ /dev/null @@ -1,4 +0,0 @@ -{ - "project_id": "Pegasus", - "conduit_uri": "https://phabricator.d.xiaomi.net" -} diff --git a/.travis.yml b/.travis.yml index 9757ce022d..d907b72189 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,9 +15,9 @@ before_install: before_script: - cd thirdparty - - wget https://github.com/XiaoMi/pegasus-common/releases/download/deps/pegasus-thirdparty-prebuild.zip - - unzip pegasus-thirdparty-prebuild.zip - - rm -f pegasus-thirdparty-prebuild.zip + - wget https://github.com/XiaoMi/pegasus-common/releases/download/deps/pegasus-thirdparty-prebuild-bionic.zip + - unzip pegasus-thirdparty-prebuild-bionic.zip + - rm -f pegasus-thirdparty-prebuild-bionic.zip - cd .. - ulimit -c unlimited -S diff --git a/bin/Linux/.keep_dir_in_git b/bin/Linux/.keep_dir_in_git deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/bin/dsn.cmake b/bin/dsn.cmake index c4bf4d24fa..d12edea869 100644 --- a/bin/dsn.cmake +++ b/bin/dsn.cmake @@ -296,7 +296,7 @@ function(dsn_setup_thirdparty_libs) set(DEFAULT_THIRDPARTY_LIBS ${THRIFT_LIB} fmt::fmt CACHE STRING "default thirdparty libs" FORCE) # rocksdb - file(GLOB ROCKSDB_DEPENDS_MODULE_PATH ${DSN_PROJECT_DIR}/thirdparty/src/*/cmake/modules) + file(GLOB ROCKSDB_DEPENDS_MODULE_PATH ${DSN_PROJECT_DIR}/thirdparty/build/Source/rocksdb/cmake/modules) if(NOT ROCKSDB_DEPENDS_MODULE_PATH) message(WARNING "Cannot find RocksDB depends cmake modules path, might not find snappy, zstd, lz4") endif() diff --git a/run.sh b/run.sh index fcb95e8386..754aca736e 100755 --- a/run.sh +++ b/run.sh @@ -47,7 +47,6 @@ function usage_build() echo " e.g., \"gcc,g++\" or \"clang-3.9,clang++-3.9\"" echo " default is \"gcc,g++\"" echo " -j|--jobs the number of jobs to run simultaneously, default 8" - echo " -b|--boost_dir specify customized boost directory, use system boost if not set" echo " --enable_gcov generate gcov code coverage report, default no" echo " -v|--verbose build in verbose mode, default no" echo " --notest build without building unit tests, default no" @@ -75,7 +74,6 @@ function run_build() CLEAR=NO CLEAR_THIRDPARTY=NO JOB_NUM=8 - BOOST_DIR="" ENABLE_GCOV=NO RUN_VERBOSE=NO NO_TEST=NO @@ -116,10 +114,6 @@ function run_build() JOB_NUM="$2" shift ;; - -b|--boost_dir) - BOOST_DIR="$2" - shift - ;; --enable_gcov) ENABLE_GCOV=YES BUILD_TYPE="debug" @@ -175,25 +169,21 @@ function run_build() fi if [[ ${SKIP_THIRDPARTY} == "YES" ]]; then - echo "Skip building thirdparty..." + echo "Skip building third-parties..." else - # build thirdparty first cd thirdparty if [[ "$CLEAR_THIRDPARTY" == "YES" ]]; then - echo "Clear thirdparty..." - rm -rf src build output &>/dev/null - CLEAR=YES + echo "Clear third-parties..." + rm -rf build + rm -rf output fi - echo "Start building thirdparty..." - ./download-thirdparty.sh + echo "Start building third-parties..." + mkdir -p build + pushd build + cmake .. -DCMAKE_C_COMPILER=$C_COMPILER -DCMAKE_CXX_COMPILER=$CXX_COMPILER -DCMAKE_BUILD_TYPE=Release + make -j$JOB_NUM exit_if_fail $? - if [[ "x"$BOOST_DIR != "x" ]]; then - ./build-thirdparty.sh -b $BOOST_DIR - exit_if_fail $? - else - ./build-thirdparty.sh - exit_if_fail $? - fi + popd cd .. fi @@ -212,7 +202,7 @@ function run_build() fi C_COMPILER="$C_COMPILER" CXX_COMPILER="$CXX_COMPILER" BUILD_TYPE="$BUILD_TYPE" \ ONLY_BUILD="$ONLY_BUILD" CLEAR="$CLEAR" JOB_NUM="$JOB_NUM" \ - BOOST_DIR="$BOOST_DIR" ENABLE_GCOV="$ENABLE_GCOV" SANITIZER="$SANITIZER" \ + ENABLE_GCOV="$ENABLE_GCOV" SANITIZER="$SANITIZER" \ RUN_VERBOSE="$RUN_VERBOSE" TEST_MODULE="$TEST_MODULE" NO_TEST="$NO_TEST" \ DISABLE_GPERF="$DISABLE_GPERF" $scripts_dir/build.sh } diff --git a/scripts/linux/build.sh b/scripts/linux/build.sh index 0f326d455f..e38385986d 100755 --- a/scripts/linux/build.sh +++ b/scripts/linux/build.sh @@ -10,7 +10,6 @@ # ONLY_BUILD YES|NO # RUN_VERBOSE YES|NO # ENABLE_GCOV YES|NO -# BOOST_DIR |"" # TEST_MODULE " ..." # # CMake options: @@ -18,7 +17,6 @@ # -DCMAKE_CXX_COMPILER=g++|clang++ # [-DCMAKE_BUILD_TYPE=Debug] # [-DENABLE_GCOV=TRUE] -# [-DBoost_NO_BOOST_CMAKE=ON -DBOOST_ROOT=$BOOST_DIR -DBoost_NO_SYSTEM_PATHS=ON] ROOT=`pwd` REPORT_DIR=$ROOT/test_reports @@ -97,23 +95,7 @@ else echo "Build without sanitizer" fi -# You can specify customized boost by defining BOOST_DIR. -# Install boost like this: -# wget http://downloads.sourceforge.net/project/boost/boost/1.54.0/boost_1_54_0.zip?r=&ts=1442891144&use_mirror=jaist -# unzip -q boost_1_54_0.zip -# cd boost_1_54_0 -# ./bootstrap.sh --with-libraries=system,filesystem --with-toolset=gcc -# ./b2 toolset=gcc cxxflags="-std=c++11 -fPIC" -j8 -d0 -# ./b2 install --prefix=$DSN_ROOT -d0 -# And set BOOST_DIR as: -# export BOOST_DIR=/path/to/boost_1_54_0/output -if [ -n "$BOOST_DIR" ] -then - echo "Use customized boost: $BOOST_DIR" - CMAKE_OPTIONS="$CMAKE_OPTIONS -DBoost_NO_BOOST_CMAKE=ON -DBOOST_ROOT=$BOOST_DIR -DBoost_NO_SYSTEM_PATHS=ON" -else - echo "Use system boost" -fi +CMAKE_OPTIONS="$CMAKE_OPTIONS -DBoost_NO_BOOST_CMAKE=ON -DBOOST_ROOT=${ROOT}/thirdparty/output -DBoost_NO_SYSTEM_PATHS=ON" echo "CMAKE_OPTIONS=$CMAKE_OPTIONS" echo "MAKE_OPTIONS=$MAKE_OPTIONS" diff --git a/src/block_service/fds/CMakeLists.txt b/src/block_service/fds/CMakeLists.txt index 7a9de96379..619c86af7a 100644 --- a/src/block_service/fds/CMakeLists.txt +++ b/src/block_service/fds/CMakeLists.txt @@ -15,6 +15,4 @@ set(MY_PROJ_LIBS "") set(MY_BINPLACES "") dsn_add_static_library() - -find_path(FDS_INCLUDE_DIR NAMES constants.h PATHS ${DSN_THIRDPARTY_ROOT}/include PATH_SUFFIXES fds) # TODO(huangwei5): move to dsn_setup_thirdparty_libs(), if not found, return fatal -target_include_directories(dsn.block_service.fds PRIVATE "${FDS_INCLUDE_DIR}") +target_include_directories(dsn.block_service.fds PRIVATE ${DSN_THIRDPARTY_ROOT}/include/fds) diff --git a/thirdparty/CMakeLists.txt b/thirdparty/CMakeLists.txt new file mode 100644 index 0000000000..db4b2c18ad --- /dev/null +++ b/thirdparty/CMakeLists.txt @@ -0,0 +1,297 @@ +project(pegasus_thirdparties) +cmake_minimum_required(VERSION 3.0.2) + +if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") + # require at least gcc 4.8 + if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8) + message(FATAL_ERROR "GCC version must be at least 4.8!") + endif() +endif() + +include(ExternalProject) + +set(TP_DIR ${PROJECT_SOURCE_DIR}) +set(TP_OUTPUT ${PROJECT_SOURCE_DIR}/output) + +# TMP_DIR = /tmp/ +# STAMP_DIR = /Stamp/ +# DOWNLOAD_DIR = /Download/ +# SOURCE_DIR = /Source/ +# BINARY_DIR = /Build/ +# INSTALL_DIR = /Install/ +# LOG_DIR = +set_property(DIRECTORY PROPERTY EP_BASE ${TP_DIR}/build) + +set(OSS_URL_PREFIX "http://pegasus-thirdparties.oss-cn-beijing.aliyuncs.com") + +message(STATUS "Setting up third-parties...") + +ExternalProject_Add(boost + URL ${OSS_URL_PREFIX}/boost_1_69_0.tar.bz2 + https://dl.bintray.com/boostorg/release/1.69.0/source/boost_1_69_0.tar.bz2 + URL_MD5 a1332494397bf48332cb152abfefcec2 + CONFIGURE_COMMAND ./bootstrap.sh --prefix=. --with-libraries=system,filesystem,regex --with-toolset=gcc + BUILD_COMMAND ./b2 toolset=gcc cxxflags=-fPIC cxxstd=11 install + INSTALL_COMMAND cp -R include/boost ${TP_OUTPUT}/include && cp -R lib ${TP_OUTPUT}/ + BUILD_IN_SOURCE 1 + ) + +# header-only +file(MAKE_DIRECTORY ${TP_OUTPUT}/include/concurrentqueue) +ExternalProject_Add(concurrentqueue + URL ${OSS_URL_PREFIX}/concurrentqueue-1.0.1.tar.gz + https://codeload.github.com/cameron314/concurrentqueue/tar.gz/v1.0.1 + URL_MD5 80016b584fddffd67073349efd7b8958 + CONFIGURE_COMMAND "" + BUILD_COMMAND "" + INSTALL_COMMAND cp -R blockingconcurrentqueue.h concurrentqueue.h lightweightsemaphore.h internal/ ${TP_OUTPUT}/include/concurrentqueue + BUILD_IN_SOURCE 1 + ) + +# header-only +file(MAKE_DIRECTORY ${TP_OUTPUT}/include/readerwriterqueue) +ExternalProject_Add(readerwriterqueue + URL ${OSS_URL_PREFIX}/readerwriterqueue-1.0.2.tar.gz + https://codeload.github.com/cameron314/readerwriterqueue/tar.gz/v1.0.2 + URL_MD5 9e355a2660bd2810cb1874fb7366906e + CONFIGURE_COMMAND "" + BUILD_COMMAND "" + INSTALL_COMMAND cp -R atomicops.h readerwriterqueue.h ${TP_OUTPUT}/include/readerwriterqueue + BUILD_IN_SOURCE 1 + ) + +ExternalProject_Add(googletest + URL ${OSS_URL_PREFIX}/googletest-release-1.8.0.tar.gz + https://codeload.github.com/google/googletest/tar.gz/release-1.8.0 + URL_MD5 16877098823401d1bf2ed7891d7dce36 + CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${TP_OUTPUT} + -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} + -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} + ) +ExternalProject_Get_property(googletest SOURCE_DIR) +set(googletest_SRC ${SOURCE_DIR}) + +ExternalProject_Add(gperftools + URL ${OSS_URL_PREFIX}/gperftools-2.7.tar.gz + https://github.com/gperftools/gperftools/releases/download/gperftools-2.7/gperftools-2.7.tar.gz + URL_MD5 c6a852a817e9160c79bdb2d3101b4601 + CONFIGURE_COMMAND ./configure --prefix=${TP_OUTPUT} --enable-static=no --enable-frame-pointers=yes + BUILD_IN_SOURCE 1 + ) + +# header-only +ExternalProject_Add(rapidjson + URL ${OSS_URL_PREFIX}/rapidjson-1.1.0.tar.gz + https://codeload.github.com/Tencent/rapidjson/tar.gz/v1.1.0 + URL_MD5 badd12c511e081fec6c89c43a7027bce + CONFIGURE_COMMAND "" + BUILD_COMMAND "" + INSTALL_COMMAND cp -R include/rapidjson ${TP_OUTPUT}/include + BUILD_IN_SOURCE 1 + ) + +ExternalProject_Add(thrift + URL ${OSS_URL_PREFIX}/thrift-0.9.3.tar.gz + http://archive.apache.org/dist/thrift/0.9.3/thrift-0.9.3.tar.gz + URL_MD5 88d667a8ae870d5adeca8cb7d6795442 + PATCH_COMMAND patch -p1 < ${TP_DIR}/fix_thrift_for_cpp11.patch + CMAKE_ARGS -DCMAKE_BUILD_TYPE=release + -DWITH_JAVA=OFF + -DWITH_PYTHON=OFF + -DWITH_C_GLIB=OFF + -DWITH_CPP=ON + -DBUILD_TESTING=OFF + -DBUILD_EXAMPLES=OFF + -DWITH_QT5=OFF + -DWITH_QT4=OFF + -DWITH_OPENSSL=OFF + -DBUILD_COMPILER=ON + -DBUILD_TUTORIALS=OFF + -DWITH_LIBEVENT=OFF + -DCMAKE_INSTALL_PREFIX=${TP_OUTPUT} + -DCMAKE_POSITION_INDEPENDENT_CODE=ON + -DWITH_SHARED_LIB=OFF + -DBOOST_ROOT=${TP_OUTPUT} + -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} + -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} + DEPENDS boost + ) + +ExternalProject_Add(zookeeper + URL ${OSS_URL_PREFIX}/zookeeper-3.4.10.tar.gz + http://ftp.jaist.ac.jp/pub/apache/zookeeper/zookeeper-3.4.10/zookeeper-3.4.10.tar.gz + URL_MD5 e4cf1b1593ca870bf1c7a75188f09678 + CONFIGURE_COMMAND cd src/c && ./configure --enable-static=yes --enable-shared=no --prefix=${TP_OUTPUT} --with-pic=yes + BUILD_COMMAND cd src/c && make + INSTALL_COMMAND cd src/c && make install + BUILD_IN_SOURCE 1 + ) + +ExternalProject_Add(libevent + URL ${OSS_URL_PREFIX}/libevent-release-2.1.8-stable.tar.gz + https://github.com/libevent/libevent/archive/release-2.1.8-stable.tar.gz + URL_MD5 80f8652e4b08d2ec86a5f5eb46b74510 + CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${TP_OUTPUT} + -DEVENT__DISABLE_DEBUG_MODE=On + -DCMAKE_POSITION_INDEPENDENT_CODE=ON + -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} + -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} + ) + +ExternalProject_Add(poco + URL ${OSS_URL_PREFIX}/poco-poco-1.7.8-release.tar.gz + https://codeload.github.com/pocoproject/poco/tar.gz/poco-1.7.8-release + URL_MD5 4dbf02e14b9f20940ca0e8c70d8f6036 + CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${TP_OUTPUT} + -DENABLE_MONGODB=OFF + -DENABLE_PDF=OFF + -DENABLE_DATA=OFF + -DENABLE_DATA_SQLITE=OFF + -DENABLE_DATA_MYSQL=OFF + -DENABLE_DATA_ODBC=OFF + -DENABLE_SEVENZIP=OFF + -DENABLE_ZIP=OFF + -DENABLE_APACHECONNECTOR=OFF + -DENABLE_CPPPARSER=OFF + -DENABLE_POCODOC=OFF + -DENABLE_PAGECOMPILER=OFF + -DENABLE_PAGECOMPILER_FILE2PAGE=OFF + -DCMAKE_POSITION_INDEPENDENT_CODE=ON + -DBOOST_ROOT=${TP_OUTPUT} + -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} + -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} + DEPENDS boost + ) + +ExternalProject_Add(fds + GIT_REPOSITORY https://github.com/XiaoMi/galaxy-fds-sdk-cpp.git + GIT_TAG 2d813e0f0d1bae871f584030101366bdf29dc36c + CMAKE_ARGS -DPOCO_INCLUDE=${TP_OUTPUT}/include + -DPOCO_LIB=${TP_OUTPUT}/lib + -DCMAKE_POSITION_INDEPENDENT_CODE=ON + -DBOOST_ROOT=${TP_OUTPUT} + -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} + -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} + INSTALL_COMMAND cp libgalaxy-fds-sdk-cpp.a ${TP_OUTPUT}/lib + COMMAND rm -rf ${TP_OUTPUT}/include/fds + COMMAND cp -r include fds-include + COMMAND mv fds-include ${TP_OUTPUT}/include/fds # install fds headers into a stand-alone directory + UPDATE_COMMAND "" # do not update + DEPENDS googletest poco boost + BUILD_IN_SOURCE 1 + ) + +ExternalProject_Add(fmt + URL ${OSS_URL_PREFIX}/fmt-4.0.0.tar.gz + https://codeload.github.com/fmtlib/fmt/tar.gz/4.0.0 + URL_MD5 c9be9a37bc85493d1116b0af59a25eba + CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${TP_OUTPUT} + -DCMAKE_BUILD_TYPE=release + -DFMT_TEST=false + -DCMAKE_POSITION_INDEPENDENT_CODE=ON + -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} + -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} + ) + +ExternalProject_Add(gflags + URL ${OSS_URL_PREFIX}/gflags-2.2.1.zip + https://github.com/gflags/gflags/archive/v2.2.1.zip + URL_MD5 2d988ef0b50939fb50ada965dafce96b + CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${TP_OUTPUT} + -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} + -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} + ) + +# civetweb is one of the dependencies of promemetheus-cpp, do not build & install +ExternalProject_Add(civetweb + URL ${OSS_URL_PREFIX}/civetweb-1.11.tar.gz + https://codeload.github.com/civetweb/civetweb/tar.gz/v1.11 + URL_MD5 b6d2175650a27924bccb747cbe084cd4 + CONFIGURE_COMMAND "" + BUILD_COMMAND "" + INSTALL_COMMAND "" + ) +ExternalProject_Get_property(civetweb SOURCE_DIR) +set(civetweb_SRC ${SOURCE_DIR}) + +ExternalProject_Add(curl + URL ${OSS_URL_PREFIX}/curl-7.47.0.tar.gz + http://curl.haxx.se/download/curl-7.47.0.tar.gz + URL_MD5 5109d1232d208dfd712c0272b8360393 + CONFIGURE_COMMAND ./configure --prefix=${TP_OUTPUT} + --disable-dict + --disable-file + --disable-ftp + --disable-gopher + --disable-imap + --disable-ipv6 + --disable-ldap + --disable-ldaps + --disable-manual + --disable-pop3 + --disable-rtsp + --disable-smtp + --disable-telnet + --disable-tftp + --disable-shared + --without-librtmp + --without-zlib + --without-libssh2 + --without-ssl + --without-libidn + BUILD_IN_SOURCE 1 + ) + +ExternalProject_Add(prometheus-cpp + URL ${OSS_URL_PREFIX}/prometheus-cpp-0.7.0.tar.gz + https://codeload.github.com/jupp0r/prometheus-cpp/tar.gz/v0.7.0 + URL_MD5 dc75c31ceaefd160e978365bdca8eb01 + DEPENDS civetweb curl + PATCH_COMMAND rm -rf 3rdparty/civetweb && cp -R ${civetweb_SRC} 3rdparty/civetweb # replace the submodule + CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${TP_OUTPUT} + -DENABLE_TESTING=OFF + -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} + -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} + ) + +# header-only +ExternalProject_Add(nlohmann_json + URL ${OSS_URL_PREFIX}/nlohmann_json-3.7.3.zip + https://github.com/nlohmann/json/releases/download/v3.7.3/include.zip + URL_MD5 7249387593792b565dcb30d87bca0de3 + CONFIGURE_COMMAND "" + BUILD_COMMAND "" + INSTALL_COMMAND cp -R include/nlohmann ${TP_OUTPUT}/include + BUILD_IN_SOURCE 1 + ) + +ExternalProject_Add(s2geometry + URL ${OSS_URL_PREFIX}/s2geometry-e8d16637a467d9f096a92a6d81a50a9b747ca828.zip + https://github.com/neverchanje/s2geometry/archive/e8d16637a467d9f096a92a6d81a50a9b747ca828.zip + URL_MD5 75cc44c9c31382083d8a2d0e42590788 + CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${TP_OUTPUT} + -DGTEST_ROOT=${googletest_SRC}/googletest + -DBUILD_SHARED_LIBS=OFF + -DBUILD_PYTHON=OFF + -DBUILD_TESTING=OFF + -DBUILD_EXAMPLES=OFF + -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} + -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} + DEPENDS googletest + ) + +ExternalProject_Add(rocksdb + URL ${OSS_URL_PREFIX}/pegasus-rocksdb-6.6.4-compatible.zip + https://github.com/XiaoMi/pegasus-rocksdb/archive/v6.6.4-compatible.zip + URL_MD5 595b21fbe681dcf126c4cccda46f1cbb + CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${TP_OUTPUT} + -DWITH_LZ4=ON + -DWITH_ZSTD=ON + -DWITH_SNAPPY=ON + -DWITH_BZ2=OFF + -DWITH_TESTS=OFF + -DWITH_GFLAGS=OFF + -DUSE_RTTI=ON + -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} + -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} + ) diff --git a/thirdparty/build-thirdparty.sh b/thirdparty/build-thirdparty.sh deleted file mode 100755 index b8923a5867..0000000000 --- a/thirdparty/build-thirdparty.sh +++ /dev/null @@ -1,352 +0,0 @@ -#!/bin/bash - -# $1 package_name -# $2 return-code -function exit_if_fail() -{ - if [ $2 -ne 0 ]; then - echo "build $1 failed" - echo "please check the command-line output of cmake or make" - exit $2 - fi -} - -TP_DIR=$( cd $( dirname $0 ) && pwd ) -TP_SRC=$TP_DIR/src -TP_BUILD=$TP_DIR/build -TP_OUTPUT=$TP_DIR/output -# explicitly annouce the compilers in case that -# a machine has low version of gcc and user install a higher version manually -export CC=gcc -export CXX=g++ - -CLEAR_OLD_BUILD="NO" -BOOST_ROOT="" - -while [[ $# > 0 ]]; do - case $1 in - -c|--clear) - CLEAR_OLD_BUILD="YES" - ;; - -b|--boost_root) - BOOST_ROOT="$2" - shift - ;; - *) - echo "Error: unknown option \"$1\"" - ;; - esac - shift -done - -if [ $CLEAR_OLD_BUILD = "YES" ]; then - rm -rf $TP_OUTPUT/* - rm -rf $TP_BUILD/* -fi - -mkdir -p $TP_OUTPUT/include -mkdir -p $TP_OUTPUT/lib -mkdir -p $TP_OUTPUT/bin - -# build concurrentqueue -if [ ! -d $TP_OUTPUT/include/concurrentqueue ]; then - cd $TP_SRC/concurrentqueue-1.0.1 - mkdir -p $TP_OUTPUT/include/concurrentqueue - cp -R blockingconcurrentqueue.h concurrentqueue.h lightweightsemaphore.h internal/ $TP_OUTPUT/include/concurrentqueue - cd $TP_DIR - exit_if_fail "concurrentqueue" $? -else - echo "skip build concurrentqueue" -fi - -# build readerwriterqueue -if [ ! -d $TP_OUTPUT/include/readerwriterqueue ]; then - cd $TP_SRC/readerwriterqueue-1.0.2 - mkdir -p $TP_OUTPUT/include/readerwriterqueue - cp -R atomicops.h readerwriterqueue.h $TP_OUTPUT/include/readerwriterqueue - cd $TP_DIR - exit_if_fail "readerwriterqueue" $? -else - echo "skip build readerwriterqueue" -fi - -# build gtest -if [ ! -d $TP_OUTPUT/include/gtest ]; then - mkdir -p $TP_BUILD/googletest - cd $TP_BUILD/googletest - cmake $TP_SRC/googletest-release-1.8.0 - make -j8 - res=$? - cp -R $TP_SRC/googletest-release-1.8.0/googletest/include/gtest $TP_OUTPUT/include - cp $TP_BUILD/googletest/googlemock/gtest/libgtest.a $TP_BUILD/googletest/googlemock/gtest/libgtest_main.a $TP_OUTPUT/lib - cd $TP_DIR - exit_if_fail "gtest" $res -else - echo "skip build gtest" -fi - -# gperftools -if [ ! -f $TP_OUTPUT/lib/libtcmalloc.so ]; then - cd $TP_SRC/gperftools-2.7 - ./configure --prefix=$TP_OUTPUT --enable-static=no --enable-frame-pointers=yes - make -j8 && make install - res=$? - cd $TP_DIR - exit_if_fail "gperftools" $res -else - echo "skip build gperftools" -fi - -# build rapidjson -if [ ! -d $TP_OUTPUT/include/rapidjson ]; then - cp -R $TP_SRC/rapidjson-1.1.0/include/rapidjson $TP_OUTPUT/include -fi - -# build thrift -if [ ! -d $TP_OUTPUT/include/thrift ]; then - mkdir -p $TP_BUILD/thrift-0.9.3 - cd $TP_BUILD/thrift-0.9.3 - CMAKE_FLAGS="-DCMAKE_BUILD_TYPE=release\ - -DWITH_JAVA=OFF\ - -DWITH_PYTHON=OFF\ - -DWITH_C_GLIB=OFF\ - -DWITH_CPP=ON\ - -DBUILD_TESTING=OFF\ - -DBUILD_EXAMPLES=OFF\ - -DWITH_QT5=OFF\ - -DWITH_QT4=OFF\ - -DWITH_OPENSSL=OFF\ - -DBUILD_COMPILER=ON\ - -DBUILD_TUTORIALS=OFF\ - -DWITH_LIBEVENT=OFF\ - -DCMAKE_INSTALL_PREFIX=$TP_OUTPUT\ - -DCMAKE_POSITION_INDEPENDENT_CODE=ON\ - -DWITH_SHARED_LIB=OFF" - - if [ "x"$BOOST_ROOT != "x" ]; then - CMAKE_FLAGS="$CMAKE_FLAGS -DBOOST_ROOT=$BOOST_ROOT" - fi - - echo $CMAKE_FLAGS - cmake $TP_SRC/thrift-0.9.3 $CMAKE_FLAGS - - make -j8 && make install - res=$? - cd $TP_DIR - exit_if_fail "thrift" $res -else - echo "skip build thrift" -fi - -# build zookeeper c client -if [ ! -d $TP_OUTPUT/include/zookeeper ]; then - cd $TP_SRC/zookeeper-3.4.10/src/c - ./configure --enable-static=yes --enable-shared=no --prefix=$TP_OUTPUT --with-pic=yes - make -j8 && make install - res=$? - cd $TP_DIR - exit_if_fail "zookeeper-c-client" $res -else - echo "skip build zookeeper-c-client" -fi - -# build libevent -if [ ! -d $TP_OUTPUT/include/event2 ]; then - cd $TP_SRC/libevent-release-2.1.8-stable - ./autogen.sh - ./configure --enable-shared=no --disable-debug-mode --prefix=$TP_OUTPUT --with-pic=yes - make -j8 && make install - res=$? - cd $TP_DIR - exit_if_fail "libevent" $res -else - echo "skip build libevent" -fi - -# build fmtlib -if [ ! -d $TP_OUTPUT/include/fmt ]; then - mkdir -p $TP_BUILD/fmt-4.0.0 - cd $TP_BUILD/fmt-4.0.0 - cmake $TP_SRC/fmt-4.0.0 -DCMAKE_INSTALL_PREFIX=$TP_OUTPUT -DFMT_TEST=false -DCMAKE_POSITION_INDEPENDENT_CODE=ON - make -j8 && make install - cd $TP_DIR - exit_if_fail "fmtlib" $? -else - echo "skip build fmtlib" -fi - -# build poco -if [ ! -d $TP_OUTPUT/include/Poco ]; then - mkdir -p $TP_BUILD/poco-1.7.8-release - cd $TP_BUILD/poco-1.7.8-release - CMAKE_FLAGS=" - -DENABLE_MONGODB=OFF\ - -DENABLE_PDF=OFF\ - -DENABLE_DATA=OFF\ - -DENABLE_DATA_SQLITE=OFF\ - -DENABLE_DATA_MYSQL=OFF\ - -DENABLE_DATA_ODBC=OFF\ - -DENABLE_SEVENZIP=OFF\ - -DENABLE_ZIP=OFF\ - -DENABLE_APACHECONNECTOR=OFF\ - -DENABLE_CPPPARSER=OFF\ - -DENABLE_POCODOC=OFF\ - -DENABLE_PAGECOMPILER=OFF\ - -DENABLE_PAGECOMPILER_FILE2PAGE=OFF\ - -DCMAKE_INSTALL_PREFIX=$TP_OUTPUT\ - -DCMAKE_POSITION_INDEPENDENT_CODE=ON" - #-DPOCO_STATIC=1" - - if [ "x"$BOOST_ROOT != "x" ]; then - CMAKE_FLAGS="$CMAKE_FLAGS -DBOOST_ROOT=$BOOST_ROOT" - fi - - echo $CMAKE_FLAGS - cmake $TP_SRC/poco-poco-1.7.8-release $CMAKE_FLAGS - make -j8 && make install - res=$? - cd $TP_DIR - exit_if_fail "poco" $res -else - echo "skip build Poco" -fi - -# build fds -if [ ! -d $TP_OUTPUT/include/fds ]; then - if [ ! -d $TP_OUTPUT/include/Poco -o ! -d $TP_OUTPUT/include/gtest ]; then - echo "please build poco or gtest first" - exit - fi - # when build fds, we need poco, gtest - POCO_INCLUDE_DIR=$TP_OUTPUT/include - POCO_LIB_DIR=$TP_OUTPUT/lib - GTEST_INCLUDE_DIR=$TP_OUTPUT/include - GTEST_LIB_DIR=$TP_OUTPUT/lib - - mkdir -p $TP_BUILD/fds - cd $TP_BUILD/fds - - CMAKE_FLAGS="-DPOCO_INCLUDE=${POCO_INCLUDE_DIR}\ - -DPOCO_LIB=${POCO_LIB_DIR}\ - -DGTEST_INCLUDE=${GTEST_INCLUDE_DIR}\ - -DGTEST_LIB=${GTEST_LIB_DIR}\ - -DCMAKE_POSITION_INDEPENDENT_CODE=ON" - - if [ "x"$BOOST_ROOT != "x" ]; then - CMAKE_FLAGS="$CMAKE_FLAGS -DBOOST_ROOT=$BOOST_ROOT" - fi - - echo $CMAKE_FLAGS - cmake $TP_SRC/fds $CMAKE_FLAGS - make -j8 - res=$? - exit_if_fail "fds" $res - mkdir -p $TP_OUTPUT/include/fds - cd $TP_OUTPUT/include/fds - cp -r $TP_SRC/fds/include/* ./ - cd $TP_OUTPUT/lib - cp $TP_BUILD/fds/libgalaxy-fds-sdk-cpp.a ./ - cd $TP_DIR -else - echo "skip build fds" -fi - -# build s2geometry -if [ ! -d $TP_OUTPUT/include/s2 ]; then - mkdir -p $TP_BUILD/s2geometry - cd $TP_BUILD/s2geometry - cmake $TP_SRC/s2geometry-0239455c1e260d6d2c843649385b4fb9f5b28dba -DGTEST_INCLUDE=$TP_OUTPUT/include -DCMAKE_INSTALL_PREFIX=$TP_OUTPUT - make -j8 && make install - res=$? - exit_if_fail "s2geometry" $res - cd $TP_DIR -else - echo "skip build s2geometry" -fi - -# build gflags -if [ ! -d $TP_OUTPUT/include/gflags ]; then - mkdir -p $TP_BUILD/gflags-2.2.1 - cd $TP_BUILD/gflags-2.2.1 - cmake $TP_SRC/gflags-2.2.1 -DCMAKE_INSTALL_PREFIX=$TP_OUTPUT - make -j8 && make install - res=$? - exit_if_fail "gflags" $res - cd $TP_DIR -else - echo "skip build gflags" -fi - -#build curl -if [ ! -d $TP_OUTPUT/include/curl ]; then - cd $TP_SRC/curl-7.47.0 - CONFIG_FLAGS="--prefix=$TP_OUTPUT \ - --disable-dict \ - --disable-file \ - --disable-ftp \ - --disable-gopher \ - --disable-imap \ - --disable-ipv6 \ - --disable-ldap \ - --disable-ldaps \ - --disable-manual \ - --disable-pop3 \ - --disable-rtsp \ - --disable-smtp \ - --disable-telnet \ - --disable-tftp \ - --disable-shared \ - --without-librtmp \ - --without-zlib \ - --without-libssh2 \ - --without-ssl \ - --without-libidn" - - ./configure $CONFIG_FLAGS - make -j8 && make install - res=$? - cd $TP_DIR - exit_if_fail "curl" $res -else - echo "skip build curl" -fi - -#build prometheus-cpp -if [ ! -d $TP_OUTPUT/include/prometheus ]; then - mkdir -p $TP_BUILD/prometheus - cd $TP_BUILD/prometheus - cmake $TP_SRC/prometheus-cpp-0.7.0 -DCMAKE_INSTALL_PREFIX=$TP_OUTPUT -DENABLE_TESTING=OFF - make -j8 && make install - res=$? - exit_if_fail "prometheus-cpp" $res - cd $TP_DIR -else - echo "skip build prometheus-cpp" -fi - -#build nlohmann_json -if [ ! -d $TP_OUTPUT/include/nlohmann ]; then - mv $TP_SRC/nlohmann_json-3.7.3/include/nlohmann $TP_OUTPUT/include -else - echo "skip build nlohmann_json" -fi - -#build rocksdb -if [ ! -d $TP_OUTPUT/include/rocksdb ]; then - mkdir -p $TP_BUILD/rocksdb - cd $TP_BUILD/rocksdb - cmake $TP_SRC/pegasus-rocksdb-6.6.4-compatible -DCMAKE_INSTALL_PREFIX=$TP_OUTPUT \ - -DWITH_LZ4=ON \ - -DWITH_ZSTD=ON \ - -DWITH_SNAPPY=ON \ - -DWITH_BZ2=OFF \ - -DWITH_TESTS=OFF \ - -DWITH_GFLAGS=OFF \ - -DUSE_RTTI=ON \ - -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_CXX_FLAGS=-g - #rocksdb enable jemalloc by default, but we use regular malloc. - make install -j4 DISABLE_JEMALLOC=1 -else - echo "skip build rocksdb" -fi diff --git a/thirdparty/download-thirdparty.sh b/thirdparty/download-thirdparty.sh deleted file mode 100755 index 11a3ff80f0..0000000000 --- a/thirdparty/download-thirdparty.sh +++ /dev/null @@ -1,334 +0,0 @@ -#!/bin/bash - -# This URL corresponds to the Aliyun OSS bucket "pegasus-thirdparties" which -# stores the thirdparty packages necessary. -OSS_URL_PREFIX="http://pegasus-thirdparties.oss-cn-beijing.aliyuncs.com" - -function auto_download() -{ - curl -L $1 > $2 - if [ $? -eq 0 ]; then return 0; fi - echo "curl download $2 failed, try wget" - - wget $1 -O $2 - if [ $? -eq 0 ]; then return 0; fi - echo "wget download $2 failed, no more download utilities to try" - - return 1 -} - -# check_and_download package_name url md5sum extracted_folder_name -# return: -# 0 if download and extract ok -# 1 if already downloaded -# 2 if download or extract fail -function check_and_download() -{ - package_name=$1 - url=$2 - correct_md5sum=$3 - extracted_folder_name=$4 - if [ -f $package_name ]; then - echo "$package_name has already downloaded, skip it" - - if [ -d $extracted_folder_name ]; then - echo "$package_name has been extracted" - return 1 - else - echo "extract package $package_name" - extract_package $package_name - local ret_code=$? - if [ $ret_code -ne 0 ]; then - return 2 - else - return 0 - fi - fi - else - echo "download package $package_name" - auto_download "$url" "$package_name" - local ret_code=$? - if [ $ret_code -ne 0 ]; then - rm -f $1 - echo "package $package_name download failed" - return 2 - fi - - md5=`md5sum $1 | cut -d ' ' -f1` - if [ "$md5"x != "$correct_md5sum"x ]; then - #rm -f $1 - #echo "package $package_name is broken, already deleted" - return 2 - fi - - extract_package $package_name - local ret_code=$? - if [ $ret_code -ne 0 ]; then - return 2 - else - return 0 - fi - fi -} - -function extract_package() -{ - package_name=$1 - is_tar_gz=$(echo $package_name | grep ".tar.gz") - if [[ $is_tar_gz != "" ]]; then - tar xf $package_name - fi - is_zip=$(echo $package_name | grep ".zip") - if [[ $is_zip != "" ]]; then - unzip -oq $package_name - fi - local ret_code=$? - if [ $ret_code -ne 0 ]; then - rm -f $package_name - echo "extract $package_name failed, please delete the incomplete folder" - return 2 - else - return 0 - fi -} - -function exit_if_fail() -{ - if [ $1 -eq 2 ]; then - exit $1 - fi -} - - -TP_DIR=$( cd $( dirname $0 ) && pwd ) -TP_SRC=$TP_DIR/src -TP_BUILD=$TP_DIR/build -TP_OUTPUT=$TP_DIR/output - -if [ ! -d $TP_SRC ]; then - mkdir $TP_SRC -fi - -if [ ! -d $TP_BUILD ]; then - mkdir $TP_BUILD -fi - -if [ ! -d $TP_OUTPUT ]; then - mkdir $TP_OUTPUT -fi - -cd $TP_SRC - -# concurrent queue -# from: https://codeload.github.com/cameron314/concurrentqueue/tar.gz/v1.0.1 -CONCURRENT_QUEUE_NAME=concurrentqueue-1.0.1 -CONCURRENT_QUEUE_PKG=${CONCURRENT_QUEUE_NAME}.tar.gz -check_and_download "${CONCURRENT_QUEUE_PKG}"\ - "${OSS_URL_PREFIX}/${CONCURRENT_QUEUE_PKG}"\ - "80016b584fddffd67073349efd7b8958"\ - "${CONCURRENT_QUEUE_NAME}" -exit_if_fail $? - -# readwrite queue -# from: https://codeload.github.com/cameron314/readerwriterqueue/tar.gz/v1.0.2 -READERWRITER_QUEUE_NAME=readerwriterqueue-1.0.2 -READERWRITER_QUEUE_PKG=${READERWRITER_QUEUE_NAME}.tar.gz -check_and_download "${READERWRITER_QUEUE_PKG}"\ - "${OSS_URL_PREFIX}/${READERWRITER_QUEUE_PKG}"\ - "9e355a2660bd2810cb1874fb7366906e"\ - "${READERWRITER_QUEUE_NAME}" -exit_if_fail $? - -# googletest -# from: https://codeload.github.com/google/googletest/tar.gz/release-1.8.0 -GOOGLETEST_NAME=googletest-release-1.8.0 -GOOGLETEST_PKG=${GOOGLETEST_NAME}.tar.gz -check_and_download "${GOOGLETEST_PKG}"\ - "${OSS_URL_PREFIX}/${GOOGLETEST_PKG}"\ - "16877098823401d1bf2ed7891d7dce36"\ - "${GOOGLETEST_NAME}" -exit_if_fail $? - -# gperftools -# from: https://github.com/gperftools/gperftools/releases/download/gperftools-2.7/gperftools-2.7.tar.gz -GPERFTOOLS_NAME=gperftools-2.7 -GPERFTOOLS_PKG=${GPERFTOOLS_NAME}.tar.gz -check_and_download "${GPERFTOOLS_PKG}"\ - "${OSS_URL_PREFIX}/${GPERFTOOLS_PKG}"\ - "c6a852a817e9160c79bdb2d3101b4601"\ - "${GPERFTOOLS_NAME}" -exit_if_fail $? - -# rapidjson -# from: https://codeload.github.com/Tencent/rapidjson/tar.gz/v1.1.0 -RAPIDJSON_NAME=rapidjson-1.1.0 -RAPIDJSON_PKG=${RAPIDJSON_NAME}.tar.gz -check_and_download "${RAPIDJSON_PKG}"\ - "${OSS_URL_PREFIX}/${RAPIDJSON_PKG}"\ - "badd12c511e081fec6c89c43a7027bce"\ - "${RAPIDJSON_NAME}" -exit_if_fail $? - -# thrift 0.9.3 -# from: http://archive.apache.org/dist/thrift/0.9.3/thrift-0.9.3.tar.gz -THRIFT_NAME=thrift-0.9.3 -THRIFT_PKG=${THRIFT_NAME}.tar.gz -check_and_download "${THRIFT_PKG}"\ - "${OSS_URL_PREFIX}/${THRIFT_PKG}"\ - "88d667a8ae870d5adeca8cb7d6795442"\ - "${THRIFT_NAME}" -ret_code=$? -if [ $ret_code -eq 2 ]; then - exit 2 -elif [ $ret_code -eq 0 ]; then - echo "make patch to thrift" - cd thrift-0.9.3 - patch -p1 < ../../fix_thrift_for_cpp11.patch - if [ $? != 0 ]; then - echo "ERROR: patch fix_thrift_for_cpp11.patch for thrift failed" - exit 2 - fi - cd .. -fi - -# zookeeper c client -# from: http://ftp.jaist.ac.jp/pub/apache/zookeeper/zookeeper-3.4.10/zookeeper-3.4.10.tar.gz -ZOOKEEPER_NAME=zookeeper-3.4.10 -ZOOKEEPER_PKG=${ZOOKEEPER_NAME}.tar.gz -check_and_download "${ZOOKEEPER_PKG}"\ - "${OSS_URL_PREFIX}/${ZOOKEEPER_PKG}"\ - "e4cf1b1593ca870bf1c7a75188f09678"\ - "${ZOOKEEPER_NAME}" -exit_if_fail $? - -# libevent -# from: https://github.com/libevent/libevent/archive/release-2.1.8-stable.tar.gz -LIBEVENT_NAME=libevent-release-2.1.8-stable -LIBEVENT_PKG=${LIBEVENT_NAME}.tar.gz -check_and_download "${LIBEVENT_PKG}"\ - "${OSS_URL_PREFIX}/${LIBEVENT_PKG}"\ - "80f8652e4b08d2ec86a5f5eb46b74510"\ - "${LIBEVENT_NAME}" -exit_if_fail $? - -# poco 1.7.8 -# from: https://codeload.github.com/pocoproject/poco/tar.gz/poco-1.7.8-release -POCO_NAME=poco-poco-1.7.8-release -POCO_PKG=${POCO_NAME}.tar.gz -check_and_download "${POCO_PKG}"\ - "${OSS_URL_PREFIX}/${POCO_PKG}"\ - "4dbf02e14b9f20940ca0e8c70d8f6036"\ - "${POCO_NAME}" -exit_if_fail $? - -# fds -if [ ! -d $TP_SRC/fds ]; then - git clone https://github.com/XiaoMi/galaxy-fds-sdk-cpp.git - if [ $? != 0 ]; then - echo "ERROR: download fds wrong" - exit 2 - fi - echo "mv galaxy-fds-sdk-cpp fds" - mv galaxy-fds-sdk-cpp fds -else - echo "fds has already downloaded, skip it" -fi - -# fmtlib -# from: https://codeload.github.com/fmtlib/fmt/tar.gz/4.0.0 -FMTLIB_NAME=fmt-4.0.0 -FMTLIB_PKG=${FMTLIB_NAME}.tar.gz -check_and_download "${FMTLIB_PKG}"\ - "${OSS_URL_PREFIX}/${FMTLIB_PKG}"\ - "c9be9a37bc85493d1116b0af59a25eba"\ - "${FMTLIB_NAME}" -exit_if_fail $? - -# gflags -# from: https://github.com/gflags/gflags/archive/v2.2.1.zip -GFLAGS_NAME=gflags-2.2.1 -GFLAGS_PKG=${GFLAGS_NAME}.zip -check_and_download "${GFLAGS_PKG}"\ - "${OSS_URL_PREFIX}/${GFLAGS_PKG}"\ - "2d988ef0b50939fb50ada965dafce96b"\ - "${GFLAGS_NAME}" -exit_if_fail $? - -# civetweb -# from: https://codeload.github.com/civetweb/civetweb/tar.gz/v1.11 -CIVETWEB_NAME=civetweb-1.11 -CIVETWEB_PKG=${CIVETWEB_NAME}.tar.gz -check_and_download "${CIVETWEB_PKG}"\ - "${OSS_URL_PREFIX}/${CIVETWEB_PKG}"\ - "b6d2175650a27924bccb747cbe084cd4"\ - "${CIVETWEB_NAME}" -exit_if_fail $? - -# prometheus-cpp -# from: https://codeload.github.com/jupp0r/prometheus-cpp/tar.gz/v0.7.0 -PROMETHEUS_NAME=prometheus-cpp-0.7.0 -PROMETHEUS_PKG=${PROMETHEUS_NAME}.tar.gz -check_and_download "${PROMETHEUS_PKG}"\ - "${OSS_URL_PREFIX}/${PROMETHEUS_PKG}"\ - "dc75c31ceaefd160e978365bdca8eb01"\ - "${PROMETHEUS_NAME}" -exit_if_fail $? - -rm -rf $TP_SRC/prometheus-cpp-0.7.0/3rdparty/civetweb -cp -r $TP_SRC/civetweb-1.11 $TP_SRC/prometheus-cpp-0.7.0/3rdparty/ -cd $TP_SRC/prometheus-cpp-0.7.0/3rdparty -mv civetweb-1.11 civetweb -cd $TP_SRC - -# curl -# from: http://curl.haxx.se/download/curl-7.47.0.tar.gz -CURL_NAME=curl-7.47.0 -CURL_PKG=${CURL_NAME}.tar.gz -check_and_download "${CURL_PKG}"\ - "${OSS_URL_PREFIX}/${CURL_PKG}"\ - "5109d1232d208dfd712c0272b8360393"\ - "${CURL_NAME}" -exit_if_fail $? - -# nlohmann_json -# from: https://github.com/nlohmann/json/releases/download/v3.7.3/include.zip -NLOHMANN_JSON_NAME=nlohmann_json-3.7.3 -NLOHMANN_JSON_PKG=${NLOHMANN_JSON_NAME}.zip -check_and_download "${NLOHMANN_JSON_PKG}" \ - "${OSS_URL_PREFIX}/${NLOHMANN_JSON_PKG}" \ - "7249387593792b565dcb30d87bca0de3" \ - "${NLOHMANN_JSON_NAME}" - -# s2geometry -# from: https://github.com/google/s2geometry/archive/0239455c1e260d6d2c843649385b4fb9f5b28dba.zip -S2GEOMETRY_NAME=s2geometry-0239455c1e260d6d2c843649385b4fb9f5b28dba -S2GEOMETRY_PKG=${S2GEOMETRY_NAME}.zip -check_and_download "${S2GEOMETRY_PKG}" \ - "${OSS_URL_PREFIX}/${S2GEOMETRY_PKG}" \ - "bfa5f1c08f535a72fb2c92ec16332c64" \ - "${S2GEOMETRY_NAME}" - -# rocksdb -# from: https://github.com/XiaoMi/pegasus-rocksdb/archive/v6.6.4-compatible.zip -ROCKSDB_NAME=pegasus-rocksdb-6.6.4-compatible -ROCKSDB_PKG=${ROCKSDB_NAME}.zip -check_and_download "${ROCKSDB_PKG}" \ - "${OSS_URL_PREFIX}/${ROCKSDB_PKG}" \ - "595b21fbe681dcf126c4cccda46f1cbb" \ - "${ROCKSDB_NAME}" - -ret_code=$? -if [ $ret_code -eq 2 ]; then - exit 2 -elif [ $ret_code -eq 0 ]; then - echo "make patch to s2geometry" - cd s2geometry-0239455c1e260d6d2c843649385b4fb9f5b28dba - patch -p1 < ../../fix_s2_for_pegasus.patch - if [ $? != 0 ]; then - echo "ERROR: patch fix_s2_for_pegasus.patch for s2geometry failed" - exit 2 - fi - cd .. -fi - -cd $TP_DIR