Skip to content

Commit

Permalink
Fixed the build (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
sherman-the-tank authored Sep 7, 2018
1 parent cd7f07d commit dfbddf5
Show file tree
Hide file tree
Showing 33 changed files with 98 additions and 50 deletions.
8 changes: 7 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,20 @@ find_package(PCHSupport)
add_compile_options(-Winvalid-pch)

include_directories(SYSTEM ${VGRAPH_HOME}/third-party/_build/include)
include_directories(SYSTEM ${VGRAPH_HOME}/third-party/_build/compression/include)
include_directories(SYSTEM ${Boost_INCLUDE_DIRS})
include_directories(SYSTEM ${OPENSSL_INCLUDE_DIR})
include_directories(SYSTEM ${KRB5_INCLUDE_DIRS})
include_directories(AFTER common)
include_directories(AFTER interface)
include_directories(AFTER ${VGRAPH_HOME})

link_directories(third-party/_build/lib ${Boost_LIBRARY_DIRS} ${KRB5_LIBRARY_DIRS})
link_directories(
third-party/_build/lib
third-party/_build/compression/lib
${Boost_LIBRARY_DIRS}
${KRB5_LIBRARY_DIRS}
)

# All thrift libraries
set(THRIFT_LIBRARIES
Expand Down
1 change: 0 additions & 1 deletion client/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
add_custom_target(
client ALL
DEPENDS base_obj vgraph_thrift_obj
)

add_subdirectory(cpp)
7 changes: 5 additions & 2 deletions client/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
add_library(client_cpp_obj OBJECT GraphDbClient.cpp)

add_dependencies(client_cpp_obj vgraph_thrift_obj)
add_dependencies(
client_cpp_obj
base_obj
vgraph_thrift_obj
)

#add_subdirectory(test)

Expand Down
2 changes: 1 addition & 1 deletion third-party/bzip2/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
add_custom_target(
tgt_bzip2
COMMAND "./build.sh" "-j16" ">" "./_build.log" "2>&1"
COMMAND "./build.sh" "-j2" ">" "./_build.log" "2>&1"
)

add_custom_target(
Expand Down
2 changes: 1 addition & 1 deletion third-party/bzip2/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

source ../functions.sh

prepareBuild "bzip2"
prepareBuild "bzip2" "" "/compression"

echo
echo Start building $PROJECT_NAME with gcc-$GCC_VER
Expand Down
2 changes: 1 addition & 1 deletion third-party/double-conversion/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
add_custom_target(
tgt_double-conversion
COMMAND "./build.sh" "-j16" ">" "./_build.log" "2>&1"
COMMAND "./build.sh" "-j2" ">" "./_build.log" "2>&1"
)

add_custom_target(
Expand Down
3 changes: 2 additions & 1 deletion third-party/double-conversion/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ cd $SOURCE_DIR

COMPILE_FLAGS="-fPIC -DPIC -std=c++11 $EXTRA_CXXFLAGS "

if [[ $SOURCE_DIR/CMakeLists.txt -nt $SOURCE_DIR/Makefile ]]; then
if [[ $SOURCE_DIR/CMakeLists.txt -nt $SOURCE_DIR/Makefile ||
$CURR_DIR/build.sh -nt $SOURCE_DIR/Makefile ]]; then
if !($CMAKE_ROOT/bin/cmake $CMAKE_FLAGS -DCMAKE_CXX_FLAGS:STRING="$COMPILE_FLAGS" -DCMAKE_CC_FLAGS:STRING="$COMPILE_FLAGS" -DCMAKE_CPP_FLAGS:STRING="$COMPILE_FLAGS" -DCMAKE_STATIC_LINKER_FLAGS:STRING="" -DCMAKE_LINK_LIBRARY_FLAG="-static-libgcc -static-libstdc++ -lrt" $SOURCE_DIR); then
cd $CURR_DIR
echo
Expand Down
2 changes: 1 addition & 1 deletion third-party/fatal/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
add_custom_target(
tgt_fatal
COMMAND "./build.sh" "-j16" ">" "./_build.log" "2>&1"
COMMAND "./build.sh" "-j2" ">" "./_build.log" "2>&1"
)

add_custom_target(
Expand Down
7 changes: 5 additions & 2 deletions third-party/fbthrift/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,13 @@ cd $SOURCE_DIR
COMPILER_FLAGS="-fPIC -DPIC -I$OPENSSL_RELEASE/include -I$KRB_RELEASE/include -I$INSTALL_PATH/include $EXTRA_CXXFLAGS"
LINKER_FLAGS="-static-libgcc -static-libstdc++ -L$KRB_RELEASE/lib -L$LIBUNWIND_RELEASE/lib -L$INSTALL_PATH/lib $EXTRA_LDFLAGS"
INCLUDE_DIR=$INSTALL_PATH/include
COMPRESS_INCLUDE_DIR=$INSTALL_PATH/compression/include
LIB_DIR=$INSTALL_PATH/lib
COMPRESS_LIB_DIR=$INSTALL_PATH/compression/lib

if [[ $SOURCE_DIR/CMakeLists.txt -nt $SOURCE_DIR/Makefile ]]; then
if !($CMAKE_ROOT/bin/cmake $CMAKE_FLAGS -DCMAKE_C_FLAGS:STRING="$COMPILER_FLAGS" -DCMAKE_CXX_FLAGS:STRING="$COMPILER_FLAGS" -DCMAKE_STATIC_LINKER_FLAGS:STRING="" -DCMAKE_EXE_LINKER_FLAGS:STRING="$LINKER_FLAGS" -DOPENSSL_INCLUDE_DIR=$OPENSSL_RELEASE/include -DOPENSSL_SSL_LIBRARY=$OPENSSL_RELEASE/lib/libssl.a -DOPENSSL_CRYPTO_LIBRARY=$OPENSSL_RELEASE/lib/libcrypto.a -DBOOST_ROOT=$BOOST_RELEASE -DBoost_USE_STATIC_LIBS:BOOL=YES -DMSTCH_INCLUDE_DIRS=$INCLUDE_DIR -DMSTCH_LIBRARIES=$LIB_DIR/libmstch.a -DDOUBLE_CONVERSION_INCLUDE_DIR=$INCLUDE_DIR -DDOUBLE_CONVERSION_LIBRARY=$LIB_DIR -DFOLLY_ROOT=$INSTALL_PATH -DGFLAGS_INCLUDE_DIR=$INCLUDE_DIR -DGFLAGS_LIBRARY=$LIB_DIR -DGLOG_INCLUDE_DIRS=$INCLUDE_DIR -DGLOG_LIBRARIES=$LIB_DIR/libglog.a -DWANGLE_INCLUDE_DIRS=$INCLUDE_DIR -DWANGLE_LIBRARIES=$LIB_DIR/libwangle.a -DZLIB_INCLUDE_DIRS=$INCLUDE_DIR -DZLIB_LIBRARIES=$LIB_DIR/libz.a -DZSTD_INCLUDE_DIRS=$INCLUDE_DIR -DZSTD_LIBRARIES=$LIB_DIR/libzstd.a -DFLEX_EXECUTABLE=$FLEX_ROOT/bin/flex -DTHRIFT_HOME=$INSTALL_PATH $SOURCE_DIR); then
if [[ $SOURCE_DIR/CMakeLists.txt -nt $SOURCE_DIR/Makefile ||
$CURR_DIR/build.sh -nt $SOURCE_DIR/Makefile ]]; then
if !($CMAKE_ROOT/bin/cmake $CMAKE_FLAGS -DCMAKE_C_FLAGS:STRING="$COMPILER_FLAGS" -DCMAKE_CXX_FLAGS:STRING="$COMPILER_FLAGS" -DCMAKE_STATIC_LINKER_FLAGS:STRING="" -DCMAKE_EXE_LINKER_FLAGS:STRING="$LINKER_FLAGS" -DOPENSSL_INCLUDE_DIR=$OPENSSL_RELEASE/include -DOPENSSL_SSL_LIBRARY=$OPENSSL_RELEASE/lib/libssl.a -DOPENSSL_CRYPTO_LIBRARY=$OPENSSL_RELEASE/lib/libcrypto.a -DBOOST_ROOT=$BOOST_RELEASE -DBoost_USE_STATIC_LIBS:BOOL=YES -DMSTCH_INCLUDE_DIRS=$INCLUDE_DIR -DMSTCH_LIBRARIES=$LIB_DIR/libmstch.a -DDOUBLE_CONVERSION_INCLUDE_DIR=$INCLUDE_DIR -DDOUBLE_CONVERSION_LIBRARY=$LIB_DIR -DFOLLY_ROOT=$INSTALL_PATH -DGFLAGS_INCLUDE_DIR=$INCLUDE_DIR -DGFLAGS_LIBRARY=$LIB_DIR -DGLOG_INCLUDE_DIRS=$INCLUDE_DIR -DGLOG_LIBRARIES=$LIB_DIR/libglog.a -DWANGLE_INCLUDE_DIRS=$INCLUDE_DIR -DWANGLE_LIBRARIES=$LIB_DIR/libwangle.a -DZLIB_INCLUDE_DIRS=$COMPRESS_INCLUDE_DIR -DZLIB_LIBRARIES=$COMPRESS_LIB_DIR/libz.a -DZSTD_INCLUDE_DIRS=$COMPRESS_INCLUDE_DIR -DZSTD_LIBRARIES=$COMPRESS_LIB_DIR/libzstd.a -DFLEX_EXECUTABLE=$FLEX_ROOT/bin/flex -DTHRIFT_HOME=$INSTALL_PATH $SOURCE_DIR); then
cd $CURR_DIR
echo
echo "### $PROJECT_NAME failed to configure the build ###"
Expand Down
12 changes: 8 additions & 4 deletions third-party/folly/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,17 @@ echo

cd $SOURCE_DIR

COMPILER_FLAGS="-fPIC -DPIC -DFOLLY_HAVE_LIBDWARF_DWARF_H -DFOLLY_HAVE_LIBZSTD -I$INSTALL_PATH/include $EXTRA_CXXFLAGS"
EXE_LINKER_FLAGS="-static-libgcc -static-libstdc++ -L$LIBUNWIND_RELEASE/lib -L$INSTALL_PATH/lib $EXTRA_LDFLAGS"
INCLUDE_DIR=$INSTALL_PATH/include
COMPRESS_INCLUDE_DIR=$INSTALL_PATH/compression/include
LIB_DIR=$INSTALL_PATH/lib
COMPRESS_LIB_DIR=$INSTALL_PATH/compression/lib

if [[ $SOURCE_DIR/CMakeLists.txt -nt $SOURCE_DIR/Makefile ]]; then
if !($CMAKE_ROOT/bin/cmake $CMAKE_FLAGS -DCMAKE_C_FLAGS:STRING="$COMPILER_FLAGS" -DCMAKE_CXX_FLAGS:STRING="$COMPILER_FLAGS" -DCMAKE_EXE_LINKER_FLAGS:STRING="$EXE_LINKER_FLAGS" -DOPENSSL_INCLUDE_DIR=$OPENSSL_RELEASE/include -DOPENSSL_SSL_LIBRARY=$OPENSSL_RELEASE/lib/libssl.a -DOPENSSL_CRYPTO_LIBRARY=$OPENSSL_RELEASE/lib/libcrypto.a -DBOOST_ROOT=$BOOST_RELEASE -DBoost_USE_STATIC_LIBS:BOOL=YES -DDOUBLE_CONVERSION_INCLUDE_DIR=$INCLUDE_DIR -DDOUBLE_CONVERSION_LIBRARY=$LIB_DIR/libdouble-conversion.a -DLIBEVENT_INCLUDE_DIR=$INCLUDE_DIR -DLIBEVENT_LIB=$LIB_DIR/libevent.a -DGFLAGS_INCLUDE_DIR=$INCLUDE_DIR -DGFLAGS_LIBRARY=$LIB_DIR/libgflags.a -DLIBGLOG_INCLUDE_DIR=$INCLUDE_DIR -DLIBGLOG_LIBRARY=$LIB_DIR/libglog.a -DZLIB_INCLUDE_DIRS=$INCLUDE_DIR -DZLIB_LIBRARIES=$LIB_DIR/libz.a -DZSTD_INCLUDE_DIRS=$INCLUDE_DIR -DZSTD_LIBRARIES=$LIB_DIR/libzstd.a $SOURCE_DIR); then
COMPILER_FLAGS="-fPIC -DPIC -DFOLLY_HAVE_LIBDWARF_DWARF_H -DFOLLY_HAVE_LIBZSTD -I$INCLUDE_DIR $EXTRA_CXXFLAGS"
EXE_LINKER_FLAGS="-static-libgcc -static-libstdc++ -L$LIBUNWIND_RELEASE/lib -L$LIB_DIR $EXTRA_LDFLAGS"

if [[ $SOURCE_DIR/CMakeLists.txt -nt $SOURCE_DIR/Makefile ||
$CURR_DIR/build.sh -nt $SOURCE_DIR/Makefile ]]; then
if !($CMAKE_ROOT/bin/cmake $CMAKE_FLAGS -DCMAKE_C_FLAGS:STRING="$COMPILER_FLAGS" -DCMAKE_CXX_FLAGS:STRING="$COMPILER_FLAGS" -DCMAKE_EXE_LINKER_FLAGS:STRING="$EXE_LINKER_FLAGS" -DOPENSSL_INCLUDE_DIR=$OPENSSL_RELEASE/include -DOPENSSL_SSL_LIBRARY=$OPENSSL_RELEASE/lib/libssl.a -DOPENSSL_CRYPTO_LIBRARY=$OPENSSL_RELEASE/lib/libcrypto.a -DBOOST_ROOT=$BOOST_RELEASE -DBoost_USE_STATIC_LIBS:BOOL=YES -DDOUBLE_CONVERSION_INCLUDE_DIR=$INCLUDE_DIR -DDOUBLE_CONVERSION_LIBRARY=$LIB_DIR/libdouble-conversion.a -DLIBEVENT_INCLUDE_DIR=$INCLUDE_DIR -DLIBEVENT_LIB=$LIB_DIR/libevent.a -DGFLAGS_INCLUDE_DIR=$INCLUDE_DIR -DGFLAGS_LIBRARY=$LIB_DIR/libgflags.a -DLIBGLOG_INCLUDE_DIR=$INCLUDE_DIR -DLIBGLOG_LIBRARY=$LIB_DIR/libglog.a -DZLIB_INCLUDE_DIR=$COMPRESS_INCLUDE_DIR -DZLIB_LIBRARY=$COMPRESS_LIB_DIR/libz.a -DZSTD_INCLUDE_DIR=$COMPRESS_INCLUDE_DIR -DZSTD_LIBRARY=$COMPRESS_LIB_DIR/libzstd.a -DSNAPPY_INCLUDE_DIR=$COMPRESS_INCLUDE_DIR -DSNAPPY_LIBRARY=$COMPRESS_LIB_DIR/libsnappy.a $SOURCE_DIR); then
cd $CURR_DIR
echo
echo "### $PROJECT_NAME failed to configure the build ###"
Expand Down
20 changes: 18 additions & 2 deletions third-party/functions.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
#!/bin/sh

# The method takes up to three parameters
# 1st: Project name
# 2nd: source directory. It must be a sub-directory of
# the default source path "_build/${project_name}"
# If specified, it must start with "/", so that it can
# be appended to the default source path
# 3rd: install_dir. It must be a sub-directory of the default
# install path "third-party/_build"
# If specified, it must start with "/", so that it can
# be appended to the default source path
function prepareBuild() {
# Make sure the script is executed from the source directory
CURR_DIR=`dirname $0`
Expand All @@ -15,11 +25,17 @@ function prepareBuild() {
local prj_name=$1

if [[ $# > 1 ]]; then
local src_dir="/$2"
local src_dir=$2
else
local src_dir=""
fi

if [[ $# > 2 ]]; then
local install_dir=$3
else
local install_dir=""
fi

CURR_DIR=`pwd`
THIRD_PARTY_DIR=`cd .. && pwd`
TOOLS_ROOT=/home/engshare
Expand All @@ -33,7 +49,7 @@ function prepareBuild() {
tar -zxf ../$SOURCE_TAR_BALL_NAME --keep-newer-files 2> /dev/null

SOURCE_DIR=${BUILD_PATH}/${PROJECT_NAME}${src_dir}
INSTALL_PATH=$THIRD_PARTY_DIR/_build
INSTALL_PATH=$THIRD_PARTY_DIR/_build${install_dir}

GCC_ROOT=$TOOLS_ROOT/gcc
CMAKE_ROOT=$TOOLS_ROOT/cmake
Expand Down
2 changes: 1 addition & 1 deletion third-party/gflags/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
add_custom_target(
tgt_gflags
COMMAND "./build.sh" "-j16" ">" "./_build.log" "2>&1"
COMMAND "./build.sh" "-j2" ">" "./_build.log" "2>&1"
)

add_custom_target(
Expand Down
3 changes: 2 additions & 1 deletion third-party/gflags/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ echo

cd $SOURCE_DIR

if [[ $SOURCE_DIR/CMakeLists.txt -nt $SOURCE_DIR/Makefile ]]; then
if [[ $SOURCE_DIR/CMakeLists.txt -nt $SOURCE_DIR/Makefile ||
$CURR_DIR/build.sh -nt $SOURCE_DIR/Makefile ]]; then
if !($CMAKE_ROOT/bin/cmake $CMAKE_FLAGS -DCMAKE_CXX_FLAGS:STRING="-fPIC -DPIC $EXTRA_CXXFLAGS " -DCMAKE_CC_FLAGS:STRING="-fPIC -DPIC $EXTRA_CXXFLAGS " -DCMAKE_CPP_FLAGS:STRING="-fPIC -DPIC $EXTRA_CXXFLAGS " -DCMAKE_STATIC_LINKER_FLAGS:STRING="" -DCMAKE_LINK_LIBRARY_FLAG="-static-libgcc -static-libstdc++ -lrt" $SOURCE_DIR); then
cd $CURR_DIR
echo
Expand Down
2 changes: 1 addition & 1 deletion third-party/glog/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
add_custom_target(
tgt_glog
COMMAND "./build.sh" "-j16" ">" "./_build.log" "2>&1"
COMMAND "./build.sh" "-j2" ">" "./_build.log" "2>&1"
DEPENDS tgt_gflags tgt_libevent tgt_double-conversion
)

Expand Down
3 changes: 2 additions & 1 deletion third-party/glog/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ if [[ $SOURCE_DIR/configure.ac -nt $SOURCE_DIR/configure ]]; then
fi
fi

if [[ $SOURCE_DIR/configure -nt $SOURCE_DIR/Makefile ]]; then
if [[ $SOURCE_DIR/configure -nt $SOURCE_DIR/Makefile ||
$CURR_DIR/build.sh -nt $SOURCE_DIR/Makefile ]]; then
if !(CC=$GCC_ROOT/bin/gcc CPP=$GCC_ROOT/bin/cpp CXX=$GCC_ROOT/bin/g++ CXXFLAGS="-fPIC -DPIC -DHAVE_LIB_GFLAGS -I$INSTALL_PATH/include $EXTRA_CXXFLAGS" CFLAGS=$CXXFLAGS CPPFLAGS=$CXXFLAGS LDFLAGS="-static-libgcc -static-libstdc++ -L$INSTALL_PATH/lib $EXTRA_LDFLAGS" LIBS="-lgflags" $SOURCE_DIR/configure --prefix=$INSTALL_PATH --enable-shared=no); then
cd $CURR_DIR
echo
Expand Down
2 changes: 1 addition & 1 deletion third-party/googletest/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
add_custom_target(
tgt_googletest
COMMAND "./build.sh" "-j16" ">" "./_build.log" "2>&1"
COMMAND "./build.sh" "-j2" ">" "./_build.log" "2>&1"
DEPENDS tgt_gflags tgt_glog
)

Expand Down
4 changes: 3 additions & 1 deletion third-party/googletest/build-gmock.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ if [[ $SOURCE_DIR/configure.ac -nt $SOURCE_DIR/configure ]]; then
fi
fi

if [[ $SOURCE_DIR/configure -nt $SOURCE_DIR/Makefile ]]; then
if [[ $SOURCE_DIR/configure -nt $SOURCE_DIR/Makefile ||
$CURR_DIR/build.sh -nt $SOURCE_DIR/Makefile ||
$CURR_DIR/build-gmock.sh -nt $SOURCE_DIR/Makefile ]]; then
if !(CC=$GCC_ROOT/bin/gcc CPP=$GCC_ROOT/bin/cpp CXX=$GCC_ROOT/bin/g++ CXXFLAGS="-fPIC -DPIC -DHAVE_LIB_GFLAGS -std=c++11 -I$INSTALL_PATH/include $EXTRA_CXXFLAGS" CFLAGS=$CXXFLAGS CPPFLAGS=$CXXFLAGS LDFLAGS="-static-libgcc -static-libstdc++ -L$INSTALL_PATH/lib $EXTRA_LDFLAGS" $SOURCE_DIR/configure --prefix=$INSTALL_PATH --with-gnu-ld); then
cd $CURR_DIR
echo
Expand Down
4 changes: 3 additions & 1 deletion third-party/googletest/build-gtest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ if [[ $SOURCE_DIR/configure.ac -nt $SOURCE_DIR/configure ]]; then
fi
fi

if [[ $SOURCE_DIR/configure -nt $SOURCE_DIR/Makefile ]]; then
if [[ $SOURCE_DIR/configure -nt $SOURCE_DIR/Makefile ||
$CURR_DIR/build.sh -nt $SOURCE_DIR/Makefile ||
$CURR_DIR/build-gtest.sh -nt $SOURCE_DIR/Makefile ]]; then
if !(CC=$GCC_ROOT/bin/gcc CPP=$GCC_ROOT/bin/cpp CXX=$GCC_ROOT/bin/g++ CXXFLAGS="-fPIC -DPIC -DHAVE_LIB_GFLAGS -std=c++11 -I$INSTALL_PATH/include $EXTRA_CXXFLAGS" CFLAGS=$CXXFLAGS CPPFLAGS=$CXXFLAGS LDFLAGS="-static-libgcc -static-libstdc++ -L$INSTALL_PATH/lib $EXTRA_LDFLAGS" $SOURCE_DIR/configure --prefix=$INSTALL_PATH --with-gnu-ld); then
cd $CURR_DIR
echo
Expand Down
2 changes: 1 addition & 1 deletion third-party/jemalloc/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
add_custom_target(
tgt_jemalloc
COMMAND "./build.sh" "-j16" ">" "./_build.log" "2>&1"
COMMAND "./build.sh" "-j2" ">" "./_build.log" "2>&1"
)

add_custom_target(
Expand Down
3 changes: 2 additions & 1 deletion third-party/jemalloc/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ echo

cd $SOURCE_DIR

if [[ $SOURCE_DIR/configure.ac -nt $SOURCE_DIR/Makefile ]]; then
if [[ $SOURCE_DIR/configure.ac -nt $SOURCE_DIR/Makefile ||
$CURR_DIR/build.sh -nt $SOURCE_DIR/Makefile ]]; then
if !(CC=$GCC_ROOT/bin/gcc CPP=$GCC_ROOT/bin/cpp CXX=$GCC_ROOT/bin/g++ CXXFLAGS="-fPIC -DPIC -I$LIBUNWIND_RELEASE/include $EXTRA_CXXFLAGS" CFLAGS=$CXXFLAGS LDFLAGS="-static-libgcc -static-libstdc++ -L$LIBUNWIND_RELEASE/lib $EXTRA_LDFLAGS" $SOURCE_DIR/autogen.sh --enable-autogen --disable-valgrind --enable-stats --enable-prof --enable-prof-libunwind --with-static-libunwind=$LIBUNWIND_RELEASE/lib/libunwind.a --enable-prof-gcc --enable-prof-libgcc --prefix=$INSTALL_PATH); then
cd $CURR_DIR
echo
Expand Down
2 changes: 1 addition & 1 deletion third-party/libevent/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
add_custom_target(
tgt_libevent
COMMAND "./build.sh" "-j16" ">" "./_build.log" "2>&1"
COMMAND "./build.sh" "-j2" ">" "./_build.log" "2>&1"
)

add_custom_target(
Expand Down
3 changes: 2 additions & 1 deletion third-party/libevent/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ echo

cd $SOURCE_DIR

if [[ $SOURCE_DIR/configure -nt $SOURCE_DIR/Makefile ]]; then
if [[ $SOURCE_DIR/configure -nt $SOURCE_DIR/Makefile ||
$CURR_DIR/build.sh -nt $SOURCE_DIR/Makefile ]]; then
if !(CC=$GCC_ROOT/bin/gcc CPP=$GCC_ROOT/bin/cpp CXX=$GCC_ROOT/bin/g++ CXXFLAGS="-fPIC -DPIC $EXTRA_CXXFLAGS" CFLAGS=$CXXFLAGS CPPFLAGS=$CXXFLAGS LDFLAGS="-static-libgcc -static-libstdc++ $EXTRA_LDFLAGS" $SOURCE_DIR/configure --prefix=$INSTALL_PATH --enable-shared=no); then
cd $CURR_DIR
echo
Expand Down
2 changes: 1 addition & 1 deletion third-party/mstch/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
add_custom_target(
tgt_mstch
COMMAND "./build.sh" "-j16" ">" "./_build.log" "2>&1"
COMMAND "./build.sh" "-j2" ">" "./_build.log" "2>&1"
)

add_custom_target(
Expand Down
3 changes: 2 additions & 1 deletion third-party/mstch/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ cd $SOURCE_DIR
CXXFLAGS="-fPIC -DPIC -I$INSTALL_PATH/include -I$BOOST_RELEASE/include $EXTRA_CXXFLAGS"
LDFLAGS="-static-libgcc -static-libstdc++ -L$INSTALL_PATH/lib -L$OPENSSL_RELEASE/lib -L$LIBUNWIND_RELEASE/lib -L$BOOST_RELEASE/lib $EXTRA_LDFLAGS -lboost_context -lboost_chrono -lboost_thread -lboost_system -lboost_regex -levent -lunwind -ldl -lrt"

if [[ $SOURCE_DIR/CMakeLists.txt -nt $SOURCE_DIR/Makefile ]]; then
if [[ $SOURCE_DIR/CMakeLists.txt -nt $SOURCE_DIR/Makefile ||
$CURR_DIR/build.sh -nt $SOURCE_DIR/Makefile ]]; then
if !($CMAKE_ROOT/bin/cmake $CMAKE_FLAGS -DCMAKE_CXX_FLAGS:STRING="$CXXFLAGS" -DCMAKE_CC_FLAGS:STRING="$CXXFLAGS" -DCMAKE_CPP_FLAGS:STRING="$CXXFLAGS" -DCMAKE_EXE_LINKER_FLAGS="$LDFLAGS" -DBOOST_INCLUDEDIR=$BOOST_RELEASE/include -DBOOST_LIBRARYDIR=$BOOST_RELEASE/lib -DBoost_NO_SYSTEM_PATHS=ON $SOURCE_DIR/.); then
cd $CURR_DIR
echo
Expand Down
7 changes: 4 additions & 3 deletions third-party/proxygen/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

source ../functions.sh

prepareBuild "proxygen" "proxygen"
prepareBuild "proxygen" "/proxygen"

# Link the googletest
cd $SOURCE_DIR/lib/test
Expand Down Expand Up @@ -39,8 +39,9 @@ if [[ $SOURCE_DIR/configure.ac -nt $SOURCE_DIR/configure ]]; then
fi
fi

if [[ $SOURCE_DIR/configure -nt $SOURCE_DIR/Makefile ]]; then
if !(PATH=$GPERF_RELEASE/bin:$PATH CC=$GCC_ROOT/bin/gcc CPP=$GCC_ROOT/bin/cpp CXX=$GCC_ROOT/bin/g++ CXXFLAGS="-fPIC -DPIC -I$INSTALL_PATH/include -I$BOOST_RELEASE/include -I$OPENSSL_RELEASE/include $EXTRA_CXXFLAGS" CPPFLAGS=$CXXFLAGS CFLAGS=$CXXFLAGS LDFLAGS="-static-libgcc -static-libstdc++ -L$INSTALL_PATH/lib -L$BOOST_RELEASE/lib -L$OPENSSL_RELEASE/lib -L$LIBUNWIND_RELEASE/lib $EXTRA_LDFLAGS" LIBS="-ldl" $SOURCE_DIR/configure --prefix=$INSTALL_PATH --enable-shared=no); then
if [[ $SOURCE_DIR/configure -nt $SOURCE_DIR/Makefile ||
$CURR_DIR/build.sh -nt $SOURCE_DIR/Makefile ]]; then
if !(PATH=$GPERF_RELEASE/bin:$PATH CC=$GCC_ROOT/bin/gcc CPP=$GCC_ROOT/bin/cpp CXX=$GCC_ROOT/bin/g++ CXXFLAGS="-fPIC -DPIC -I$INSTALL_PATH/include -I$INSTALL_PATH/compression/include -I$BOOST_RELEASE/include -I$OPENSSL_RELEASE/include $EXTRA_CXXFLAGS" CPPFLAGS=$CXXFLAGS CFLAGS=$CXXFLAGS LDFLAGS="-static-libgcc -static-libstdc++ -L$INSTALL_PATH/lib -L$INSTALL_PATH/compression/lib -L$BOOST_RELEASE/lib -L$OPENSSL_RELEASE/lib -L$LIBUNWIND_RELEASE/lib $EXTRA_LDFLAGS" LIBS="-ldl" $SOURCE_DIR/configure --prefix=$INSTALL_PATH --enable-shared=no); then
cd $CURR_DIR
echo
echo "### $PROJECT_NAME failed to configure the build ###"
Expand Down
17 changes: 10 additions & 7 deletions third-party/rocksdb/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,18 @@ echo

cd $SOURCE_DIR

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
if [[ $SOURCE_DIR/CMakeLists.txt -nt $SOURCE_DIR/Makefile ||
$CURR_DIR/build.sh -nt $SOURCE_DIR/Makefile ]]; then
if !($CMAKE_ROOT/bin/cmake $CMAKE_FLAGS -DBOOST_ROOT=$TOOLS_ROOT/boost -DOPENSSL_ROOT_DIR=$TOOLS_ROOT/openssl -DWITH_TESTS=off .); then
cd $CURR_DIR
echo
echo "### $PROJECT_NAME failed to install ###"
echo
exit 1
fi
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 (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/compression/include $EXTRA_CXXFLAGS" CXXFLAGS=$CCFLAGS PLATFORM_LDFLAGS="-static-libstdc++ -static-libgcc -L$INSTALL_PATH/compression/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); then
Expand Down
2 changes: 1 addition & 1 deletion third-party/snappy/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
add_custom_target(
tgt_snappy
COMMAND "./build.sh" "-j16" ">" "./_build.log" "2>&1"
COMMAND "./build.sh" "-j2" ">" "./_build.log" "2>&1"
)

add_custom_target(
Expand Down
Loading

0 comments on commit dfbddf5

Please sign in to comment.