diff --git a/third-party/fbthrift/CMakeLists.txt b/third-party/fbthrift/CMakeLists.txt index a7dd60d8f6b..f4f9cde6cfc 100644 --- a/third-party/fbthrift/CMakeLists.txt +++ b/third-party/fbthrift/CMakeLists.txt @@ -1,6 +1,6 @@ add_custom_target( tgt_fbthrift - COMMAND "./build.sh" "-j16" ">" "./_build.log" "2>&1" + COMMAND "./build.sh" "-j2" ">" "./_build.log" "2>&1" DEPENDS tgt_glog tgt_gflags tgt_folly tgt_wangle tgt_fatal tgt_mstch tgt_zlib tgt_zstd ) diff --git a/third-party/folly/CMakeLists.txt b/third-party/folly/CMakeLists.txt index cfa774f7713..81c5ae364e0 100644 --- a/third-party/folly/CMakeLists.txt +++ b/third-party/folly/CMakeLists.txt @@ -1,6 +1,6 @@ add_custom_target( tgt_folly - COMMAND "./build.sh" "-j16" ">" "./_build.log" "2>&1" + COMMAND "./build.sh" "-j2" ">" "./_build.log" "2>&1" DEPENDS tgt_gflags tgt_glog tgt_zlib tgt_zstd ) diff --git a/third-party/gflags/build.sh b/third-party/gflags/build.sh index 82e8fd6874c..765efcf2ce4 100755 --- a/third-party/gflags/build.sh +++ b/third-party/gflags/build.sh @@ -30,7 +30,6 @@ fi if (make $@ install); then cd $CURR_DIR - rm -fr $INSTALL_PATH/lib/cmake echo echo ">>> $PROJECT_NAME is built and installed successfully <<<" echo diff --git a/third-party/proxygen/CMakeLists.txt b/third-party/proxygen/CMakeLists.txt index 56a2b0752ac..9405fc34521 100644 --- a/third-party/proxygen/CMakeLists.txt +++ b/third-party/proxygen/CMakeLists.txt @@ -1,6 +1,6 @@ add_custom_target( tgt_proxygen - COMMAND "./build.sh" "-j16" ">" "./_build.log" "2>&1" + COMMAND "./build.sh" "-j2" ">" "./_build.log" "2>&1" DEPENDS tgt_folly tgt_wangle tgt_gflags tgt_glog ) diff --git a/third-party/rocksdb/CMakeLists.txt b/third-party/rocksdb/CMakeLists.txt index 8de73e38b51..1c70b41cf71 100644 --- a/third-party/rocksdb/CMakeLists.txt +++ b/third-party/rocksdb/CMakeLists.txt @@ -1,6 +1,6 @@ add_custom_target( tgt_rocksdb - COMMAND "./build.sh" "-j16" ">" "./_build.log" "2>&1" + COMMAND "./build.sh" "-j2" ">" "./_build.log" "2>&1" DEPENDS tgt_bzip2 tgt_snappy tgt_zlib tgt_zstd ) diff --git a/third-party/rocksdb/build.sh b/third-party/rocksdb/build.sh index d4a56c59503..60c2437bb5e 100755 --- a/third-party/rocksdb/build.sh +++ b/third-party/rocksdb/build.sh @@ -21,10 +21,18 @@ echo cd $SOURCE_DIR -if (CC=$GCC_ROOT/bin/gcc CPP=$GCC_ROOT/bin/cpp CXX=$GCC_ROOT/bin/g++ PLATFORM=OS_LINUX CCFLAGS="-DROCKSDB_PLATFORM_POSIX -DROCKSDB_SUPPORT_THREAD_LOCAL -DOS_LINUX -fno-builtin-memcmp -DZLIB -DBZIP2 -DSNAPPY -DZSTD -DROCKSDB_MALLOC_USABLE_SIZE -march=native -fPIC -DPIC -Wno-error=shadow -I$INSTALL_PATH/include -I$BOOST_RELEASE/include -I$OPENSSL_RELEASE/include $EXTRA_CXXFLAGS" CXXFLAGS=$CCFLAGS PLATFORM_LDFLAGS="-static-libstdc++ -static-libgcc -L$INSTALL_PATH/lib -L$BOOST_RELEASE/lib -L$OPENSSL_RELEASE/lib $EXTRA_LDFLAGS -lz -lbz2 -lsnappy -lzstd" JAVA_LDFLAGS=$PLATFORM_LDFLAGS INSTALL_PATH=$INSTALL_PATH DEBUG_LEVEL=0 make $@ static_lib); then +if !($CMAKE_ROOT/bin/cmake $CMAKE_FLAGS -DBOOST_ROOT=$TOOLS_ROOT/boost -DOPENSSL_ROOT_DIR=$TOOLS_ROOT/openssl .); then + cd $CURR_DIR + echo + echo "### $PROJECT_NAME failed to install ###" + echo + exit 1 +fi + +if (PLATFORM=OS_LINUX CCFLAGS="-DROCKSDB_PLATFORM_POSIX -DROCKSDB_SUPPORT_THREAD_LOCAL -DOS_LINUX -fno-builtin-memcmp -DZLIB -DBZIP2 -DSNAPPY -DZSTD -DROCKSDB_MALLOC_USABLE_SIZE -march=native -fPIC -DPIC -Wno-error=shadow -I$INSTALL_PATH/include $EXTRA_CXXFLAGS" CXXFLAGS=$CCFLAGS PLATFORM_LDFLAGS="-static-libstdc++ -static-libgcc -L$INSTALL_PATH/lib $EXTRA_LDFLAGS -lz -lbz2 -lsnappy -lzstd" JAVA_LDFLAGS=$PLATFORM_LDFLAGS DEBUG_LEVEL=0 make $@); then if [[ $SOURCE_DIR/librocksdb.a -nt $INSTALL_PATH/lib/librocksdb.a ]]; then echo "===> Ready to install" - if (INSTALL_PATH=$INSTALL_PATH make install-static); then + if (INSTALL_PATH=$INSTALL_PATH make install); then cd $CURR_DIR echo echo ">>> $PROJECT_NAME is built and installed successfully <<<" diff --git a/third-party/wangle/CMakeLists.txt b/third-party/wangle/CMakeLists.txt index 625b705e6a8..c5feb7c6633 100644 --- a/third-party/wangle/CMakeLists.txt +++ b/third-party/wangle/CMakeLists.txt @@ -1,6 +1,6 @@ add_custom_target( tgt_wangle - COMMAND "./build.sh" "-j16" ">" "./_build.log" "2>&1" + COMMAND "./build.sh" "-j2" ">" "./_build.log" "2>&1" DEPENDS tgt_folly tgt_libevent tgt_gflags tgt_glog tgt_double-conversion )