diff --git a/CMakeLists.txt b/CMakeLists.txt index 09b3001f504..db97c3c0e48 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,10 +18,17 @@ # ENABLE_NATIVE -- Build native client # ENABLE_TESTING -- Build unit test # -cmake_minimum_required(VERSION 3.0.0) +cmake_minimum_required(VERSION 3.5.0) project("Nebula Graph" C CXX) +# Set the project home dir +set(NEBULA_HOME ${CMAKE_CURRENT_SOURCE_DIR}) +# To include customized FindXXX.cmake modules +set(CMAKE_MODULE_PATH "${NEBULA_HOME}/cmake" ${CMAKE_MODULE_PATH}) +include(LinkerConfig) +set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libstdc++ -no-pie") + set(CMAKE_SKIP_RPATH TRUE) option(ENABLE_JEMALLOC "Whether to link jemalloc to all executables" ON) @@ -53,8 +60,7 @@ endif() set(CMAKE_CXX_STANDARD 14) set(CMAKE_CXX_STANDARD_REQUIRED ON) - -set(CMAKE_EXE_LINKER_FLAGS "-static-libstdc++ -no-pie") +set(CMAKE_CXX_EXTENSIONS OFF) # To detect if ccache available find_program(ccache_program_found "ccache") @@ -84,15 +90,31 @@ if(NOT ${CMAKE_BUILD_TYPE} STREQUAL "Debug") add_definitions(-D_FORTIFY_SOURCE=2) endif() +if(CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--compress-debug-sections=zlib") +endif() + +if(CMAKE_BUILD_TYPE STREQUAL "Debug") + if (NOT ${NEBULA_USE_LINKER} STREQUAL "gold") + # gold linker is buggy for `--gc-sections', disabled for now + add_compile_options(-ffunction-sections) + add_compile_options(-fdata-sections) + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--gc-sections") + endif() +endif() + message(STATUS "CMAKE_BUILD_TYPE = ${CMAKE_BUILD_TYPE} " "(Options are: Debug, Release, RelWithDebInfo, MinSizeRel)") -set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "_build") -set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "_build") -set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "_build") +# By default, all dynamic and static libraries will be placed at ${CMAKE_BINARY_DIR}/lib, +# while all executables at ${CMAKE_BINARY_DIR}/bin. +# But for the sake of cleanliness, all executables ending with `_test' will be placed +# at ${CMAKE_BINARY_DIR}/bin/test, while those ending with `_bm' at ${CMAKE_BINARY_DIR}/bin/bench. +# Please see `nebula_add_executable' for this rule. +set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib") +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib") +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin") -# Set the project home dir -set(NEBULA_HOME ${CMAKE_CURRENT_SOURCE_DIR}) add_definitions(-DNEBULA_HOME=${NEBULA_HOME}) # Let s2 use glog @@ -121,12 +143,22 @@ if (GIT_INFO_SHA) add_definitions(-DGIT_INFO_SHA=${GIT_INFO_SHA}) endif() -# To include customized FindXXX.cmake modules -set(CMAKE_MODULE_PATH "${NEBULA_HOME}/cmake" ${CMAKE_MODULE_PATH}) - -# When NEBULA_THIRDPARTY_ROOT is null, set default value as /opt/nebula/third-party +# The precedence to decide NEBULA_THIRDPARTY_ROOT is: +# 1. The path defined with CMake argument, i.e -DNEBULA_THIRDPARTY_ROOT=path +# 2. ${CMAKE_BINARY_DIR}/third-party/install, if exists +# 3. The path specified with environment variable NEBULA_THIRDPARTY_ROOT=path +# 4. /opt/vesoft/third-party, if exists +# 5. At last, one copy will be downloaded and installed to ${CMAKE_BINARY_DIR}/third-party/install if("${NEBULA_THIRDPARTY_ROOT}" STREQUAL "") - SET(NEBULA_THIRDPARTY_ROOT "/opt/nebula/third-party") + if(EXISTS ${CMAKE_BINARY_DIR}/third-party/install) + SET(NEBULA_THIRDPARTY_ROOT ${CMAKE_BINARY_DIR}/third-party/install) + elseif(NOT $ENV{NEBULA_THIRDPARTY_ROOT} STREQUAL "") + SET(NEBULA_THIRDPARTY_ROOT $ENV{NEBULA_THIRDPARTY_ROOT}) + elseif(EXISTS /opt/vesoft/third-party) + SET(NEBULA_THIRDPARTY_ROOT "/opt/vesoft/third-party") + else() + include(InstallThirdParty) + endif() endif() if ("${NEBULA_CLANG_USED_GCC_TOOLCHAIN}" STREQUAL "") @@ -190,6 +222,7 @@ find_package(Krb5 REQUIRED gssapi) find_package(GPERF 2.8 REQUIRED) find_package(Libunwind REQUIRED) find_package(BISON 3.0.5 REQUIRED) +include(MakeBisonRelocatable) find_package(FLEX REQUIRED) find_package(Readline REQUIRED) find_package(NCURSES REQUIRED) @@ -274,6 +307,18 @@ macro(nebula_add_executable) ${nebula_exec_NAME} ${nebula_exec_LIBRARIES} ) + + if(${nebula_exec_NAME} MATCHES "_test$") + set_target_properties( + ${nebula_exec_NAME} + PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/test + ) + elseif(${nebula_exec_NAME} MATCHES "_bm$") + set_target_properties( + ${nebula_exec_NAME} + PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/bench + ) + endif() endmacro() macro(nebula_add_test) @@ -364,7 +409,7 @@ set(THRIFT_LIBRARIES set(ROCKSDB_LIBRARIES ${Rocksdb_LIBRARY}) # All compression libraries -set(COMPRESSION_LIBRARIES bz2 snappy zstd z) +set(COMPRESSION_LIBRARIES bz2 snappy zstd z lz4) if (LIBLZMA_FOUND) include_directories(SYSTEM ${LIBLZMA_INCLUDE_DIRS}) list(APPEND COMPRESSION_LIBRARIES ${LIBLZMA_LIBRARIES}) @@ -404,7 +449,6 @@ macro(nebula_link_libraries target) boost_system event double-conversion - resolv s2 ${OPENSSL_SSL_LIBRARY} ${OPENSSL_CRYPTO_LIBRARY} @@ -412,6 +456,8 @@ macro(nebula_link_libraries target) ${COMPRESSION_LIBRARIES} ${JEMALLOC_LIB} ${LIBUNWIND_LIBRARIES} + keyutils + resolv dl ${GETTIME_LIB} -pthread diff --git a/cmake/BuildThirdParty.cmake b/cmake/BuildThirdParty.cmake new file mode 100644 index 00000000000..8aa5a0203da --- /dev/null +++ b/cmake/BuildThirdParty.cmake @@ -0,0 +1,7 @@ +execute_process( + COMMAND + ${CMAKE_SOURCE_DIR}/third-party/build-third-party.sh + WORKING_DIRECTORY + ${CMAKE_BINARY_DIR} +) +set(NEBULA_THIRDPARTY_ROOT ${CMAKE_BINARY_DIR}/third-party/install) diff --git a/cmake/FindDoubleConversion.cmake b/cmake/FindDoubleConversion.cmake index 3580d889ad0..cdfc87fc302 100644 --- a/cmake/FindDoubleConversion.cmake +++ b/cmake/FindDoubleConversion.cmake @@ -13,7 +13,7 @@ # DoubleConversion_INCLUDE_DIR The double-conversion includes directories. # DoubleConversion_LIBRARY The double-conversion library. -find_path(DoubleConversion_INCLUDE_DIR NAMES double-conversion.h) +find_path(DoubleConversion_INCLUDE_DIR NAMES double-conversion/double-conversion.h) find_library(DoubleConversion_LIBRARY NAMES libdouble-conversion.a) if(DoubleConversion_INCLUDE_DIR AND DoubleConversion_LIBRARY) diff --git a/cmake/InstallThirdParty.cmake b/cmake/InstallThirdParty.cmake new file mode 100644 index 00000000000..ee9fd3f397b --- /dev/null +++ b/cmake/InstallThirdParty.cmake @@ -0,0 +1,12 @@ +set(third_party_install_prefix ${CMAKE_BINARY_DIR}/third-party/install) +message(STATUS "Downloading prebuilt third party automatically...") +execute_process( + COMMAND + env CXX=${CMAKE_CXX_COMPILER} ${CMAKE_SOURCE_DIR}/third-party/install-third-party.sh --prefix=${third_party_install_prefix} + WORKING_DIRECTORY + ${CMAKE_BINARY_DIR} +) +if(EXISTS ${third_party_install_prefix}) + set(NEBULA_THIRDPARTY_ROOT ${third_party_install_prefix}) +endif() +unset(third_party_install_prefix) diff --git a/cmake/LinkerConfig.cmake b/cmake/LinkerConfig.cmake new file mode 100644 index 00000000000..5b24ce49644 --- /dev/null +++ b/cmake/LinkerConfig.cmake @@ -0,0 +1,22 @@ +execute_process( + COMMAND + ld --version + COMMAND + head -1 + COMMAND + cut -d " " -f2 + OUTPUT_VARIABLE default_linker_type + OUTPUT_STRIP_TRAILING_WHITESPACE +) + +if (${default_linker_type} STREQUAL "ld") + set(default_linker_type "bfd") +endif() + +if (NOT DEFINED NEBULA_USE_LINKER) + set(NEBULA_USE_LINKER ${default_linker_type}) +endif() + +message(STATUS "NEBULA_USE_LINKER: ${NEBULA_USE_LINKER}") +set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=${NEBULA_USE_LINKER}") +set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fuse-ld=${NEBULA_USE_LINKER}") diff --git a/cmake/MakeBisonRelocatable.cmake b/cmake/MakeBisonRelocatable.cmake new file mode 100644 index 00000000000..683c9365e13 --- /dev/null +++ b/cmake/MakeBisonRelocatable.cmake @@ -0,0 +1,17 @@ +set(BISON_EXECUTE_ENV "") +execute_process( + COMMAND ${BISON_EXECUTABLE} --print-datadir + OUTPUT_VARIABLE bison_encoded_data_dir + OUTPUT_STRIP_TRAILING_WHITESPACE +) +if(NOT EXISTS ${bison_encoded_data_dir}) + get_filename_component(bison_prefix ${BISON_EXECUTABLE} DIRECTORY) + get_filename_component(bison_prefix ${bison_prefix} DIRECTORY) + if(EXISTS ${bison_prefix}/share/bison) + set(BISON_EXECUTE_ENV "BISON_PKGDATADIR=${bison_prefix}/share/bison") + endif() +endif() +if(NOT ${BISON_EXECUTE_ENV} STREQUAL "") + set(BISON_EXECUTABLE ${CMAKE_COMMAND} -E env ${BISON_EXECUTE_ENV} ${BISON_EXECUTABLE}) +endif() + diff --git a/src/graph/GroupByExecutor.cpp b/src/graph/GroupByExecutor.cpp index 4d7a6baf863..5d558fb114a 100644 --- a/src/graph/GroupByExecutor.cpp +++ b/src/graph/GroupByExecutor.cpp @@ -390,7 +390,7 @@ Status GroupByExecutor::generateOutputSchema() { StatusOr> GroupByExecutor::setupInterimResult() { auto result = std::make_unique(getResultColumnNames()); if (rows_.empty() || resultSchema_ == nullptr) { - return result; + return std::move(result); } // Generate results std::unique_ptr rsWriter = std::make_unique(resultSchema_); @@ -399,7 +399,7 @@ StatusOr> GroupByExecutor::setupInterimResult() { if (rsWriter != nullptr) { result->setInterim(std::move(rsWriter)); } - return result; + return std::move(result); } diff --git a/src/graph/LimitExecutor.cpp b/src/graph/LimitExecutor.cpp index 02af1f76816..03eea371f3d 100644 --- a/src/graph/LimitExecutor.cpp +++ b/src/graph/LimitExecutor.cpp @@ -82,7 +82,7 @@ void LimitExecutor::feedResult(std::unique_ptr result) { StatusOr> LimitExecutor::setupInterimResult() { auto result = std::make_unique(std::move(colNames_)); if (rows_.empty()) { - return result; + return std::move(result); } auto rsWriter = std::make_unique(inputs_->schema()); @@ -121,7 +121,7 @@ StatusOr> LimitExecutor::setupInterimResult() { if (rsWriter != nullptr) { result->setInterim(std::move(rsWriter)); } - return result; + return std::move(result); } diff --git a/src/graph/OrderByExecutor.cpp b/src/graph/OrderByExecutor.cpp index ce77bb524ea..3db736e4ff6 100644 --- a/src/graph/OrderByExecutor.cpp +++ b/src/graph/OrderByExecutor.cpp @@ -163,7 +163,7 @@ Status OrderByExecutor::beforeExecute() { StatusOr> OrderByExecutor::setupInterimResult() { auto result = std::make_unique(std::move(colNames_)); if (rows_.empty()) { - return result; + return std::move(result); } auto schema = inputs_->schema(); @@ -201,7 +201,7 @@ StatusOr> OrderByExecutor::setupInterimResult() { } result->setInterim(std::move(rsWriter)); - return result; + return std::move(result); } void OrderByExecutor::setupResponse(cpp2::ExecutionResponse &resp) { diff --git a/src/parser/test/CMakeLists.txt b/src/parser/test/CMakeLists.txt index b3e0f5b71f2..4cf438859ff 100644 --- a/src/parser/test/CMakeLists.txt +++ b/src/parser/test/CMakeLists.txt @@ -33,7 +33,7 @@ nebula_add_test( ) nebula_add_executable( - NAME parser_benchmark + NAME parser_bm SOURCES ParserBenchmark.cpp OBJECTS ${PARSER_TEST_LIBS} LIBRARIES follybenchmark boost_regex ${THRIFT_LIBRARIES} wangle diff --git a/third-party/CMakeLists.txt b/third-party/CMakeLists.txt new file mode 100644 index 00000000000..641efa180fc --- /dev/null +++ b/third-party/CMakeLists.txt @@ -0,0 +1,243 @@ +cmake_minimum_required(VERSION 3.5.0) + +project("Nebula Third Party" C CXX) + +set(CXX_STANDARD 14) +set(CXX_STANDARD_REQUIRED ON) + +# Required CMake modules +include(ExternalProject) + +# Get number of physical CPU cores and megabytes of available memory +cmake_host_system_information(RESULT num_cores QUERY NUMBER_OF_PHYSICAL_CORES) +cmake_host_system_information(RESULT available_memory_mb QUERY AVAILABLE_PHYSICAL_MEMORY) + +execute_process( + COMMAND ldd --version + COMMAND head -1 + COMMAND cut -d ")" -f 2 + COMMAND cut -d " " -f 2 + OUTPUT_VARIABLE GLIBC_VERSION + OUTPUT_STRIP_TRAILING_WHITESPACE +) + +# Guess the number of building jobs based on the available memories +set(jobs_by_cpu ${num_cores}) +math(EXPR jobs_by_mem "${available_memory_mb} / 1024 / 2") +if (jobs_by_mem EQUAL 0) + set(jobs_by_mem 1) +endif() + +# Set the number of building jobs to min(jobs_by_mem, jobs_by_cpu), +# iff BUILDING_JOBS_NUM has not been set or set to 0. +if (NOT BUILDING_JOBS_NUM OR BUILDING_JOBS_NUM EQUAL 0) + set(BUILDING_JOBS_NUM ${jobs_by_cpu}) + if (BUILDING_JOBS_NUM GREATER jobs_by_mem) + set(BUILDING_JOBS_NUM ${jobs_by_mem}) + endif() +endif() + +message(STATUS "Number of online physcial CPU cores: ${num_cores}") +message(STATUS "Available physical memory: ${available_memory_mb} MB") +message(STATUS "Building third party with ${BUILDING_JOBS_NUM} jobs") +message(STATUS "Glibc version: ${GLIBC_VERSION}") + +if (NOT DOWNLOAD_DIR) + set(DOWNLOAD_DIR ${CMAKE_CURRENT_BINARY_DIR}/downloads) +endif() +set(BUILD_INFO_DIR ${CMAKE_CURRENT_BINARY_DIR}/build-info) +set(BUILDING_PATH "${CMAKE_INSTALL_PREFIX}/bin:${CMAKE_INSTALL_PREFIX}/sbin:$ENV{PATH}") +set(ACLOCAL_PATH "${CMAKE_INSTALL_PREFIX}/share/aclocal:${CMAKE_INSTALL_PREFIX}/share/aclocal-1.15") + +set(extra_link_libs "-static-libstdc++ -static-libgcc") +if (${DISABLE_CXX11_ABI}) + set(extra_cpp_flags "-D_GLIBCXX_USE_CXX11_ABI=0") +else() + set(extra_cpp_flags "-D_GLIBCXX_USE_CXX11_ABI=1") +endif() + +if(GLIBC_VERSION VERSION_LESS 2.17) + set(extra_link_libs "${extra_link_libs} -lrt") +endif() + +set(common_cmake_args + -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} + "-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}" + "-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}" + "-DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS} -fPIC ${extra_cpp_flags}" + "-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS} -fPIC" + "-DCMAKE_EXE_LINKER_FLAGS=${extra_link_libs}" + "-DCMAKE_SHARED_LINKER_FLAGS=${extra_link_libs}" + -DCMAKE_INCLUDE_PATH=${CMAKE_INSTALL_PREFIX}/include + -DCMAKE_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib +) + +set(common_configure_args + --prefix=${CMAKE_INSTALL_PREFIX} +) + +set(common_configure_envs + "env" + "CC=${CMAKE_C_COMPILER}" + "CXX=${CMAKE_CXX_COMPILER}" + "CFLAGS=${CMAKE_C_FLAGS} -fPIC -O2 -D_DEFAULT_SOURCE -D_GNU_SOURCE ${extra_cpp_flags}" + "CXXFLAGS=${CMAKE_CXX_FLAGS} -fPIC -O2 -D_DEFAULT_SOURCE -D_GNU_SOURCE ${extra_cpp_flags}" + "CPPFLAGS=-isystem ${CMAKE_INSTALL_PREFIX}/include ${extra_cpp_flags}" + "LDFLAGS=-L${CMAKE_INSTALL_PREFIX}/lib -L${CMAKE_INSTALL_PREFIX}/lib64 ${extra_link_libs}" + "PATH=${BUILDING_PATH}" + "ACLOCAL_PATH=${ACLOCAL_PATH}" +) + +set(ALL_TARGETS + libunwind + openssl + libevent + keyutils + krb5 + jemalloc + bzip2 + zstd + zlib + snappy + lzma + lz4 + libaio + mstch + gperf + fatal + double-conversion + gflags + googletest + glog + boost + rocksdb + folly + wangle + proxygen + fbthrift + capstone + s2geometry +) + +list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/cmake) +list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/../cmake) + +find_package(Libtool 2.4.2 QUIET) +if (NOT Libtool_FOUND) + list(APPEND ALL_TARGETS libtool) +endif() + +find_package(Autoconf 2.69 QUIET) +if (NOT Autoconf_FOUND) + list(APPEND ALL_TARGETS autoconf) +endif() + +find_package(AutoconfArchive QUIET) +if (NOT AutoconfArchive_FOUND) + list(APPEND ALL_TARGETS autoconf-archive) +endif() + +find_package(Automake 1.13.4 QUIET) +if (NOT Automake_FOUND) + list(APPEND ALL_TARGETS automake) +endif() + +if ("$ENV{build_package}" STREQUAL "1") + list(APPEND ALL_TARGETS bison) +else() + find_package(BISON 3.0.5 QUIET) + if (NOT BISON_FOUND) + list(APPEND ALL_TARGETS bison) + endif() +endif() + +if ("$ENV{build_package}" STREQUAL "1") + list(APPEND ALL_TARGETS flex) +else() + find_package(FLEX 2.6.0 QUIET) + if (NOT FLEX_FOUND) + list(APPEND ALL_TARGETS flex) + endif() +endif() + +find_package(Gettext QUIET) +if (NOT Gettext_FOUND) + list(APPEND ALL_TARGETS gettext) +endif() + +foreach(target ${ALL_TARGETS}) + include(externals/${target}.cmake) + list(APPEND CLEAN_TARGETS ${target}-clean) +endforeach() + +macro(maybe_add_dependencies depender) + if (TARGET ${depender}) + foreach (dependee ${ARGN}) + if (TARGET ${dependee}) + add_dependencies(${depender} ${dependee}) + endif() + endforeach() + endif() +endmacro() + +maybe_add_dependencies(autoconf-archive autoconf) +maybe_add_dependencies(automake autoconf autoconf-archive) +maybe_add_dependencies(libtool automake) + +maybe_add_dependencies(glog libtool) +maybe_add_dependencies(bison libtool) +maybe_add_dependencies(flex libtool) +maybe_add_dependencies(zlib libtool) +maybe_add_dependencies(gettext libtool) +maybe_add_dependencies(lzma gettext) +maybe_add_dependencies(libevent libtool) +maybe_add_dependencies(gperf libtool) + +maybe_add_dependencies(boost zlib bzip2 lzma) +maybe_add_dependencies(mstch boost) + +maybe_add_dependencies(glog gflags) + +maybe_add_dependencies(s2geometry googletest glog openssl) + +maybe_add_dependencies(krb5 keyutils openssl gettext bison) +maybe_add_dependencies(folly glog boost double-conversion openssl libevent lzma zstd snappy lz4 libunwind libaio) +maybe_add_dependencies(wangle folly) +maybe_add_dependencies(fbthrift folly krb5 bison flex mstch zlib zstd wangle fatal) +maybe_add_dependencies(proxygen wangle libunwind gperf) +maybe_add_dependencies(rocksdb snappy zlib zstd bzip2 lzma libunwind) + +add_custom_command( + TARGET zstd POST_BUILD + COMMAND + rm -rf ${CMAKE_INSTALL_PREFIX}/lib/libzstd.so* +) + +add_custom_command( + TARGET rocksdb POST_BUILD + COMMAND + rm -rf ${CMAKE_INSTALL_PREFIX}/lib64/librocksdb.so* + COMMAND + rm -rf ${CMAKE_INSTALL_PREFIX}/lib/librocksdb.so* +) + +add_custom_target( + strip-archives ALL + COMMAND + strip --strip-unneeded ${CMAKE_INSTALL_PREFIX}/lib/*.a + DEPENDS ${ALL_TARGETS} +) + +add_custom_target( + clean-all + DEPENDS ${CLEAN_TARGETS} +) + +add_custom_target( + pack-downloads + COMMAND + tar czvf nebula-third-party-src-1.0.tgz downloads + COMMAND + md5sum nebula-third-party-src-1.0.tgz + WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/.. +) diff --git a/third-party/build-all-third-party.sh b/third-party/build-all-third-party.sh new file mode 100755 index 00000000000..2b50fbf5e43 --- /dev/null +++ b/third-party/build-all-third-party.sh @@ -0,0 +1,21 @@ +#! /usr/bin/env bash +# +# Copyright (c) 2019 vesoft inc. All rights reserved. +# +# This source code is licensed under Apache 2.0 License, +# attached with Common Clause Condition 1.0, found in the LICENSES directory. + +# Please note that this utility must be invoked with root privilege. + +this_dir=$(dirname $(readlink -f $0)) + +for v in 7.1.0 7.5.0 8.3.0 9.1.0 9.2.0 +do + echo $v + source /opt/vesoft/toolset/gcc/$v/enable; + rm -rf /opt/vesoft/third-party + build_package=1 disable_cxx11_abi=0 $this_dir/build-third-party.sh /opt/vesoft/third-party + rm -rf /opt/vesoft/third-party + build_package=1 disable_cxx11_abi=1 $this_dir/build-third-party.sh /opt/vesoft/third-party + source /opt/vesoft/toolset/gcc/$v/disable; +done diff --git a/third-party/build-gcc.sh b/third-party/build-gcc.sh new file mode 100755 index 00000000000..b0214a64a12 --- /dev/null +++ b/third-party/build-gcc.sh @@ -0,0 +1,379 @@ +#! /usr/bin/env bash + +# Copyright (c) 2019 vesoft inc. All rights reserved. +# +# This source code is licensed under Apache 2.0 License, +# attached with Common Clause Condition 1.0, found in the LICENSES directory. + +# Usage: build-gcc.sh [prefix] + +# Always use bash +shell=$(basename $(readlink /proc/$$/exe)) +if [ ! x$shell = x"bash" ] +then + bash $0 $@ + exit $? +fi + +this_dir=$(dirname $(readlink -f $0)) + +# GCC, binutils and support libraries +#url_base=http://ftpmirror.gnu.org +url_base=http://mirrors.ustc.edu.cn/gnu + +gcc_version=7.5.0 +gcc_tarball=gcc-$gcc_version.tar.xz +gcc_url=$url_base/gcc/gcc-$gcc_version/$gcc_tarball + +gmp_version=5.1.3 +gmp_tarball=gmp-$gmp_version.tar.xz +gmp_url=$url_base/gmp/$gmp_tarball + +mpfr_version=3.1.4 +mpfr_tarball=mpfr-$mpfr_version.tar.xz +mpfr_url=$url_base/mpfr/$mpfr_tarball + +mpc_version=1.0.3 +mpc_tarball=mpc-$mpc_version.tar.gz +mpc_url=$url_base/mpc/$mpc_tarball + +bu_version=2.28.1 +bu_tarball=binutils-$bu_version.tar.xz +bu_url=$url_base/binutils/$bu_tarball + +gcc_checksum=79cb8a65d44dfc8a2402b46395535c9a +gmp_checksum=e5fe367801ff067b923d1e6a126448aa +mpfr_checksum=064b2c18185038e404a401b830d59be8 +mpc_checksum=d6a1d5f8ddea3abd2cc3e98f58352d26 +bu_checksum=a3bf359889e4b299fce1f4cb919dc7b6 + +# Building directories setup +cur_dir=$PWD +root_dir=$PWD/toolset-build +tarballs_dir=$root_dir/downloads +source_dir=$root_dir/source +gcc_object_dir=$root_dir/gcc-build +bu_object_dir=$root_dir/binutils-build +prefix=$1 +install_dir=${prefix:-$root_dir/install}/vesoft/toolset/gcc/$gcc_version +logfile=$root_dir/gcc-build.log +triplet=x86_64-vesoft-linux +distro=$(lsb_release -si) + +# Guess number of building jobs +source $this_dir/guess-building-jobs-num.sh +echo "Building GCC-$gcc_version with $building_jobs_num jobs" + +# Download source tarballs +function get_checksum { + md5sum $1 | cut -d ' ' -f 1 +} + +# args: +function fetch_tarball { + local checksum + [[ -f $2 ]] && checksum=$(get_checksum $2) + [[ -n $checksum ]] && [[ $checksum = $4 ]] && return 0 + echo "Downloading $2..." + if ! bash -c "$1 $3" + then + echo "Download $2 Failed" + exit 1 + fi +} + +function fetch_tarballs { + hash wget &> /dev/null && download_cmd="wget -c --progress=bar:force:noscroll" + if [[ -z $download_cmd ]] + then + echo "'wget' not found for downloading" 1>&2; + exit 1; + fi + set +e + set +o pipefail + wget --help | grep -q '\--show-progress' && \ + download_cmd="$download_cmd -q --show-progress" + set -e + set -o pipefail + echo "Download command: '$download_cmd'" + + mkdir -p $tarballs_dir && cd $tarballs_dir + + fetch_tarball "$download_cmd" $gcc_tarball $gcc_url $gcc_checksum + fetch_tarball "$download_cmd" $gmp_tarball $gmp_url $gmp_checksum + fetch_tarball "$download_cmd" $mpfr_tarball $mpfr_url $mpfr_checksum + fetch_tarball "$download_cmd" $mpc_tarball $mpc_url $mpc_checksum + fetch_tarball "$download_cmd" $bu_tarball $bu_url $bu_checksum + + cd $OLDPWD +} + +# Unpack source tarballs +function unpack_tarballs { + mkdir -p $source_dir + cd $tarballs_dir + + if [[ ! -d $source_dir/gcc-$gcc_version ]] + then + echo "Unpacking $gcc_tarball..." + tar -xf $gcc_tarball -C $source_dir || exit 1 + fi + + if [[ ! -d $source_dir/gmp-$gmp_version ]] + then + echo "Unpacking $gmp_tarball..." + tar -xf $gmp_tarball -C $source_dir || exit 1 + fi + + if [[ ! -d $source_dir/mpfr-$mpfr_version ]] + then + echo "Unpacking $mpfr_tarball..." + tar -xf $mpfr_tarball -C $source_dir || exit 1 + fi + + if [[ ! -d $source_dir/mpc-$mpc_version ]] + then + echo "Unpacking $mpc_tarball..." + tar -xf $mpc_tarball -C $source_dir || exit 1 + fi + + if [[ ! -d $source_dir/binutils-$bu_version ]] + then + echo "Unpacking $bu_tarball..." + tar -xf $bu_tarball -C $source_dir || exit 1 + fi + + cd $OLDPWD +} + +# Necessary dependency setup +function setup_deps { + cd $source_dir/gcc-$gcc_version + ln -sf ../gmp-$gmp_version gmp + ln -sf ../mpfr-$mpfr_version mpfr + ln -sf ../mpc-$mpc_version mpc + + #[[ ! -e config.guess.orig ]] && cp -vp config.guess config.guess.orig + #cat > config.guess <&2; exit 1; } + cd $OLDPWD +} + +# Start building GCC +function build_gcc { + cd $gcc_object_dir + make -s -j $building_jobs_num bootstrap-lean + [[ $? -ne 0 ]] && { echo "Failed to build GCC" 1>&2; exit 1; } + cd $OLDPWD +} + +# Install GCC +function install_gcc { + cd $gcc_object_dir + make -s -j $building_jobs_num install-strip + [[ $? -ne 0 ]] && { echo "Failed to install GCC" 1>&2; exit 1; } + cd $OLDPWD +} + +# Clean GCC +function clean_gcc { + cd $gcc_object_dir + make -s -j $building_jobs_num clean || true + cd $OLDPWD +} + +# Configure binutils +function configure_binutils { + mkdir -p $bu_object_dir + cd $bu_object_dir + $source_dir/binutils-$bu_version/configure \ + --prefix=$install_dir \ + --with-pkgversion="Nebula Graph Build" \ + --disable-shared \ + --disable-nls \ + --enable-gold \ + --enable-ld=default \ + --with-system-zlib \ + --build=$triplet \ + --host=$triplet \ + --target=$triplet \ + --disable-werror + [[ $? -ne 0 ]] && { echo "Failed to configure binutils" 1>&2; exit 1; } + cd $OLDPWD +} + +# Build binutils +function build_binutils { + cd $bu_object_dir + make -s -j $building_jobs_num || { echo "Failed to build binutils" 1>&2; exit 1; } + cd $OLDPWD +} + +# Install binutils +function install_binutils { + cd $bu_object_dir + make -s install-strip || { echo "Failed to install binutils" 1>&2; exit 1; } + cd $OLDPWD + cd $install_dir + # Place a copy of assembler and linker to libexec + cp -vp bin/as libexec/gcc/$triplet/$gcc_version + cp -vp bin/ld* libexec/gcc/$triplet/$gcc_version + cd $OLDPWD +} + +# Clean binutils +function clean_binutils { + cd $bu_object_dir + make -s clean || true + cd $OLDPWD +} + +# Finalize the building +function finalize { + # Remove all of the annoying libtool files, + # so that the installation could be copied around + find $install_dir -name '*.la' | xargs rm -f +} + +# Test usability of GCC +function usability_test { + CXX=$install_dir/bin/g++ $this_dir/cxx-compiler-usability-test.sh + [[ $? -eq 0 ]] || exit 1 + cp -p $this_dir/cxx-compiler-usability-test.sh $install_dir +} + +# Build a self-extractable package +function make_package { + set +e + glibc_version=$(ldd --version | head -1 | cut -d ' ' -f4 | cut -d '-' -f1) + set -e + exec_file=$root_dir/vesoft-gcc-$gcc_version-$distro-x86_64-glibc-$glibc_version.sh + echo "Creating self-extractable package $exec_file" + cat > $exec_file < /dev/null || { echo "xz: Command not found"; exit 1; } + +mkdir -p \$prefix +[[ -w \$prefix ]] || { echo "\$prefix: No permission to write"; exit 1; } + +archive_offset=\$(awk '/^__start_of_archive__$/{print NR+1; exit 0;}' \$0) +tail -n+\$archive_offset \$0 | tar --numeric-owner -xJf - -C \$prefix + +echo "GCC-$gcc_version has been installed to \$prefix/gcc/$gcc_version" +echo "Performing usability tests" +CXX=\$prefix/gcc/$gcc_version/bin/g++ \$prefix/gcc/$gcc_version/cxx-compiler-usability-test.sh +echo "Run 'source \$prefix/gcc/$gcc_version/enable' to start using." +echo "Run 'source \$prefix/gcc/$gcc_version/disable' to stop using." + +exit 0 + +__start_of_archive__ +EOF + cd $install_dir/../.. + tar -cJf - gcc/$gcc_version >> $exec_file + chmod 0755 $exec_file + cd $OLDPWD +} + +start_time=$(date +%s) +set -e +set -o pipefail +echo "Starting build" +trap '[[ $? -ne 0 ]] && echo "Building failed, see $logfile for more details." 1>&2' EXIT +mkdir -p $root_dir + +fetch_tarballs +{ + unpack_tarballs + setup_deps +} |& tee $logfile + +{ + configure_gcc + build_gcc + install_gcc + clean_gcc + + configure_binutils + build_binutils + install_binutils + clean_binutils + + finalize +} |& tee -a $logfile \ + | grep --line-buffered '^Making\|^Configuring\|^Comparing\|^Comparison\|^Failed to' + +usability_test + +cat > $install_dir/enable < $install_dir/disable < /dev/null || { echo "No cmake found." 1>&2; exit 1; } + local cmake_version=$(cmake --version | head -1 | cut -d ' ' -f 3) + local least_cmake_version=3.5.0 + if [[ $(version_cmp $cmake_version $least_cmake_version) -lt 0 ]] + then + echo "cmake $least_cmake_version or higher required" 1>&2 + exit 1 + fi +} + +function check_cxx { + # TODO To consider clang++ + local cxx_cmd + hash g++ &> /dev/null && cxx_cmd=g++ + [[ -n $CXX ]] && cxx_cmd=$CXX + [[ -z $cxx_cmd ]] && { echo "No C++ compiler found" 1>&2; exit 1; } + cxx_version=$($cxx_cmd -dumpfullversion -dumpversion 2>/dev/null) + local least_cxx_version=7.0.0 + if [[ $(version_cmp $cxx_version $least_cxx_version) -lt 0 ]] + then + echo "g++ $least_cxx_version or higher required, but you have $cxx_version" 1>&2 + exit 1 + fi +} + +check_cmake +check_cxx + +# Exit on any failure here after +set -e +set -o pipefail + +# Directories setup +cur_dir=`pwd` +source_dir=$(readlink -f $(dirname $0)/..)/third-party +build_root=$cur_dir/third-party +build_dir=$build_root/build +prefix=$1 +install_dir=${prefix:-$build_root/install} +download_dir=$build_root/downloads +source_tar_name=nebula-third-party-src-1.0.tgz +source_url=https://nebula-graph.oss-accelerate.aliyuncs.com/third-party/${source_tar_name} +logfile=$build_root/build.log + + +trap '[[ $? -ne 0 ]] && echo "Building failed, see $logfile for more details." 1>&2' EXIT + +# Allow to customize compilers +[[ -n ${CC} ]] && C_COMPILER_ARG="-DCMAKE_C_COMPILER=${CC}" +[[ -n ${CXX} ]] && CXX_COMPILER_ARG="-DCMAKE_CXX_COMPILER=${CXX}" +[[ ${disable_cxx11_abi} -ne 0 ]] && DISABLE_CXX11_ABI="-DDISABLE_CXX11_ABI=1" +export disable_cxx11_abi + +# Download source archives if necessary +mkdir -p $build_root +cd $build_root + +if [[ -f $source_tar_name ]] +then + checksum=$(md5sum $source_tar_name | cut -d ' ' -f 1) +fi + +if [[ ! $checksum = 375f349b7b5ae1212bd4195bfc30f43a ]] +then + hash wget &> /dev/null && download_cmd="wget -c" + if [[ -z $download_cmd ]] + then + echo "'wget' not found for downloading" 1>&2; + elif ! bash -c "$download_cmd $source_url" + then + # Resort to the builtin download method of cmake on failure + echo "Download from $source_url failed." 1>&2 + else + echo "Source of third party was downdloaded to $build_root" + echo -n "Extracting into $download_dir..." + tar -xzf $source_tar_name + echo "done" + fi +else + tar -xzf $source_tar_name +fi + +# Build and install +mkdir -p $build_dir $install_dir +cd $build_dir + +echo "Starting build" + +cmake -DDOWNLOAD_DIR=$download_dir \ + -DCMAKE_INSTALL_PREFIX=$install_dir \ + ${C_COMPILER_ARG} ${CXX_COMPILER_ARG} \ + ${DISABLE_CXX11_ABI} \ + $source_dir |& tee $logfile + +make |& \ + tee -a $logfile | \ + { grep --line-buffered 'Creating\|^Scanning\|Performing\|Completed\|CMakeFiles.*Error' || true; } +end_time=$(date +%s) + +cd $OLDPWD && rm -rf $build_dir + +# Remove all libtool files +find $install_dir -name '*.la' | xargs rm -f + +# Make krb5 relocatable +sed -i 's/^prefix=.*$/prefix=$(dirname $(dirname $(readlink -f $0)))/' $install_dir/bin/krb5-config +sed -i 's#^LDFLAGS=.*$#LDFLAGS="-L$prefix/lib -L$prefix/lib64"#' $install_dir/bin/krb5-config +sed -i -r 's#^DEFCKTNAME=.*(/var.*keytab).*#DEFCKTNAME="FILE:$prefix\1"#' $install_dir/bin/krb5-config + +function make_package { + cxx_cmd=${CXX:-g++} + gcc_version=$($cxx_cmd -dumpfullversion -dumpversion) + abi_version=$($this_dir/cxx-compiler-abi-version.sh) + set +e + libc_version=$(ldd --version | head -1 | cut -d ' ' -f4 | cut -d '-' -f1) + set -e + exec_file=$build_root/vesoft-third-party-x86_64-libc-$libc_version-gcc-$gcc_version-abi-$abi_version.sh + + echo "Creating self-extractable package $exec_file" + cat > $exec_file < /dev/null || { echo "xz: Command not found"; exit 1; } + +[[ \$# -ne 0 ]] && prefix=\$(echo "\$@" | sed 's;.*--prefix=(\S*).*;\1;p' -rn) +prefix=\${prefix:-/opt/vesoft/third-party} +mkdir -p \$prefix + +[[ -w \$prefix ]] || { echo "\$prefix: No permission to write"; exit 1; } + +archive_offset=\$(awk '/^__start_of_archive__$/{print NR+1; exit 0;}' \$0) +tail -n+\$archive_offset \$0 | tar --no-same-owner --numeric-owner -xJf - -C \$prefix + +echo "Nebula Third Party has been installed to \$prefix" + +exit 0 + +__start_of_archive__ +EOF + cd $install_dir + tar -cJf - * >> $exec_file + chmod 0755 $exec_file + cd $OLDPWD +} + +[[ $build_package -ne 0 ]] && make_package + +echo +echo "Third parties have been successfully installed to $install_dir" +echo "$((end_time - start_time)) seconds been taken." diff --git a/third-party/cmake/FindAutoconf.cmake b/third-party/cmake/FindAutoconf.cmake new file mode 100644 index 00000000000..0068e69582c --- /dev/null +++ b/third-party/cmake/FindAutoconf.cmake @@ -0,0 +1,14 @@ +find_program(Autoconf_EXECUTABLE NAMES autoconf DOC "Path to the autconf executable") +if (Autoconf_EXECUTABLE) + execute_process( + OUTPUT_VARIABLE Autoconf_VERSION + OUTPUT_STRIP_TRAILING_WHITESPACE + COMMAND "autoconf" "--version" + COMMAND "head" "-1" + COMMAND "cut" "-d" " " "-f4" + ) +endif() + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(Autoconf REQUIRED_VARS Autoconf_EXECUTABLE + VERSION_VAR Autoconf_VERSION) diff --git a/third-party/cmake/FindAutoconfArchive.cmake b/third-party/cmake/FindAutoconfArchive.cmake new file mode 100644 index 00000000000..c49166c21e3 --- /dev/null +++ b/third-party/cmake/FindAutoconfArchive.cmake @@ -0,0 +1,3 @@ +find_path(AutoconfArchive_DIR NAMES aclocal/ax_prefix_config_h.m4 PATHS /usr/share) +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(AutoconfArchive REQUIRED_VARS AutoconfArchive_DIR) diff --git a/third-party/cmake/FindAutomake.cmake b/third-party/cmake/FindAutomake.cmake new file mode 100644 index 00000000000..97225d1bd00 --- /dev/null +++ b/third-party/cmake/FindAutomake.cmake @@ -0,0 +1,14 @@ +find_program(Automake_EXECUTABLE NAMES automake DOC "Path to the automake executable") +if (Automake_EXECUTABLE) + execute_process( + OUTPUT_VARIABLE Automake_VERSION + OUTPUT_STRIP_TRAILING_WHITESPACE + COMMAND "automake" "--version" + COMMAND "head" "-1" + COMMAND "cut" "-d" " " "-f4" + ) +endif() + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(Automake REQUIRED_VARS Automake_EXECUTABLE + VERSION_VAR Automake_VERSION) diff --git a/third-party/cmake/FindLibtool.cmake b/third-party/cmake/FindLibtool.cmake new file mode 100644 index 00000000000..61d0eb1f27d --- /dev/null +++ b/third-party/cmake/FindLibtool.cmake @@ -0,0 +1,14 @@ +find_program(Libtool_EXECUTABLE NAMES libtool libtoolize DOC "Path to the libtool executable") +if (Libtool_EXECUTABLE) + execute_process( + OUTPUT_VARIABLE Libtool_VERSION + OUTPUT_STRIP_TRAILING_WHITESPACE + COMMAND ${Libtool_EXECUTABLE} "--version" + COMMAND "head" "-1" + COMMAND "cut" "-d" " " "-f4" + ) +endif() + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(Libtool REQUIRED_VARS Libtool_EXECUTABLE + VERSION_VAR Libtool_VERSION) diff --git a/third-party/cxx-compiler-abi-version.sh b/third-party/cxx-compiler-abi-version.sh new file mode 100755 index 00000000000..150643856d9 --- /dev/null +++ b/third-party/cxx-compiler-abi-version.sh @@ -0,0 +1,27 @@ +#! /usr/bin/env bash + +# Copyright (c) 2019 vesoft inc. All rights reserved. +# +# This source code is licensed under Apache 2.0 License, +# attached with Common Clause Condition 1.0, found in the LICENSES directory. + +set -e +abi="unknown" +cxx_cmd=${CXX:-g++} +link_flags="-std=c++14 -static-libstdc++ -static-libgcc" +[[ $disable_cxx11_abi -ne 0 ]] && extra_flags="$extra_flags -D_GLIBCXX_USE_CXX11_ABI=0" +tmpdir=$(mktemp -q -d /tmp/nebula-compiler-test.XXXX 2>/dev/null) +object=$tmpdir/a.out.o + +$cxx_cmd $link_flags $extra_flags -g -x c++ - -c -o $object > /dev/null < +void foobar(std::string) { +} +EOF + +string=$(nm -C $object | sed -nr 's/.*foobar.*(std.*string).*/\1/p') + +[[ $string = 'std::__cxx11::basic_string' ]] && abi=11 +[[ $string = 'std::string' ]] && abi=98 + +echo $abi diff --git a/third-party/cxx-compiler-libcxx-version.sh b/third-party/cxx-compiler-libcxx-version.sh new file mode 100755 index 00000000000..8576a3d1fb2 --- /dev/null +++ b/third-party/cxx-compiler-libcxx-version.sh @@ -0,0 +1,13 @@ +#! /usr/bin/env bash + +# Copyright (c) 2019 vesoft inc. All rights reserved. +# +# This source code is licensed under Apache 2.0 License, +# attached with Common Clause Condition 1.0, found in the LICENSES directory. + +set -e +cxx_cmd=${CXX:-g++} + +libcxx=$($cxx_cmd --print-file-name=libstdc++.so) + +strings $libcxx | egrep '^GLIBCXX_[.0-9]+$' | sed -r 's/.*_([.0-9]+)$/\1/' | sort -t'.' -ug -k1,1 -k2,2 -k3,3 | tail -1 diff --git a/third-party/cxx-compiler-usability-test.sh b/third-party/cxx-compiler-usability-test.sh new file mode 100755 index 00000000000..1fee20b3061 --- /dev/null +++ b/third-party/cxx-compiler-usability-test.sh @@ -0,0 +1,90 @@ +#! /usr/bin/env bash + +# Copyright (c) 2019 vesoft inc. All rights reserved. +# +# This source code is licensed under Apache 2.0 License, +# attached with Common Clause Condition 1.0, found in the LICENSES directory. + +cxx_cmd=${CXX:-g++} +link_flags="-std=c++14 -static-libstdc++ -static-libgcc" + +# Compile source from stdin and run. +# input envs: +# $output, which is the expected output. +# $exit_code, which is the exit status of the compiled program. +function compile-and-run { + local tmpdir=$(mktemp -q -d /tmp/nebula-compiler-test.XXXX 2>/dev/null) + [[ -z $tmpdir ]] && { + echo "Failed" + echo "Create directory /tmp/nebula-compiler-test.XXXX failed." + exit 1; + } + + local exe=$tmpdir/a.out + local logfile=$tmpdir/testing.log + $cxx_cmd $link_flags $extra_flags -g0 -x c++ - -o $exe &> $logfile + + [[ $? -eq 0 ]] || { + echo "Failed" + echo "See $logfile for details." 1>&2; + exit 1; + } + + true_output=$($exe 2>&1) + true_exit_code=$? + # Convert non-zero to 1 + [[ $true_exit_code -ne 0 ]] && true_exit_code=1 + + if [[ -n "$output" ]] && [[ ! "$true_output" = "$output" ]] + then + echo "expected: $output" >> $logfile + echo "actual: $true_output" >> $logfile + echo "Failed" + echo "See $logfile for details." 1>&2; + exit 1; + fi + + if [[ -n "$exit_code" ]] && [[ $true_exit_code -ne $exit_code ]] + then + echo "expected: $exit_code" >> $logfile + echo "actual: $true_exit_code" >> $logfile + echo "Failed" + echo "See $logfile for details." 1>&2; + exit 1; + fi + + rm -rf $tmpdir +} + +# make_unique, regex, (templated)lambda, move capture +echo -n "Performing regular C++14 tests..." +output="Nebula" exit_code=0 compile-and-run < +#include +#include +#include +int main() { + auto hello = std::make_unique("Hello"); + auto _666_ = [hello = std::move(hello)] (auto bravo) { + return *hello + " " + *bravo; + } (std::make_unique("Nebula Graph")); + std::smatch sm; + if (std::regex_match(_666_, sm, + std::regex(R"(^(Hello) (Nebula) (Graph)$)"))) { + std::cout << sm[2].str() << std::endl; + } + return 0; +} +EOF +echo "OK" + +echo -n "Performing LeakSanitizer tests..." +exit_code=1 extra_flags="-fsanitize=address -g" compile-and-run <" + > ${source_dir}/tools/build/src/user-config.jam + WORKING_DIRECTORY ${source_dir} +) + +ExternalProject_Add_Step(${name} clean + EXCLUDE_FROM_MAIN TRUE + ALWAYS TRUE + DEPENDEES configure + COMMAND ./b2 clean + COMMAND rm -f ${BUILD_INFO_DIR}/${name}-build + WORKING_DIRECTORY ${source_dir} +) + +ExternalProject_Add_StepTargets(${name} clean) diff --git a/third-party/externals/bzip2.cmake b/third-party/externals/bzip2.cmake new file mode 100644 index 00000000000..4d6cad5bfc8 --- /dev/null +++ b/third-party/externals/bzip2.cmake @@ -0,0 +1,35 @@ +# Copyright (c) 2019 vesoft inc. All rights reserved. +# +# This source code is licensed under Apache 2.0 License, +# attached with Common Clause Condition 1.0, found in the LICENSES directory. + +set(name bzip2) +set(source_dir ${CMAKE_CURRENT_BINARY_DIR}/${name}/source) +ExternalProject_Add( + ${name} + URL https://nchc.dl.sourceforge.net/project/bzip2/bzip2-1.0.6.tar.gz + URL_HASH MD5=00b516f4704d4a7cb50a1d97e6e8e15b + PREFIX ${CMAKE_CURRENT_BINARY_DIR}/${name} + TMP_DIR ${BUILD_INFO_DIR} + STAMP_DIR ${BUILD_INFO_DIR} + DOWNLOAD_DIR ${DOWNLOAD_DIR} + SOURCE_DIR ${source_dir} + CONFIGURE_COMMAND "" + BUILD_COMMAND make CFLAGS=-fPIC -s -j${BUILDING_JOBS_NUM} + BUILD_IN_SOURCE 1 + INSTALL_COMMAND make -s install -j${BUILDING_JOBS_NUM} PREFIX=${CMAKE_INSTALL_PREFIX} + LOG_CONFIGURE TRUE + LOG_BUILD TRUE + LOG_INSTALL TRUE +) + +ExternalProject_Add_Step(${name} clean + EXCLUDE_FROM_MAIN TRUE + ALWAYS TRUE + DEPENDEES configure + COMMAND make clean -j + COMMAND rm -f ${BUILD_INFO_DIR}/${name}-build + WORKING_DIRECTORY ${source_dir} +) + +ExternalProject_Add_StepTargets(${name} clean) diff --git a/third-party/externals/capstone.cmake b/third-party/externals/capstone.cmake new file mode 100644 index 00000000000..552fcd2f23c --- /dev/null +++ b/third-party/externals/capstone.cmake @@ -0,0 +1,57 @@ +# Copyright (c) 2019 vesoft inc. All rights reserved. +# +# This source code is licensed under Apache 2.0 License, +# attached with Common Clause Condition 1.0, found in the LICENSES directory. + +set(name capstone) +set(source_dir ${CMAKE_CURRENT_BINARY_DIR}/${name}/source) +ExternalProject_Add( + ${name} + URL https://github.com/aquynh/capstone/archive/4.0.1.tar.gz + URL_HASH MD5=1b0a9a0d50d9515dcf7684ce0a2270a4 + DOWNLOAD_NAME capstone-4.0.1.tar.gz + PREFIX ${CMAKE_CURRENT_BINARY_DIR}/${name} + TMP_DIR ${BUILD_INFO_DIR} + STAMP_DIR ${BUILD_INFO_DIR} + DOWNLOAD_DIR ${DOWNLOAD_DIR} + SOURCE_DIR ${source_dir} + CMAKE_ARGS + ${common_cmake_args} + -DCAPSTONE_X86_SUPPORT=ON + -DCAPSTONE_ARM_SUPPORT=OFF + -DCAPSTONE_ARM64_SUPPORT=OFF + -DCAPSTONE_M680X_SUPPORT=OFF + -DCAPSTONE_M68K_SUPPORT=OFF + -DCAPSTONE_MIPS_SUPPORT=OFF + -DCAPSTONE_MOS65XX_SUPPORT=OFF + -DCAPSTONE_PPC_SUPPORT=OFF + -DCAPSTONE_SPARC_SUPPORT=OFF + -DCAPSTONE_SYSZ_SUPPORT=OFF + -DCAPSTONE_XCORE_SUPPORT=OFF + -DCAPSTONE_TMS320C64X_SUPPORT=OFF + -DCAPSTONE_M680X_SUPPORT=OFF + -DCAPSTONE_EVM_SUPPORT=OFF + -DCAPSTONE_BUILD_DIET=OFF + -DCAPSTONE_X86_REDUCE=OFF + -DCAPSTONE_BUILD_TESTS=OFF + -DCAPSTONE_BUILD_STATIC=ON + -DCAPSTONE_BUILD_SHARED=OFF + -DCMAKE_BUILD_TYPE=Release + BUILD_COMMAND make -s -j${BUILDING_JOBS_NUM} + BUILD_IN_SOURCE 1 + INSTALL_COMMAND make -s install -j${BUILDING_JOBS_NUM} + LOG_CONFIGURE TRUE + LOG_BUILD TRUE + LOG_INSTALL TRUE +) + +ExternalProject_Add_Step(${name} clean + EXCLUDE_FROM_MAIN TRUE + ALWAYS TRUE + DEPENDEES configure + COMMAND make clean -j + COMMAND rm -f ${BUILD_INFO_DIR}/${name}-build + WORKING_DIRECTORY ${source_dir} +) + +ExternalProject_Add_StepTargets(${name} clean) diff --git a/third-party/externals/double-conversion.cmake b/third-party/externals/double-conversion.cmake new file mode 100644 index 00000000000..1c9ec4ddb17 --- /dev/null +++ b/third-party/externals/double-conversion.cmake @@ -0,0 +1,37 @@ +# Copyright (c) 2019 vesoft inc. All rights reserved. +# +# This source code is licensed under Apache 2.0 License, +# attached with Common Clause Condition 1.0, found in the LICENSES directory. + +set(name double-conversion) +set(source_dir ${CMAKE_CURRENT_BINARY_DIR}/${name}/source) +ExternalProject_Add( + ${name} + URL https://github.com/google/double-conversion/archive/v1.1.6.tar.gz + URL_HASH MD5=94f9abc9b1367083cf3e4569886b4170 + DOWNLOAD_NAME double-conversion-1.1.6.tar.gz + PREFIX ${CMAKE_CURRENT_BINARY_DIR}/${name} + TMP_DIR ${BUILD_INFO_DIR} + STAMP_DIR ${BUILD_INFO_DIR} + DOWNLOAD_DIR ${DOWNLOAD_DIR} + SOURCE_DIR ${source_dir} + CMAKE_ARGS + ${common_cmake_args} + BUILD_IN_SOURCE 1 + BUILD_COMMAND make -s -j${BUILDING_JOBS_NUM} + INSTALL_COMMAND make -s install -j${BUILDING_JOBS_NUM} + LOG_CONFIGURE TRUE + LOG_BUILD TRUE + LOG_INSTALL TRUE +) + +ExternalProject_Add_Step(${name} clean + EXCLUDE_FROM_MAIN TRUE + ALWAYS TRUE + DEPENDEES configure + COMMAND make clean -j + COMMAND rm -f ${BUILD_INFO_DIR}/${name}-build + WORKING_DIRECTORY ${source_dir} +) + +ExternalProject_Add_StepTargets(${name} clean) diff --git a/third-party/externals/fatal.cmake b/third-party/externals/fatal.cmake new file mode 100644 index 00000000000..496ea8a04b7 --- /dev/null +++ b/third-party/externals/fatal.cmake @@ -0,0 +1,35 @@ +# Copyright (c) 2019 vesoft inc. All rights reserved. +# +# This source code is licensed under Apache 2.0 License, +# attached with Common Clause Condition 1.0, found in the LICENSES directory. + +set(name fatal) +set(source_dir ${CMAKE_CURRENT_BINARY_DIR}/${name}/source) +ExternalProject_Add( + ${name} + URL https://github.com/facebook/fatal/archive/v2018.08.20.00.tar.gz + URL_HASH MD5=b0887650f53ba8a73924351024f761ad + DOWNLOAD_NAME fatal-2018-08-20.tar.gz + PREFIX ${CMAKE_CURRENT_BINARY_DIR}/${name} + TMP_DIR ${BUILD_INFO_DIR} + STAMP_DIR ${BUILD_INFO_DIR} + DOWNLOAD_DIR ${DOWNLOAD_DIR} + SOURCE_DIR ${source_dir} + CONFIGURE_COMMAND "" + BUILD_COMMAND install -d ${CMAKE_INSTALL_PREFIX}/include + BUILD_IN_SOURCE 1 + INSTALL_COMMAND cp -r fatal ${CMAKE_INSTALL_PREFIX}/include + LOG_CONFIGURE TRUE + LOG_BUILD TRUE + LOG_INSTALL TRUE +) + +ExternalProject_Add_Step(${name} clean + EXCLUDE_FROM_MAIN TRUE + ALWAYS TRUE + DEPENDEES configure + COMMAND rm -f ${BUILD_INFO_DIR}/${name}-build + WORKING_DIRECTORY ${source_dir} +) + +ExternalProject_Add_StepTargets(${name} clean) diff --git a/third-party/externals/fbthrift.cmake b/third-party/externals/fbthrift.cmake new file mode 100644 index 00000000000..0cc26c57185 --- /dev/null +++ b/third-party/externals/fbthrift.cmake @@ -0,0 +1,41 @@ +# Copyright (c) 2019 vesoft inc. All rights reserved. +# +# This source code is licensed under Apache 2.0 License, +# attached with Common Clause Condition 1.0, found in the LICENSES directory. + +set(name fbthrift) +set(source_dir ${CMAKE_CURRENT_BINARY_DIR}/${name}/source) +ExternalProject_Add( + ${name} + URL https://github.com/facebook/fbthrift/archive/v2018.08.20.00.tar.gz + URL_HASH MD5=346627716bae0a4015f67ab33f255173 + DOWNLOAD_NAME fbthrift-2018-08-20.tar.gz + PREFIX ${CMAKE_CURRENT_BINARY_DIR}/${name} + TMP_DIR ${BUILD_INFO_DIR} + STAMP_DIR ${BUILD_INFO_DIR} + DOWNLOAD_DIR ${DOWNLOAD_DIR} + SOURCE_DIR ${source_dir} + PATCH_COMMAND patch -p1 < ${CMAKE_SOURCE_DIR}/patches/fbthrift-2018-08-20.patch + CMAKE_COMMAND env PATH=${CMAKE_INSTALL_PREFIX}/bin:$ENV{PATH} ${CMAKE_COMMAND} + CMAKE_ARGS + ${common_cmake_args} + "-DCMAKE_EXE_LINKER_FLAGS=-static-libstdc++ -static-libgcc" + -D_OPENSSL_LIBDIR=${CMAKE_INSTALL_PREFIX}/lib64 + BUILD_COMMAND make -s -j${BUILDING_JOBS_NUM} + BUILD_IN_SOURCE 1 + INSTALL_COMMAND make -s -j${BUILDING_JOBS_NUM} install + LOG_CONFIGURE TRUE + LOG_BUILD TRUE + LOG_INSTALL TRUE +) + +ExternalProject_Add_Step(${name} clean + EXCLUDE_FROM_MAIN TRUE + ALWAYS TRUE + DEPENDEES configure + COMMAND make clean -j + COMMAND rm -f ${BUILD_INFO_DIR}/${name}-build + WORKING_DIRECTORY ${source_dir} +) + +ExternalProject_Add_StepTargets(${name} clean) diff --git a/third-party/externals/flex.cmake b/third-party/externals/flex.cmake new file mode 100644 index 00000000000..a01ab707f5c --- /dev/null +++ b/third-party/externals/flex.cmake @@ -0,0 +1,38 @@ +# Copyright (c) 2019 vesoft inc. All rights reserved. +# +# This source code is licensed under Apache 2.0 License, +# attached with Common Clause Condition 1.0, found in the LICENSES directory. + +set(name flex) +set(source_dir ${CMAKE_CURRENT_BINARY_DIR}/${name}/source) +ExternalProject_Add( + ${name} + URL https://github.com/westes/flex/releases/download/v2.6.4/flex-2.6.4.tar.gz + URL_HASH MD5=2882e3179748cc9f9c23ec593d6adc8d + PREFIX ${CMAKE_CURRENT_BINARY_DIR}/${name} + TMP_DIR ${BUILD_INFO_DIR} + STAMP_DIR ${BUILD_INFO_DIR} + DOWNLOAD_DIR ${DOWNLOAD_DIR} + SOURCE_DIR ${source_dir} + CONFIGURE_COMMAND + ${common_configure_envs} + ./configure ${common_configure_args} + --enable-static --disable-shared + BUILD_COMMAND make -s + BUILD_IN_SOURCE 1 + INSTALL_COMMAND make -s install + LOG_CONFIGURE TRUE + LOG_BUILD TRUE + LOG_INSTALL TRUE +) + +ExternalProject_Add_Step(${name} clean + EXCLUDE_FROM_MAIN TRUE + ALWAYS TRUE + DEPENDEES configure + COMMAND make clean -j + COMMAND rm -f ${BUILD_INFO_DIR}/${name}-build + WORKING_DIRECTORY ${source_dir} +) + +ExternalProject_Add_StepTargets(${name} clean) diff --git a/third-party/externals/folly.cmake b/third-party/externals/folly.cmake new file mode 100644 index 00000000000..1a8f74111dc --- /dev/null +++ b/third-party/externals/folly.cmake @@ -0,0 +1,41 @@ +# Copyright (c) 2019 vesoft inc. All rights reserved. +# +# This source code is licensed under Apache 2.0 License, +# attached with Common Clause Condition 1.0, found in the LICENSES directory. + +set(name folly) +set(source_dir ${CMAKE_CURRENT_BINARY_DIR}/${name}/source) +ExternalProject_Add( + ${name} + URL https://github.com/facebook/folly/archive/v2018.08.20.00.tar.gz + URL_HASH MD5=1260231dd088526297ec52e3e12bf0ee + DOWNLOAD_NAME folly-2018-08-20.tar.gz + PREFIX ${CMAKE_CURRENT_BINARY_DIR}/${name} + TMP_DIR ${BUILD_INFO_DIR} + STAMP_DIR ${BUILD_INFO_DIR} + DOWNLOAD_DIR ${DOWNLOAD_DIR} + SOURCE_DIR ${source_dir} + CMAKE_ARGS + ${common_cmake_args} + -DCMAKE_BUILD_TYPE=Release + "-DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS} -fPIC -DFOLLY_HAVE_CLOCK_GETTIME -D__USE_POSIX199309 ${extra_cpp_flags}" + -DFOLLY_CXX_FLAGS=-Wno-error + + BUILD_COMMAND make -s -j${BUILDING_JOBS_NUM} + BUILD_IN_SOURCE 1 + INSTALL_COMMAND make -s -j${BUILDING_JOBS_NUM} install/strip + LOG_CONFIGURE TRUE + LOG_BUILD TRUE + LOG_INSTALL TRUE +) + +ExternalProject_Add_Step(${name} clean + EXCLUDE_FROM_MAIN TRUE + ALWAYS TRUE + DEPENDEES configure + COMMAND make clean -j + COMMAND rm -f ${BUILD_INFO_DIR}/${name}-build + WORKING_DIRECTORY ${source_dir} +) + +ExternalProject_Add_StepTargets(${name} clean) diff --git a/third-party/externals/gettext.cmake b/third-party/externals/gettext.cmake new file mode 100644 index 00000000000..e87c95ef835 --- /dev/null +++ b/third-party/externals/gettext.cmake @@ -0,0 +1,38 @@ +# Copyright (c) 2019 vesoft inc. All rights reserved. +# +# This source code is licensed under Apache 2.0 License, +# attached with Common Clause Condition 1.0, found in the LICENSES directory. + +set(name gettext) +set(source_dir ${CMAKE_CURRENT_BINARY_DIR}/${name}/source) +ExternalProject_Add( + ${name} + URL http://ftp.gnu.org/gnu/gettext/gettext-0.19.8.1.tar.gz + URL_HASH MD5=97e034cf8ce5ba73a28ff6c3c0638092 + PREFIX ${CMAKE_CURRENT_BINARY_DIR}/${name} + TMP_DIR ${BUILD_INFO_DIR} + STAMP_DIR ${BUILD_INFO_DIR} + DOWNLOAD_DIR ${DOWNLOAD_DIR} + SOURCE_DIR ${source_dir} + CONFIGURE_COMMAND + ${common_configure_envs} + ./configure ${common_configure_args} + --disable-shared --enable-static + BUILD_COMMAND make -s -j${BUILDING_JOBS_NUM} + BUILD_IN_SOURCE 1 + INSTALL_COMMAND make -s install -j${BUILDING_JOBS_NUM} + LOG_CONFIGURE TRUE + LOG_BUILD TRUE + LOG_INSTALL TRUE +) + +ExternalProject_Add_Step(${name} clean + EXCLUDE_FROM_MAIN TRUE + ALWAYS TRUE + DEPENDEES configure + COMMAND make clean -j + COMMAND rm -f ${BUILD_INFO_DIR}/${name}-build + WORKING_DIRECTORY ${source_dir} +) + +ExternalProject_Add_StepTargets(${name} clean) diff --git a/third-party/externals/gflags.cmake b/third-party/externals/gflags.cmake new file mode 100644 index 00000000000..fed034f73a1 --- /dev/null +++ b/third-party/externals/gflags.cmake @@ -0,0 +1,33 @@ +# Copyright (c) 2019 vesoft inc. All rights reserved. +# +# This source code is licensed under Apache 2.0 License, +# attached with Common Clause Condition 1.0, found in the LICENSES directory. + +set(name gflags) +set(source_dir ${CMAKE_CURRENT_BINARY_DIR}/${name}/source) +ExternalProject_Add( + ${name} + URL https://github.com/gflags/gflags/archive/v2.2.1.tar.gz + URL_HASH MD5=b98e772b4490c84fc5a87681973f75d1 + DOWNLOAD_NAME gflags-2.2.1.tar.gz + PREFIX ${CMAKE_CURRENT_BINARY_DIR}/${name} + TMP_DIR ${BUILD_INFO_DIR} + STAMP_DIR ${BUILD_INFO_DIR} + DOWNLOAD_DIR ${DOWNLOAD_DIR} + SOURCE_DIR ${source_dir} + CMAKE_ARGS + ${common_cmake_args} + -DCMAKE_BUILD_TYPE=Release + BUILD_IN_SOURCE 1 +) + +ExternalProject_Add_Step(${name} clean + EXCLUDE_FROM_MAIN TRUE + ALWAYS TRUE + DEPENDEES configure + COMMAND make clean -j + COMMAND rm -f ${BUILD_INFO_DIR}/${name}-build + WORKING_DIRECTORY ${source_dir} +) + +ExternalProject_Add_StepTargets(${name} clean) diff --git a/third-party/externals/glog.cmake b/third-party/externals/glog.cmake new file mode 100644 index 00000000000..b86120b801c --- /dev/null +++ b/third-party/externals/glog.cmake @@ -0,0 +1,47 @@ +# Copyright (c) 2019 vesoft inc. All rights reserved. +# +# This source code is licensed under Apache 2.0 License, +# attached with Common Clause Condition 1.0, found in the LICENSES directory. + +set(name glog) +set(source_dir ${CMAKE_CURRENT_BINARY_DIR}/${name}/source) +ExternalProject_Add( + ${name} + URL https://github.com/google/glog/archive/v0.3.5.tar.gz + URL_HASH MD5=5df6d78b81e51b90ac0ecd7ed932b0d4 + DOWNLOAD_NAME glog-0.3.5.tar.gz + PREFIX ${CMAKE_CURRENT_BINARY_DIR}/${name} + TMP_DIR ${BUILD_INFO_DIR} + STAMP_DIR ${BUILD_INFO_DIR} + DOWNLOAD_DIR ${DOWNLOAD_DIR} + SOURCE_DIR ${source_dir} + CONFIGURE_COMMAND + ${common_configure_envs} + ./configure ${common_configure_args} + --disable-shared + --enable-static + BUILD_COMMAND make -s -j${BUILDING_JOBS_NUM} + BUILD_IN_SOURCE 1 + INSTALL_COMMAND make -s -j${BUILDING_JOBS_NUM} install + LOG_CONFIGURE TRUE + LOG_BUILD TRUE + LOG_INSTALL TRUE +) + +ExternalProject_Add_Step(glog pre-configure + DEPENDEES download update patch + DEPENDERS configure + COMMAND env PATH=${BUILDING_PATH} ACLOCAL_PATH=${ACLOCAL_PATH} autoreconf -if + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/glog/source +) + +ExternalProject_Add_Step(${name} clean + EXCLUDE_FROM_MAIN TRUE + ALWAYS TRUE + DEPENDEES configure + COMMAND make clean -j + COMMAND rm -f ${BUILD_INFO_DIR}/${name}-build + WORKING_DIRECTORY ${source_dir} +) + +ExternalProject_Add_StepTargets(${name} clean) diff --git a/third-party/externals/googletest.cmake b/third-party/externals/googletest.cmake new file mode 100644 index 00000000000..e68a22d94d4 --- /dev/null +++ b/third-party/externals/googletest.cmake @@ -0,0 +1,35 @@ +# Copyright (c) 2019 vesoft inc. All rights reserved. +# +# This source code is licensed under Apache 2.0 License, +# attached with Common Clause Condition 1.0, found in the LICENSES directory. + +set(name googletest) +set(source_dir ${CMAKE_CURRENT_BINARY_DIR}/${name}/source) +ExternalProject_Add( + ${name} + URL https://github.com/google/googletest/archive/release-1.8.0.tar.gz + URL_HASH MD5=16877098823401d1bf2ed7891d7dce36 + DOWNLOAD_NAME googletest-1.8.0.tar.gz + PREFIX ${CMAKE_CURRENT_BINARY_DIR}/${name} + TMP_DIR ${BUILD_INFO_DIR} + STAMP_DIR ${BUILD_INFO_DIR} + DOWNLOAD_DIR ${DOWNLOAD_DIR} + SOURCE_DIR ${source_dir} + BUILD_IN_SOURCE 1 + CMAKE_ARGS + ${common_cmake_args} + LOG_CONFIGURE TRUE + LOG_BUILD TRUE + LOG_INSTALL TRUE +) + +ExternalProject_Add_Step(${name} clean + EXCLUDE_FROM_MAIN TRUE + ALWAYS TRUE + DEPENDEES configure + COMMAND make clean -j + COMMAND rm -f ${BUILD_INFO_DIR}/${name}-build + WORKING_DIRECTORY ${source_dir} +) + +ExternalProject_Add_StepTargets(${name} clean) diff --git a/third-party/externals/gperf.cmake b/third-party/externals/gperf.cmake new file mode 100644 index 00000000000..b07984c80de --- /dev/null +++ b/third-party/externals/gperf.cmake @@ -0,0 +1,39 @@ +# Copyright (c) 2019 vesoft inc. All rights reserved. +# +# This source code is licensed under Apache 2.0 License, +# attached with Common Clause Condition 1.0, found in the LICENSES directory. + +set(name gperf) +set(source_dir ${CMAKE_CURRENT_BINARY_DIR}/${name}/source) +ExternalProject_Add( + ${name} + URL http://ftpmirror.gnu.org/gperf/gperf-3.1.tar.gz + URL_HASH MD5=9e251c0a618ad0824b51117d5d9db87e + PREFIX ${CMAKE_CURRENT_BINARY_DIR}/${name} + TMP_DIR ${BUILD_INFO_DIR} + STAMP_DIR ${BUILD_INFO_DIR} + DOWNLOAD_DIR ${DOWNLOAD_DIR} + SOURCE_DIR ${source_dir} + CONFIGURE_COMMAND + ${common_configure_envs} + "LIBS=-static-libstdc++ -static-libgcc" + ./configure ${common_configure_args} + --disable-shared --enable-static + BUILD_COMMAND make -s -j${BUILDING_JOBS_NUM} + BUILD_IN_SOURCE 1 + INSTALL_COMMAND make -s install -j${BUILDING_JOBS_NUM} + LOG_CONFIGURE TRUE + LOG_BUILD TRUE + LOG_INSTALL TRUE +) + +ExternalProject_Add_Step(${name} clean + EXCLUDE_FROM_MAIN TRUE + ALWAYS TRUE + DEPENDEES configure + COMMAND make clean -j + COMMAND rm -f ${BUILD_INFO_DIR}/${name}-build + WORKING_DIRECTORY ${source_dir} +) + +ExternalProject_Add_StepTargets(${name} clean) diff --git a/third-party/externals/jemalloc.cmake b/third-party/externals/jemalloc.cmake new file mode 100644 index 00000000000..8b3c4b7e509 --- /dev/null +++ b/third-party/externals/jemalloc.cmake @@ -0,0 +1,38 @@ +# Copyright (c) 2019 vesoft inc. All rights reserved. +# +# This source code is licensed under Apache 2.0 License, +# attached with Common Clause Condition 1.0, found in the LICENSES directory. + +set(name jemalloc) +set(source_dir ${CMAKE_CURRENT_BINARY_DIR}/${name}/source) +ExternalProject_Add( + ${name} + URL https://github.com/jemalloc/jemalloc/releases/download/5.1.0/jemalloc-5.1.0.tar.bz2 + URL_HASH MD5=1f47a5aff2d323c317dfa4cf23be1ce4 + PREFIX ${CMAKE_CURRENT_BINARY_DIR}/${name} + TMP_DIR ${BUILD_INFO_DIR} + STAMP_DIR ${BUILD_INFO_DIR} + DOWNLOAD_DIR ${DOWNLOAD_DIR} + SOURCE_DIR ${source_dir} + CONFIGURE_COMMAND + ${common_configure_envs} + ./configure ${common_configure_args} + --disable-stats --enable-prof + BUILD_COMMAND make -s -j${BUILDING_JOBS_NUM} + BUILD_IN_SOURCE 1 + INSTALL_COMMAND make -s install_bin install_include install_lib_static -j${BUILDING_JOBS_NUM} + LOG_CONFIGURE TRUE + LOG_BUILD TRUE + LOG_INSTALL TRUE +) + +ExternalProject_Add_Step(${name} clean + EXCLUDE_FROM_MAIN TRUE + ALWAYS TRUE + DEPENDEES configure + COMMAND make clean -j + COMMAND rm -f ${BUILD_INFO_DIR}/${name}-build + WORKING_DIRECTORY ${source_dir} +) + +ExternalProject_Add_StepTargets(${name} clean) diff --git a/third-party/externals/keyutils.cmake b/third-party/externals/keyutils.cmake new file mode 100644 index 00000000000..932f4ab15be --- /dev/null +++ b/third-party/externals/keyutils.cmake @@ -0,0 +1,39 @@ +# Copyright (c) 2019 vesoft inc. All rights reserved. +# +# This source code is licensed under Apache 2.0 License, +# attached with Common Clause Condition 1.0, found in the LICENSES directory. + +set(name keyutils) +set(source_dir ${CMAKE_CURRENT_BINARY_DIR}/${name}/source) +ExternalProject_Add( + ${name} + URL https://people.redhat.com/dhowells/keyutils/keyutils-1.6.tar.bz2 + URL_HASH MD5=191987b0ab46bb5b50efd70a6e6ce808 + PREFIX ${CMAKE_CURRENT_BINARY_DIR}/${name} + TMP_DIR ${BUILD_INFO_DIR} + STAMP_DIR ${BUILD_INFO_DIR} + DOWNLOAD_DIR ${DOWNLOAD_DIR} + SOURCE_DIR ${source_dir} + CONFIGURE_COMMAND "" + BUILD_COMMAND "" + BUILD_IN_SOURCE 1 + INSTALL_COMMAND make BINDIR=/bin SBINDIR=/sbin + SHAREDIR=/share MANDIR=/man + INCLUDEDIR=/include LIBDIR=/lib + CFLAGS=-fPIC NO_SOLIB=1 DESTDIR=${CMAKE_INSTALL_PREFIX} + install + LOG_CONFIGURE TRUE + LOG_BUILD TRUE + LOG_INSTALL TRUE +) + +ExternalProject_Add_Step(${name} clean + EXCLUDE_FROM_MAIN TRUE + ALWAYS TRUE + DEPENDEES configure + COMMAND make clean -j + COMMAND rm -f ${BUILD_INFO_DIR}/${name}-build + WORKING_DIRECTORY ${source_dir} +) + +ExternalProject_Add_StepTargets(${name} clean) diff --git a/third-party/externals/krb5.cmake b/third-party/externals/krb5.cmake new file mode 100644 index 00000000000..e4f9941b1c5 --- /dev/null +++ b/third-party/externals/krb5.cmake @@ -0,0 +1,59 @@ +# Copyright (c) 2019 vesoft inc. All rights reserved. +# +# This source code is licensed under Apache 2.0 License, +# attached with Common Clause Condition 1.0, found in the LICENSES directory. + +set(name krb5) +set(source_dir ${CMAKE_CURRENT_BINARY_DIR}/${name}/source) +ExternalProject_Add( + ${name} + URL https://kerberos.org/dist/krb5/1.16/krb5-1.16.1.tar.gz + URL_HASH MD5=848e9b80d6aaaa798e3f3df24b83c407 +#URL https://kerberos.org/dist/krb5/1.16/krb5-1.16.3.tar.gz +#URL_HASH MD5=65f5f695bd78ba6a64ac786f571047f4 + PREFIX ${CMAKE_CURRENT_BINARY_DIR}/${name} + TMP_DIR ${BUILD_INFO_DIR} + STAMP_DIR ${BUILD_INFO_DIR} + DOWNLOAD_DIR ${DOWNLOAD_DIR} + SOURCE_DIR ${source_dir} + CONFIGURE_COMMAND "" + BUILD_COMMAND + env PATH=${BUILDING_PATH} + make -s -j${BUILDING_JOBS_NUM} -C src + BUILD_IN_SOURCE 1 + INSTALL_COMMAND + env PATH=${BUILDING_PATH} + make -s install -j${BUILDING_JOBS_NUM} -C src + LOG_CONFIGURE TRUE + LOG_BUILD TRUE + LOG_INSTALL TRUE +) + +ExternalProject_Add_Step(krb5 mannual-configure + DEPENDEES download update patch configure + DEPENDERS build install + COMMAND + ${common_configure_envs} + ./configure + ${common_configure_args} + --enable-static + --disable-shared + --disable-rpath + --disable-aesni + --disable-thread-support + --without-system-verto + WORKING_DIRECTORY ${source_dir}/src +) + +ExternalProject_Add_Step(${name} clean + EXCLUDE_FROM_MAIN TRUE + ALWAYS TRUE + DEPENDEES mannual-configure + COMMAND + env PATH=${BUILDING_PATH} + make clean -j -C src + COMMAND rm -f ${BUILD_INFO_DIR}/${name}-build + WORKING_DIRECTORY ${source_dir} +) + +ExternalProject_Add_StepTargets(${name} clean) diff --git a/third-party/externals/libaio.cmake b/third-party/externals/libaio.cmake new file mode 100644 index 00000000000..6018b1e9b2d --- /dev/null +++ b/third-party/externals/libaio.cmake @@ -0,0 +1,41 @@ +# Copyright (c) 2019 vesoft inc. All rights reserved. +# +# This source code is licensed under Apache 2.0 License, +# attached with Common Clause Condition 1.0, found in the LICENSES directory. + +set(name libaio) +set(source_dir ${CMAKE_CURRENT_BINARY_DIR}/${name}/source) +ExternalProject_Add( + ${name} + URL https://github.com/crossbuild/libaio/archive/libaio-0.3.110-1.tar.gz + URL_HASH MD5=266b58badf6d010eab433abc8713d959 + PREFIX ${CMAKE_CURRENT_BINARY_DIR}/${name} + TMP_DIR ${BUILD_INFO_DIR} + STAMP_DIR ${BUILD_INFO_DIR} + DOWNLOAD_DIR ${DOWNLOAD_DIR} + SOURCE_DIR ${source_dir} + CONFIGURE_COMMAND "" + BUILD_COMMAND env CFLAGS=-fPIC make -s -j${BUILDING_JOBS_NUM} + BUILD_IN_SOURCE 1 + INSTALL_COMMAND make prefix=${CMAKE_INSTALL_PREFIX} -s install -j${BUILDING_JOBS_NUM} + LOG_CONFIGURE TRUE + LOG_BUILD TRUE + LOG_INSTALL TRUE +) + +ExternalProject_Add_Step(${name} clean + EXCLUDE_FROM_MAIN TRUE + ALWAYS TRUE + DEPENDEES configure + COMMAND make clean -j + COMMAND rm -f ${BUILD_INFO_DIR}/${name}-build + WORKING_DIRECTORY ${source_dir} +) + +ExternalProject_Add_StepTargets(${name} clean) + +add_custom_command( + TARGET libaio POST_BUILD + COMMAND + rm -f ${CMAKE_INSTALL_PREFIX}/lib/libaio.so* +) diff --git a/third-party/externals/libevent.cmake b/third-party/externals/libevent.cmake new file mode 100644 index 00000000000..b786a49a714 --- /dev/null +++ b/third-party/externals/libevent.cmake @@ -0,0 +1,41 @@ +# Copyright (c) 2019 vesoft inc. All rights reserved. +# +# This source code is licensed under Apache 2.0 License, +# attached with Common Clause Condition 1.0, found in the LICENSES directory. + +set(name libevent) +set(source_dir ${CMAKE_CURRENT_BINARY_DIR}/${name}/source) +ExternalProject_Add( + ${name} + URL https://github.com/libevent/libevent/releases/download/release-2.1.11-stable/libevent-2.1.11-stable.tar.gz + URL_HASH MD5=7f35cfe69b82d879111ec0d7b7b1c531 + PREFIX ${CMAKE_CURRENT_BINARY_DIR}/${name} + TMP_DIR ${BUILD_INFO_DIR} + STAMP_DIR ${BUILD_INFO_DIR} + DOWNLOAD_DIR ${DOWNLOAD_DIR} + SOURCE_DIR ${source_dir} + CONFIGURE_COMMAND + ${common_configure_envs} + ./configure ${common_configure_args} + --disable-shared + --enable-static + --disable-samples + --disable-libevent-regress + BUILD_COMMAND make -s -j${BUILDING_JOBS_NUM} + BUILD_IN_SOURCE 1 + INSTALL_COMMAND make -s install -j${BUILDING_JOBS_NUM} + LOG_CONFIGURE TRUE + LOG_BUILD TRUE + LOG_INSTALL TRUE +) + +ExternalProject_Add_Step(${name} clean + EXCLUDE_FROM_MAIN TRUE + ALWAYS TRUE + DEPENDEES configure + COMMAND make clean -j + COMMAND rm -f ${BUILD_INFO_DIR}/${name}-build + WORKING_DIRECTORY ${source_dir} +) + +ExternalProject_Add_StepTargets(${name} clean) diff --git a/third-party/externals/libtool.cmake b/third-party/externals/libtool.cmake new file mode 100644 index 00000000000..520c0b3b2fd --- /dev/null +++ b/third-party/externals/libtool.cmake @@ -0,0 +1,38 @@ +# Copyright (c) 2019 vesoft inc. All rights reserved. +# +# This source code is licensed under Apache 2.0 License, +# attached with Common Clause Condition 1.0, found in the LICENSES directory. + +set(name libtool) +set(source_dir ${CMAKE_CURRENT_BINARY_DIR}/${name}/source) +ExternalProject_Add( + ${name} + URL https://ftp.gnu.org/gnu/libtool/libtool-2.4.6.tar.xz + URL_HASH MD5=1bfb9b923f2c1339b4d2ce1807064aa5 + PREFIX ${CMAKE_CURRENT_BINARY_DIR}/${name} + TMP_DIR ${BUILD_INFO_DIR} + STAMP_DIR ${BUILD_INFO_DIR} + DOWNLOAD_DIR ${DOWNLOAD_DIR} + SOURCE_DIR ${source_dir} + CONFIGURE_COMMAND + ${common_configure_envs} + "LIBS=${LIBS}" + ./configure ${common_configure_args} + BUILD_IN_SOURCE 1 + BUILD_COMMAND make -s -j${BUILDING_JOBS_NUM} + INSTALL_COMMAND make -s -j${BUILDING_JOBS_NUM} install + LOG_CONFIGURE TRUE + LOG_BUILD TRUE + LOG_INSTALL TRUE +) + +ExternalProject_Add_Step(${name} clean + EXCLUDE_FROM_MAIN TRUE + ALWAYS TRUE + DEPENDEES configure + COMMAND make clean -j + COMMAND rm -f ${BUILD_INFO_DIR}/${name}-build + WORKING_DIRECTORY ${source_dir} +) + +ExternalProject_Add_StepTargets(${name} clean) diff --git a/third-party/externals/libunwind.cmake b/third-party/externals/libunwind.cmake new file mode 100644 index 00000000000..54bbc6fd7ae --- /dev/null +++ b/third-party/externals/libunwind.cmake @@ -0,0 +1,39 @@ +# Copyright (c) 2019 vesoft inc. All rights reserved. +# +# This source code is licensed under Apache 2.0 License, +# attached with Common Clause Condition 1.0, found in the LICENSES directory. + +set(name libunwind) +set(source_dir ${CMAKE_CURRENT_BINARY_DIR}/${name}/source) +ExternalProject_Add( + ${name} + URL https://github.com/libunwind/libunwind/releases/download/v1.2.1/libunwind-1.2.1.tar.gz + URL_HASH MD5=06ba9e60d92fd6f55cd9dadb084df19e + PREFIX ${CMAKE_CURRENT_BINARY_DIR}/${name} + TMP_DIR ${BUILD_INFO_DIR} + STAMP_DIR ${BUILD_INFO_DIR} + DOWNLOAD_DIR ${DOWNLOAD_DIR} + SOURCE_DIR ${source_dir} + CONFIGURE_COMMAND + ${common_configure_envs} + ./configure ${common_configure_args} + --disable-minidebuginfo + --disable-shared --enable-static + BUILD_COMMAND make -s -j${BUILDING_JOBS_NUM} + BUILD_IN_SOURCE 1 + INSTALL_COMMAND make -s install -j${BUILDING_JOBS_NUM} + LOG_CONFIGURE TRUE + LOG_BUILD TRUE + LOG_INSTALL TRUE +) + +ExternalProject_Add_Step(${name} clean + EXCLUDE_FROM_MAIN TRUE + ALWAYS TRUE + DEPENDEES configure + COMMAND make clean -j + COMMAND rm -f ${BUILD_INFO_DIR}/${name}-build + WORKING_DIRECTORY ${source_dir} +) + +ExternalProject_Add_StepTargets(${name} clean) diff --git a/third-party/externals/lz4.cmake b/third-party/externals/lz4.cmake new file mode 100644 index 00000000000..34bf5941004 --- /dev/null +++ b/third-party/externals/lz4.cmake @@ -0,0 +1,42 @@ +# Copyright (c) 2019 vesoft inc. All rights reserved. +# +# This source code is licensed under Apache 2.0 License, +# attached with Common Clause Condition 1.0, found in the LICENSES directory. + +set(name lz4) +set(source_dir ${CMAKE_CURRENT_BINARY_DIR}/${name}/source) +ExternalProject_Add( + ${name} + URL https://github.com/lz4/lz4/archive/v1.9.2.tar.gz + URL_HASH MD5=3898c56c82fb3d9455aefd48db48eaad + DOWNLOAD_NAME lz4-1.9.2.tar.gz + PREFIX ${CMAKE_CURRENT_BINARY_DIR}/${name} + TMP_DIR ${BUILD_INFO_DIR} + STAMP_DIR ${BUILD_INFO_DIR} + DOWNLOAD_DIR ${DOWNLOAD_DIR} + SOURCE_DIR ${source_dir} + CONFIGURE_COMMAND "" + BUILD_COMMAND "" + BUILD_IN_SOURCE 1 + INSTALL_COMMAND + make install -s + MOREFLAGS=-fPIC + "LN_S=ln -sf" + BUILD_SHARED=no + -j${BUILDING_JOBS_NUM} + PREFIX=${CMAKE_INSTALL_PREFIX} + LOG_CONFIGURE TRUE + LOG_BUILD TRUE + LOG_INSTALL TRUE +) + +ExternalProject_Add_Step(${name} clean + EXCLUDE_FROM_MAIN TRUE + ALWAYS TRUE + DEPENDEES build + COMMAND make clean -j + COMMAND rm -f ${BUILD_INFO_DIR}/${name}-build + WORKING_DIRECTORY ${source_dir} +) + +ExternalProject_Add_StepTargets(${name} clean) diff --git a/third-party/externals/lzma.cmake b/third-party/externals/lzma.cmake new file mode 100644 index 00000000000..45b1866a74f --- /dev/null +++ b/third-party/externals/lzma.cmake @@ -0,0 +1,39 @@ +# Copyright (c) 2019 vesoft inc. All rights reserved. +# +# This source code is licensed under Apache 2.0 License, +# attached with Common Clause Condition 1.0, found in the LICENSES directory. + +set(name lzma) +set(source_dir ${CMAKE_CURRENT_BINARY_DIR}/${name}/source) +ExternalProject_Add( + ${name} + URL https://tukaani.org/xz/xz-5.2.4.tar.xz + URL_HASH MD5=003e4d0b1b1899fc6e3000b24feddf7c + DOWNLOAD_NAME lzma-5.2.4.tar.xz + PREFIX ${CMAKE_CURRENT_BINARY_DIR}/${name} + TMP_DIR ${BUILD_INFO_DIR} + STAMP_DIR ${BUILD_INFO_DIR} + DOWNLOAD_DIR ${DOWNLOAD_DIR} + SOURCE_DIR ${source_dir} + CONFIGURE_COMMAND + ${common_configure_envs} + ./configure ${common_configure_args} + --disable-shared --enable-static + BUILD_COMMAND make -s -j${BUILDING_JOBS_NUM} + BUILD_IN_SOURCE 1 + INSTALL_COMMAND make -s install -j${BUILDING_JOBS_NUM} PREFIX=${CMAKE_INSTALL_PREFIX} + LOG_CONFIGURE TRUE + LOG_BUILD TRUE + LOG_INSTALL TRUE +) + +ExternalProject_Add_Step(${name} clean + EXCLUDE_FROM_MAIN TRUE + ALWAYS TRUE + DEPENDEES configure + COMMAND make clean -j + COMMAND rm -f ${BUILD_INFO_DIR}/${name}-build + WORKING_DIRECTORY ${source_dir} +) + +ExternalProject_Add_StepTargets(${name} clean) diff --git a/third-party/externals/mstch.cmake b/third-party/externals/mstch.cmake new file mode 100644 index 00000000000..f49983b21b6 --- /dev/null +++ b/third-party/externals/mstch.cmake @@ -0,0 +1,37 @@ +# Copyright (c) 2019 vesoft inc. All rights reserved. +# +# This source code is licensed under Apache 2.0 License, +# attached with Common Clause Condition 1.0, found in the LICENSES directory. + +set(name mstch) +set(source_dir ${CMAKE_CURRENT_BINARY_DIR}/${name}/source) +ExternalProject_Add( + ${name} + URL https://github.com/no1msd/mstch/archive/1.0.2.tar.gz + URL_HASH MD5=306e7fead7480884f698ab47a6082e18 + DOWNLOAD_NAME mstch-1.0.2.tar.gz + PREFIX ${CMAKE_CURRENT_BINARY_DIR}/${name} + TMP_DIR ${BUILD_INFO_DIR} + STAMP_DIR ${BUILD_INFO_DIR} + DOWNLOAD_DIR ${DOWNLOAD_DIR} + SOURCE_DIR ${source_dir} + CMAKE_ARGS + ${common_cmake_args} + BUILD_COMMAND make -s -j${BUILDING_JOBS_NUM} + BUILD_IN_SOURCE 1 + INSTALL_COMMAND make -s install -j${BUILDING_JOBS_NUM} + LOG_CONFIGURE TRUE + LOG_BUILD TRUE + LOG_INSTALL TRUE +) + +ExternalProject_Add_Step(${name} clean + EXCLUDE_FROM_MAIN TRUE + ALWAYS TRUE + DEPENDEES configure + COMMAND make clean -j + COMMAND rm -f ${BUILD_INFO_DIR}/${name}-build + WORKING_DIRECTORY ${source_dir} +) + +ExternalProject_Add_StepTargets(${name} clean) diff --git a/third-party/externals/openssl.cmake b/third-party/externals/openssl.cmake new file mode 100644 index 00000000000..38889c75df9 --- /dev/null +++ b/third-party/externals/openssl.cmake @@ -0,0 +1,38 @@ +# Copyright (c) 2019 vesoft inc. All rights reserved. +# +# This source code is licensed under Apache 2.0 License, +# attached with Common Clause Condition 1.0, found in the LICENSES directory. + +set(name openssl) +set(source_dir ${CMAKE_CURRENT_BINARY_DIR}/${name}/source) +ExternalProject_Add( + ${name} + URL https://github.com/openssl/openssl/archive/OpenSSL_1_1_1c.tar.gz + URL_HASH MD5=e54191af2dbef5f172ca5b7ceea08307 + DOWNLOAD_NAME openssl-1.1.1c.tar.gz + PREFIX ${CMAKE_CURRENT_BINARY_DIR}/${name} + TMP_DIR ${BUILD_INFO_DIR} + STAMP_DIR ${BUILD_INFO_DIR} + DOWNLOAD_DIR ${DOWNLOAD_DIR} + SOURCE_DIR ${source_dir} + CONFIGURE_COMMAND + ${common_configure_envs} + ./config no-shared threads --prefix=${CMAKE_INSTALL_PREFIX} + BUILD_COMMAND make -s -j${BUILDING_JOBS_NUM} + BUILD_IN_SOURCE 1 + INSTALL_COMMAND make -s install_sw -j${BUILDING_JOBS_NUM} + LOG_CONFIGURE TRUE + LOG_BUILD TRUE + LOG_INSTALL TRUE +) + +ExternalProject_Add_Step(${name} clean + EXCLUDE_FROM_MAIN TRUE + ALWAYS TRUE + DEPENDEES configure + COMMAND make clean -j + COMMAND rm -f ${BUILD_INFO_DIR}/${name}-build + WORKING_DIRECTORY ${source_dir} +) + +ExternalProject_Add_StepTargets(${name} clean) diff --git a/third-party/externals/pkg.m4 b/third-party/externals/pkg.m4 new file mode 100644 index 00000000000..d8549a47896 --- /dev/null +++ b/third-party/externals/pkg.m4 @@ -0,0 +1,343 @@ +# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- +# serial 11 (pkg-config-0.29.1) + +dnl Copyright © 2004 Scott James Remnant . +dnl Copyright © 2012-2015 Dan Nicholson +dnl +dnl This program is free software; you can redistribute it and/or modify +dnl it under the terms of the GNU General Public License as published by +dnl the Free Software Foundation; either version 2 of the License, or +dnl (at your option) any later version. +dnl +dnl This program is distributed in the hope that it will be useful, but +dnl WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +dnl General Public License for more details. +dnl +dnl You should have received a copy of the GNU General Public License +dnl along with this program; if not, write to the Free Software +dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +dnl 02111-1307, USA. +dnl +dnl As a special exception to the GNU General Public License, if you +dnl distribute this file as part of a program that contains a +dnl configuration script generated by Autoconf, you may include it under +dnl the same distribution terms that you use for the rest of that +dnl program. + +dnl PKG_PREREQ(MIN-VERSION) +dnl ----------------------- +dnl Since: 0.29 +dnl +dnl Verify that the version of the pkg-config macros are at least +dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's +dnl installed version of pkg-config, this checks the developer's version +dnl of pkg.m4 when generating configure. +dnl +dnl To ensure that this macro is defined, also add: +dnl m4_ifndef([PKG_PREREQ], +dnl [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])]) +dnl +dnl See the "Since" comment for each macro you use to see what version +dnl of the macros you require. +m4_defun([PKG_PREREQ], +[m4_define([PKG_MACROS_VERSION], [0.29.1]) +m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1, + [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])]) +])dnl PKG_PREREQ + +dnl PKG_PROG_PKG_CONFIG([MIN-VERSION]) +dnl ---------------------------------- +dnl Since: 0.16 +dnl +dnl Search for the pkg-config tool and set the PKG_CONFIG variable to +dnl first found in the path. Checks that the version of pkg-config found +dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is +dnl used since that's the first version where most current features of +dnl pkg-config existed. +AC_DEFUN([PKG_PROG_PKG_CONFIG], +[m4_pattern_forbid([^_?PKG_[A-Z_]+$]) +m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) +m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$]) +AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) +AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) +AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) + +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then + AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) +fi +if test -n "$PKG_CONFIG"; then + _pkg_min_version=m4_default([$1], [0.9.0]) + AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + PKG_CONFIG="" + fi +fi[]dnl +])dnl PKG_PROG_PKG_CONFIG + +dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +dnl ------------------------------------------------------------------- +dnl Since: 0.18 +dnl +dnl Check to see whether a particular set of modules exists. Similar to +dnl PKG_CHECK_MODULES(), but does not set variables or print errors. +dnl +dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) +dnl only at the first occurence in configure.ac, so if the first place +dnl it's called might be skipped (such as if it is within an "if", you +dnl have to call PKG_CHECK_EXISTS manually +AC_DEFUN([PKG_CHECK_EXISTS], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +if test -n "$PKG_CONFIG" && \ + AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then + m4_default([$2], [:]) +m4_ifvaln([$3], [else + $3])dnl +fi]) + +dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) +dnl --------------------------------------------- +dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting +dnl pkg_failed based on the result. +m4_define([_PKG_CONFIG], +[if test -n "$$1"; then + pkg_cv_[]$1="$$1" + elif test -n "$PKG_CONFIG"; then + PKG_CHECK_EXISTS([$3], + [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes ], + [pkg_failed=yes]) + else + pkg_failed=untried +fi[]dnl +])dnl _PKG_CONFIG + +dnl _PKG_SHORT_ERRORS_SUPPORTED +dnl --------------------------- +dnl Internal check to see if pkg-config supports short errors. +AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG]) +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi[]dnl +])dnl _PKG_SHORT_ERRORS_SUPPORTED + + +dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], +dnl [ACTION-IF-NOT-FOUND]) +dnl -------------------------------------------------------------- +dnl Since: 0.4.0 +dnl +dnl Note that if there is a possibility the first call to +dnl PKG_CHECK_MODULES might not happen, you should be sure to include an +dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac +AC_DEFUN([PKG_CHECK_MODULES], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl +AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl + +pkg_failed=no +AC_MSG_CHECKING([for $1]) + +_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) +_PKG_CONFIG([$1][_LIBS], [libs], [$2]) + +m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS +and $1[]_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details.]) + +if test $pkg_failed = yes; then + AC_MSG_RESULT([no]) + _PKG_SHORT_ERRORS_SUPPORTED + if test $_pkg_short_errors_supported = yes; then + $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` + else + $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD + + m4_default([$4], [AC_MSG_ERROR( +[Package requirements ($2) were not met: + +$$1_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +_PKG_TEXT])[]dnl + ]) +elif test $pkg_failed = untried; then + AC_MSG_RESULT([no]) + m4_default([$4], [AC_MSG_FAILURE( +[The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +_PKG_TEXT + +To get pkg-config, see .])[]dnl + ]) +else + $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS + $1[]_LIBS=$pkg_cv_[]$1[]_LIBS + AC_MSG_RESULT([yes]) + $3 +fi[]dnl +])dnl PKG_CHECK_MODULES + + +dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], +dnl [ACTION-IF-NOT-FOUND]) +dnl --------------------------------------------------------------------- +dnl Since: 0.29 +dnl +dnl Checks for existence of MODULES and gathers its build flags with +dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags +dnl and VARIABLE-PREFIX_LIBS from --libs. +dnl +dnl Note that if there is a possibility the first call to +dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to +dnl include an explicit call to PKG_PROG_PKG_CONFIG in your +dnl configure.ac. +AC_DEFUN([PKG_CHECK_MODULES_STATIC], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +_save_PKG_CONFIG=$PKG_CONFIG +PKG_CONFIG="$PKG_CONFIG --static" +PKG_CHECK_MODULES($@) +PKG_CONFIG=$_save_PKG_CONFIG[]dnl +])dnl PKG_CHECK_MODULES_STATIC + + +dnl PKG_INSTALLDIR([DIRECTORY]) +dnl ------------------------- +dnl Since: 0.27 +dnl +dnl Substitutes the variable pkgconfigdir as the location where a module +dnl should install pkg-config .pc files. By default the directory is +dnl $libdir/pkgconfig, but the default can be changed by passing +dnl DIRECTORY. The user can override through the --with-pkgconfigdir +dnl parameter. +AC_DEFUN([PKG_INSTALLDIR], +[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])]) +m4_pushdef([pkg_description], + [pkg-config installation directory @<:@]pkg_default[@:>@]) +AC_ARG_WITH([pkgconfigdir], + [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],, + [with_pkgconfigdir=]pkg_default) +AC_SUBST([pkgconfigdir], [$with_pkgconfigdir]) +m4_popdef([pkg_default]) +m4_popdef([pkg_description]) +])dnl PKG_INSTALLDIR + + +dnl PKG_NOARCH_INSTALLDIR([DIRECTORY]) +dnl -------------------------------- +dnl Since: 0.27 +dnl +dnl Substitutes the variable noarch_pkgconfigdir as the location where a +dnl module should install arch-independent pkg-config .pc files. By +dnl default the directory is $datadir/pkgconfig, but the default can be +dnl changed by passing DIRECTORY. The user can override through the +dnl --with-noarch-pkgconfigdir parameter. +AC_DEFUN([PKG_NOARCH_INSTALLDIR], +[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])]) +m4_pushdef([pkg_description], + [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@]) +AC_ARG_WITH([noarch-pkgconfigdir], + [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],, + [with_noarch_pkgconfigdir=]pkg_default) +AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir]) +m4_popdef([pkg_default]) +m4_popdef([pkg_description]) +])dnl PKG_NOARCH_INSTALLDIR + + +dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE, +dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +dnl ------------------------------------------- +dnl Since: 0.28 +dnl +dnl Retrieves the value of the pkg-config variable for the given module. +AC_DEFUN([PKG_CHECK_VAR], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl + +_PKG_CONFIG([$1], [variable="][$3]["], [$2]) +AS_VAR_COPY([$1], [pkg_cv_][$1]) + +AS_VAR_IF([$1], [""], [$5], [$4])dnl +])dnl PKG_CHECK_VAR + +dnl PKG_WITH_MODULES(VARIABLE-PREFIX, MODULES, +dnl [ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND], +dnl [DESCRIPTION], [DEFAULT]) +dnl ------------------------------------------ +dnl +dnl Prepare a "--with-" configure option using the lowercase +dnl [VARIABLE-PREFIX] name, merging the behaviour of AC_ARG_WITH and +dnl PKG_CHECK_MODULES in a single macro. +AC_DEFUN([PKG_WITH_MODULES], +[ +m4_pushdef([with_arg], m4_tolower([$1])) + +m4_pushdef([description], + [m4_default([$5], [build with ]with_arg[ support])]) + +m4_pushdef([def_arg], [m4_default([$6], [auto])]) +m4_pushdef([def_action_if_found], [AS_TR_SH([with_]with_arg)=yes]) +m4_pushdef([def_action_if_not_found], [AS_TR_SH([with_]with_arg)=no]) + +m4_case(def_arg, + [yes],[m4_pushdef([with_without], [--without-]with_arg)], + [m4_pushdef([with_without],[--with-]with_arg)]) + +AC_ARG_WITH(with_arg, + AS_HELP_STRING(with_without, description[ @<:@default=]def_arg[@:>@]),, + [AS_TR_SH([with_]with_arg)=def_arg]) + +AS_CASE([$AS_TR_SH([with_]with_arg)], + [yes],[PKG_CHECK_MODULES([$1],[$2],$3,$4)], + [auto],[PKG_CHECK_MODULES([$1],[$2], + [m4_n([def_action_if_found]) $3], + [m4_n([def_action_if_not_found]) $4])]) + +m4_popdef([with_arg]) +m4_popdef([description]) +m4_popdef([def_arg]) + +])dnl PKG_WITH_MODULES + +dnl PKG_HAVE_WITH_MODULES(VARIABLE-PREFIX, MODULES, +dnl [DESCRIPTION], [DEFAULT]) +dnl ----------------------------------------------- +dnl +dnl Convenience macro to trigger AM_CONDITIONAL after PKG_WITH_MODULES +dnl check._[VARIABLE-PREFIX] is exported as make variable. +AC_DEFUN([PKG_HAVE_WITH_MODULES], +[ +PKG_WITH_MODULES([$1],[$2],,,[$3],[$4]) + +AM_CONDITIONAL([HAVE_][$1], + [test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"]) +])dnl PKG_HAVE_WITH_MODULES + +dnl PKG_HAVE_DEFINE_WITH_MODULES(VARIABLE-PREFIX, MODULES, +dnl [DESCRIPTION], [DEFAULT]) +dnl ------------------------------------------------------ +dnl +dnl Convenience macro to run AM_CONDITIONAL and AC_DEFINE after +dnl PKG_WITH_MODULES check. HAVE_[VARIABLE-PREFIX] is exported as make +dnl and preprocessor variable. +AC_DEFUN([PKG_HAVE_DEFINE_WITH_MODULES], +[ +PKG_HAVE_WITH_MODULES([$1],[$2],[$3],[$4]) + +AS_IF([test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"], + [AC_DEFINE([HAVE_][$1], 1, [Enable ]m4_tolower([$1])[ support])]) +])dnl PKG_HAVE_DEFINE_WITH_MODULES diff --git a/third-party/externals/pkgconf.cmake b/third-party/externals/pkgconf.cmake new file mode 100644 index 00000000000..ffd67abe406 --- /dev/null +++ b/third-party/externals/pkgconf.cmake @@ -0,0 +1,23 @@ +# Copyright (c) 2019 vesoft inc. All rights reserved. +# +# This source code is licensed under Apache 2.0 License, +# attached with Common Clause Condition 1.0, found in the LICENSES directory. + +ExternalProject_Add( + pkgconf + URL https://github.com/pkgconf/pkgconf/archive/pkgconf-1.6.1.tar.gz + URL_HASH MD5=ba6bda0fca2010a05de3ccda3fcd5b50 + PREFIX ${CMAKE_CURRENT_BINARY_DIR}/pkgconf + TMP_DIR ${BUILD_INFO_DIR} + STAMP_DIR ${BUILD_INFO_DIR} + DOWNLOAD_DIR ${DOWNLOAD_DIR} + SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/pkgconf/source + CMAKE_ARGS ${common_cmake_args} + BUILD_IN_SOURCE 1 + BUILD_COMMAND make -s -j${BUILDING_JOBS_NUM} + INSTALL_COMMAND make -s -j${BUILDING_JOBS_NUM} install + LOG_CONFIGURE TRUE + LOG_BUILD TRUE + LOG_INSTALL TRUE +) + diff --git a/third-party/externals/proxygen.cmake b/third-party/externals/proxygen.cmake new file mode 100644 index 00000000000..57cc05b3c2a --- /dev/null +++ b/third-party/externals/proxygen.cmake @@ -0,0 +1,58 @@ +# Copyright (c) 2019 vesoft inc. All rights reserved. +# +# This source code is licensed under Apache 2.0 License, +# attached with Common Clause Condition 1.0, found in the LICENSES directory. + +set(name proxygen) +set(source_dir ${CMAKE_CURRENT_BINARY_DIR}/${name}/source) + +set(ProxygenLibs "-lssl -lcrypto -ldl -lglog -lunwind ${extra_link_libs}") +if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") + # clang requires explicitly linking to libatomic + set(ProxygenLibs "${ProxygenLibs} -latomic") +endif() + +ExternalProject_Add( + ${name} + URL https://github.com/facebook/proxygen/archive/v2018.08.20.00.tar.gz + URL_HASH MD5=cc71ffdf502355b05451bcd81478f3d7 + DOWNLOAD_NAME proxygen-2018-08-20.tar.gz + PREFIX ${CMAKE_CURRENT_BINARY_DIR}/${name} + TMP_DIR ${BUILD_INFO_DIR} + STAMP_DIR ${BUILD_INFO_DIR} + DOWNLOAD_DIR ${DOWNLOAD_DIR} + SOURCE_DIR ${source_dir} + PATCH_COMMAND patch -p0 < ${CMAKE_SOURCE_DIR}/patches/proxygen-2018-08-20.patch + CONFIGURE_COMMAND "" + BUILD_COMMAND env PATH=${BUILDING_PATH} make -s -j${BUILDING_JOBS_NUM} -C proxygen + BUILD_IN_SOURCE 1 + INSTALL_COMMAND env PATH=${BUILDING_PATH} make -s -j${BUILDING_JOBS_NUM} install -C proxygen + LOG_CONFIGURE TRUE + LOG_BUILD TRUE + LOG_INSTALL TRUE +) + +ExternalProject_Add_Step(proxygen mannual-configure + DEPENDEES download update patch configure + DEPENDERS build install + COMMAND env PATH=${BUILDING_PATH} ACLOCAL_PATH=${ACLOCAL_PATH} autoreconf -if + COMMAND + ${common_configure_envs} + "LIBS=${ProxygenLibs}" + ./configure + ${common_configure_args} + --disable-shared + --enable-static + WORKING_DIRECTORY ${source_dir}/proxygen +) + +ExternalProject_Add_Step(${name} clean + EXCLUDE_FROM_MAIN TRUE + ALWAYS TRUE + DEPENDEES mannual-configure + COMMAND make clean -j + COMMAND rm -f ${BUILD_INFO_DIR}/${name}-build + WORKING_DIRECTORY ${source_dir}/proxygen +) + +ExternalProject_Add_StepTargets(${name} clean) diff --git a/third-party/externals/rocksdb.cmake b/third-party/externals/rocksdb.cmake new file mode 100644 index 00000000000..81cf394105e --- /dev/null +++ b/third-party/externals/rocksdb.cmake @@ -0,0 +1,51 @@ +# Copyright (c) 2019 vesoft inc. All rights reserved. +# +# This source code is licensed under Apache 2.0 License, +# attached with Common Clause Condition 1.0, found in the LICENSES directory. + +set(name rocksdb) +set(source_dir ${CMAKE_CURRENT_BINARY_DIR}/${name}/source) +set(ROCKSDB_CXX_FLAGS "-Wno-pessimizing-move -Wno-redundant-move -Wno-deprecated-copy -Wno-error=shadow -Wno-error=sign-compare") +ExternalProject_Add( + ${name} + URL https://github.com/facebook/rocksdb/archive/v5.15.10.tar.gz + URL_HASH MD5=5b1c1fa7ff4756218514205238d8900d + DOWNLOAD_NAME rocksdb-5.15.10.tar.gz + PREFIX ${CMAKE_CURRENT_BINARY_DIR}/${name} + TMP_DIR ${BUILD_INFO_DIR} + STAMP_DIR ${BUILD_INFO_DIR} + DOWNLOAD_DIR ${DOWNLOAD_DIR} + SOURCE_DIR ${source_dir} + UPDATE_COMMAND "" + CMAKE_ARGS + ${common_cmake_args} + -DPORTABLE=ON + -DWITH_SNAPPY=ON + -DWITH_ZSTD=ON + -DWITH_ZLIB=ON + -DWITH_JEMALLOC=OFF + -DWITH_GFLAGS=OFF + -DWITH_TESTS=OFF + -DWITH_TOOLS=OFF + -DFAIL_ON_WARNINGS=OFF + -DCMAKE_BUILD_TYPE=Release +#-DCMAKE_CXX_FLAGS:STRING=${ROCKSDB_CXX_FLAGS} + PATCH_COMMAND patch CMakeLists.txt ${CMAKE_SOURCE_DIR}/patches/rocksdb-5.15.10.patch + BUILD_IN_SOURCE 1 + BUILD_COMMAND make -s -j${BUILDING_JOBS_NUM} VERBOSE=1 + INSTALL_COMMAND make -s install -j${BUILDING_JOBS_NUM} + LOG_CONFIGURE TRUE + LOG_BUILD TRUE + LOG_INSTALL TRUE +) + +ExternalProject_Add_Step(${name} clean + EXCLUDE_FROM_MAIN TRUE + ALWAYS TRUE + DEPENDEES configure + COMMAND make clean -j + COMMAND rm -f ${BUILD_INFO_DIR}/${name}-build + WORKING_DIRECTORY ${source_dir} +) + +ExternalProject_Add_StepTargets(${name} clean) diff --git a/third-party/externals/s2geometry.cmake b/third-party/externals/s2geometry.cmake new file mode 100644 index 00000000000..ef4aa099720 --- /dev/null +++ b/third-party/externals/s2geometry.cmake @@ -0,0 +1,41 @@ +# Copyright (c) 2019 vesoft inc. All rights reserved. +# +# This source code is licensed under Apache 2.0 License, +# attached with Common Clause Condition 1.0, found in the LICENSES directory. + +set(name s2geometry) +set(source_dir ${CMAKE_CURRENT_BINARY_DIR}/${name}/source) +ExternalProject_Add( + ${name} + URL https://github.com/google/s2geometry/archive/v0.9.0.tar.gz + URL_HASH MD5=293552c7646193b8b4a01556808fe155 + DOWNLOAD_NAME ${name}-0.9.0.tar.gz + PREFIX ${CMAKE_CURRENT_BINARY_DIR}/${name} + TMP_DIR ${BUILD_INFO_DIR} + STAMP_DIR ${BUILD_INFO_DIR} + DOWNLOAD_DIR ${DOWNLOAD_DIR} + SOURCE_DIR ${source_dir} + CMAKE_ARGS + ${common_cmake_args} + -DCMAKE_BUILD_TYPE=Release + -DBUILD_EXAMPLES=OFF + -DBUILD_SHARED_LIBS=OFF + + BUILD_COMMAND make -s -j${BUILDING_JOBS_NUM} + BUILD_IN_SOURCE 1 + INSTALL_COMMAND make -s -j${BUILDING_JOBS_NUM} install + LOG_CONFIGURE TRUE + LOG_BUILD TRUE + LOG_INSTALL TRUE +) + +ExternalProject_Add_Step(${name} clean + EXCLUDE_FROM_MAIN TRUE + ALWAYS TRUE + DEPENDEES configure + COMMAND make clean -j + COMMAND rm -f ${BUILD_INFO_DIR}/${name}-build + WORKING_DIRECTORY ${source_dir} +) + +ExternalProject_Add_StepTargets(${name} clean) diff --git a/third-party/externals/snappy.cmake b/third-party/externals/snappy.cmake new file mode 100644 index 00000000000..be2a4b6d3e5 --- /dev/null +++ b/third-party/externals/snappy.cmake @@ -0,0 +1,40 @@ +# Copyright (c) 2019 vesoft inc. All rights reserved. +# +# This source code is licensed under Apache 2.0 License, +# attached with Common Clause Condition 1.0, found in the LICENSES directory. + +set(name snappy) +set(source_dir ${CMAKE_CURRENT_BINARY_DIR}/${name}/source) +ExternalProject_Add( + ${name} + URL https://github.com/google/snappy/archive/1.1.7.tar.gz + URL_HASH MD5=ee9086291c9ae8deb4dac5e0b85bf54a + DOWNLOAD_NAME snappy-1.1.7.tar.gz + PREFIX ${CMAKE_CURRENT_BINARY_DIR}/${name} + TMP_DIR ${BUILD_INFO_DIR} + STAMP_DIR ${BUILD_INFO_DIR} + DOWNLOAD_DIR ${DOWNLOAD_DIR} + SOURCE_DIR ${source_dir} + UPDATE_COMMAND "" + CMAKE_ARGS + ${common_cmake_args} + -DCMAKE_BUILD_TYPE=Release + -DSNAPPY_BUILD_TESTS=OFF + BUILD_IN_SOURCE 1 + BUILD_COMMAND make -s -j${BUILDING_JOBS_NUM} + INSTALL_COMMAND make -s install -j${BUILDING_JOBS_NUM} + LOG_CONFIGURE TRUE + LOG_BUILD TRUE + LOG_INSTALL TRUE +) + +ExternalProject_Add_Step(${name} clean + EXCLUDE_FROM_MAIN TRUE + ALWAYS TRUE + DEPENDEES configure + COMMAND make clean -j + COMMAND rm -f ${BUILD_INFO_DIR}/${name}-build + WORKING_DIRECTORY ${source_dir} +) + +ExternalProject_Add_StepTargets(${name} clean) diff --git a/third-party/externals/wangle.cmake b/third-party/externals/wangle.cmake new file mode 100644 index 00000000000..a9d73891b75 --- /dev/null +++ b/third-party/externals/wangle.cmake @@ -0,0 +1,50 @@ +# Copyright (c) 2019 vesoft inc. All rights reserved. +# +# This source code is licensed under Apache 2.0 License, +# attached with Common Clause Condition 1.0, found in the LICENSES directory. + +set(name wangle) +set(source_dir ${CMAKE_CURRENT_BINARY_DIR}/${name}/source) +ExternalProject_Add( + ${name} + URL https://github.com/facebook/wangle/archive/v2018.08.20.00.tar.gz + URL_HASH MD5=b20856081c1d21c1a033f9ca161398c5 + DOWNLOAD_NAME wangle-2018-08-20.tar.gz + PREFIX ${CMAKE_CURRENT_BINARY_DIR}/${name} + TMP_DIR ${BUILD_INFO_DIR} + STAMP_DIR ${BUILD_INFO_DIR} + DOWNLOAD_DIR ${DOWNLOAD_DIR} + SOURCE_DIR ${source_dir} + CONFIGURE_COMMAND "" + BUILD_COMMAND make -s -j${BUILDING_JOBS_NUM} -C wangle + BUILD_IN_SOURCE 1 + INSTALL_COMMAND make -s -j${BUILDING_JOBS_NUM} install -C wangle + LOG_CONFIGURE TRUE + LOG_BUILD TRUE + LOG_INSTALL TRUE +) + +ExternalProject_Add_Step(${name} mannual-configure + DEPENDEES download update patch + DEPENDERS build + COMMAND ${CMAKE_COMMAND} + ${common_cmake_args} + -DBoost_NO_SYSTEM_PATHS=OFF + -DBUILD_TESTS=OFF + -DCMAKE_EXE_LINKER_FLAGS=-latomic + -DCMAKE_SHARED_LINKER_FLAGS=-latomic + -D_OPENSSL_LIBDIR=${CMAKE_INSTALL_PREFIX}/lib64 + . + WORKING_DIRECTORY /wangle +) + +ExternalProject_Add_Step(${name} clean + EXCLUDE_FROM_MAIN TRUE + ALWAYS TRUE + DEPENDEES configure + COMMAND make clean -j + COMMAND rm -f ${BUILD_INFO_DIR}/${name}-build + WORKING_DIRECTORY /wangle +) + +ExternalProject_Add_StepTargets(${name} clean) diff --git a/third-party/externals/zlib.cmake b/third-party/externals/zlib.cmake new file mode 100644 index 00000000000..b202bb14734 --- /dev/null +++ b/third-party/externals/zlib.cmake @@ -0,0 +1,42 @@ +# Copyright (c) 2019 vesoft inc. All rights reserved. +# +# This source code is licensed under Apache 2.0 License, +# attached with Common Clause Condition 1.0, found in the LICENSES directory. + +set(name zlib) +set(source_dir ${CMAKE_CURRENT_BINARY_DIR}/${name}/source) +ExternalProject_Add( + ${name} + URL https://github.com/madler/zlib/archive/v1.2.11.tar.gz + URL_HASH MD5=0095d2d2d1f3442ce1318336637b695f + DOWNLOAD_NAME zlib-1.2.11.tar.gz + PREFIX ${CMAKE_CURRENT_BINARY_DIR}/${name} + TMP_DIR ${BUILD_INFO_DIR} + STAMP_DIR ${BUILD_INFO_DIR} + DOWNLOAD_DIR ${DOWNLOAD_DIR} + SOURCE_DIR ${source_dir} + CONFIGURE_COMMAND + "env" + "CC=${CMAKE_C_COMPILER}" + "CFLAGS=${CMAKE_C_FLAGS} -fPIC -O2" + "CPPFLAGS=-isystem ${CMAKE_INSTALL_PREFIX}/include" + "PATH=${BUILDING_PATH}" + ./configure --prefix=${CMAKE_INSTALL_PREFIX} --static + BUILD_COMMAND make -s -j${BUILDING_JOBS_NUM} + BUILD_IN_SOURCE 1 + INSTALL_COMMAND make -s install -j${BUILDING_JOBS_NUM} PREFIX=${CMAKE_INSTALL_PREFIX} + LOG_CONFIGURE TRUE + LOG_BUILD TRUE + LOG_INSTALL TRUE +) + +ExternalProject_Add_Step(${name} clean + EXCLUDE_FROM_MAIN TRUE + ALWAYS TRUE + DEPENDEES configure + COMMAND make clean -j + COMMAND rm -f ${BUILD_INFO_DIR}/${name}-build + WORKING_DIRECTORY ${source_dir} +) + +ExternalProject_Add_StepTargets(${name} clean) diff --git a/third-party/externals/zstd.cmake b/third-party/externals/zstd.cmake new file mode 100644 index 00000000000..1784c6b37a3 --- /dev/null +++ b/third-party/externals/zstd.cmake @@ -0,0 +1,40 @@ +# Copyright (c) 2019 vesoft inc. All rights reserved. +# +# This source code is licensed under Apache 2.0 License, +# attached with Common Clause Condition 1.0, found in the LICENSES directory. + +# TODO Upgrade to take advantage of optimization +set(name zstd) +set(source_dir ${CMAKE_CURRENT_BINARY_DIR}/${name}/source) +set(MakeEnvs "env" "CFLAGS=-fPIC") +ExternalProject_Add( + ${name} + URL https://github.com/facebook/zstd/archive/v1.3.4.tar.gz + URL_HASH MD5=10bf0353e3dedd8bae34a188c25d4261 + DOWNLOAD_NAME zstd-1.3.4.tar.gz + PREFIX ${CMAKE_CURRENT_BINARY_DIR}/${name} + TMP_DIR ${BUILD_INFO_DIR} + STAMP_DIR ${BUILD_INFO_DIR} + DOWNLOAD_DIR ${DOWNLOAD_DIR} + SOURCE_DIR ${source_dir} + CONFIGURE_COMMAND "" + BUILD_COMMAND + "${MakeEnvs}" + make -e -s -j${BUILDING_JOBS_NUM} + BUILD_IN_SOURCE 1 + INSTALL_COMMAND make -s install -j${BUILDING_JOBS_NUM} PREFIX=${CMAKE_INSTALL_PREFIX} + LOG_CONFIGURE TRUE + LOG_BUILD TRUE + LOG_INSTALL TRUE +) + +ExternalProject_Add_Step(${name} clean + EXCLUDE_FROM_MAIN TRUE + ALWAYS TRUE + DEPENDEES configure + COMMAND make clean -j + COMMAND rm -f ${BUILD_INFO_DIR}/${name}-build + WORKING_DIRECTORY ${source_dir} +) + +ExternalProject_Add_StepTargets(${name} clean) diff --git a/third-party/guess-building-jobs-num.sh b/third-party/guess-building-jobs-num.sh new file mode 100644 index 00000000000..8eb8832cd90 --- /dev/null +++ b/third-party/guess-building-jobs-num.sh @@ -0,0 +1,10 @@ +available_mem_mb=$(awk '/^MemFree|^Buffers|^Cached/{s+=$2;}END{print int(s/1024);}' /proc/meminfo 2>/dev/null) +physical_cores=$(lscpu | awk 'BEGIN{s=1;}/Core\(s\) per socket|Socket\(s\)/{s*=$NF;}END{print s;}' 2>/dev/null) +building_jobs_num=0 + +[[ -n $available_mem_mb ]] && jobs_by_mem=$((available_mem_mb / 1024 / 2)) +[[ -n $physical_cores ]] && jobs_by_cpu=$physical_cores + +[[ -n $jobs_by_mem ]] && building_jobs_num=$jobs_by_mem +[[ -n $jobs_by_cpu ]] && [[ $jobs_by_cpu -lt $jobs_by_mem ]] && building_jobs_num=$jobs_by_cpu +[[ $building_jobs_num -eq 0 ]] && building_jobs_num=1 diff --git a/third-party/install-cmake.sh b/third-party/install-cmake.sh new file mode 100755 index 00000000000..f969975146b --- /dev/null +++ b/third-party/install-cmake.sh @@ -0,0 +1,71 @@ +#! /usr/bin/env bash + +# Copyright (c) 2019 vesoft inc. All rights reserved. +# +# This source code is licensed under Apache 2.0 License, +# attached with Common Clause Condition 1.0, found in the LICENSES directory. + +# Usage: build-cmake.sh [prefix] + +# Always use bash +shell=$(basename $(readlink /proc/$$/exe)) +if [ ! x$shell = x"bash" ] +then + bash $0 $@ + exit $? +fi + +archive=cmake-3.15.5-Linux-x86_64.sh +url=https://cmake.org/files/v3.15/$archive +prefix=`pwd`/cmake-3.15.5 + +if [[ -n $1 ]] +then + prefix=$1 +fi + +if [[ -f $archive ]] +then + checksum=$(md5sum $archive | cut -d ' ' -f 1) +fi + +if [[ ! $checksum = 35d56e9c27b4fd2819a11c29320c655a ]] +then + hash wget &> /dev/null && download_cmd="wget -c" + hash axel &> /dev/null && download_cmd="axel -a -n 8" + if [[ -z $download_cmd ]] + then + echo "'wget' not found for downloading" 1>&2; + exit 1; + fi + + echo "Downloading with $download_cmd..." + if ! bash -c "$download_cmd $url" + then + echo "Download failed." + exit 1 + fi +fi + +set -e +mkdir -p $prefix +bash $archive --prefix=$prefix &> /dev/null < $prefix/bin/enable-cmake.sh < $prefix/bin/disable-cmake.sh </dev/null || { + echo "'wget' not fould, please install it first" 1>&2 + exit 1 +} + +download_cmd="wget -c" +wget --help | grep -q '\--show-progress' && \ + download_cmd="$download_cmd -q --show-progress" || \ + download_cmd="$download_cmd --progress=bar:force:noscroll" + +# Guess the root distro +[[ "$this_distro" = CentOS ]] && selected_distro=CentOS +[[ "$this_distro" = RedHat ]] && selected_distro=CentOS +[[ "$this_distro" = Fedora ]] && selected_distro=CentOS +[[ "$this_distro" = Debian ]] && selected_distro=Debian +[[ "$this_distro" = Ubuntu ]] && selected_distro=Debian +[[ "$this_distro" = LinuxMint ]] && selected_distro=Debian + +# backoff distro +[[ -n $this_distro ]] || selected_distro=Debian + +function version_cmp { + mapfile -t left < <( echo $1 | tr . '\n' ) + mapfile -t right < <( echo $2 | tr . '\n') + local i + for i in ${!left[@]} + do + local lv=${left[$i]} + local rv=${right[$i]} + [[ -z $rv ]] && { echo $lv; return; } + [[ $lv -ne $rv ]] && { echo $((lv - rv)); return; } + done + ((i++)) + rv=${right[$i]} + [[ ${#right[@]} -gt ${#left[@]} ]] && { echo $((0-rv)); return; } +} + +# Find the maximum version not greater than the system one +function select_libc { + local this_version=$1 + shift 1 + local candidates="$@" + for v in $candidates + do + if [[ $(version_cmp $v $this_version) -le 0 ]] + then + echo $v + break + fi + done +} + +case $selected_distro in + CentOS) + selected_libc_version=$(select_libc $this_libc_version "${CentOS_libc_preset_version[@]}") + ;; + Debian) + selected_libc_version=$(select_libc $this_libc_version "${Debian_libc_preset_version[@]}") + ;; +esac + +[[ -z $selected_libc_version ]] && { + echo "No suitable GCC found to download for your environment: $this_distro, glibc-$this_libc_version" 1>&2 + echo "Please invoke $this_dir/build-gcc.sh to build one manually" 1>&2 + exit 1 +} + +selected_archive=vesoft-gcc-$version-$selected_distro-x86_64-glibc-$selected_libc_version.sh + +url=$url_base/$selected_archive +$download_cmd $url +[[ $? -ne 0 ]] && { + echo "Downloading $selected_archive failed" 1>&2 + exit 1 +} + +bash $selected_archive $@ + +rm -rf $selected_archive diff --git a/third-party/install-third-party.sh b/third-party/install-third-party.sh new file mode 100755 index 00000000000..3110f40a8d3 --- /dev/null +++ b/third-party/install-third-party.sh @@ -0,0 +1,106 @@ +#! /usr/bin/env bash + +# Copyright (c) 2019 vesoft inc. All rights reserved. +# +# This source code is licensed under Apache 2.0 License, +# attached with Common Clause Condition 1.0, found in the LICENSES directory. + +# Usage: install-third-party.sh --prefix=/opt/vesoft/third-party + +# Always use bash +shell=$(basename $(readlink /proc/$$/exe)) +if [ ! x$shell = x"bash" ] +then + bash $0 $@ + exit $? +fi + +[[ $(uname) = Linux ]] || { + echo "Only Linux is supported" + exit 1 +} + +url_base=https://nebula-graph.oss-accelerate.aliyuncs.com/third-party +this_dir=$(dirname $(readlink -f $0)) +cxx_cmd=${CXX:-g++} + +# We consider two derivatives: Red Hat and Debian +# Place preset libc versions of each from newer to older +libc_preset_versions=( 2.27 2.23 2.17 2.12 ) +gcc_preset_versions=( 9.2.0 9.1.0 8.3.0 7.5.0 7.1.0 ) + +selected_libc_version= +selected_gcc_version= +selected_archive= +this_libc_version=$(ldd --version | head -1 | cut -d ')' -f 2 | cut -d ' ' -f 2) +this_gcc_version=$($cxx_cmd -dumpfullversion -dumpversion) +this_abi_version=$($this_dir/cxx-compiler-abi-version.sh) + +hash wget &>/dev/null || { + echo "'wget' not fould, please install it first" 1>&2 + exit 1 +} + +download_cmd="wget -c" +if [[ -t 1 ]] +then + wget --help | grep -q '\--show-progress' && \ + download_cmd="$download_cmd -q --show-progress" || \ + download_cmd="$download_cmd --progress=bar:force:noscroll" +else + download_cmd="$download_cmd -q" +fi + +function version_cmp { + mapfile -t left < <( echo $1 | tr . '\n' ) + mapfile -t right < <( echo $2 | tr . '\n') + local i + for i in ${!left[@]} + do + local lv=${left[$i]} + local rv=${right[$i]} + [[ -z $rv ]] && { echo $lv; return; } + [[ $lv -ne $rv ]] && { echo $((lv - rv)); return; } + done + ((i++)) + rv=${right[$i]} + [[ ${#right[@]} -gt ${#left[@]} ]] && { echo $((0-rv)); return; } +} + +# Find the maximum version not greater than the system one +function select_by_version { + local this_version=$1 + shift 1 + local candidates="$@" + for v in $candidates + do + if [[ $(version_cmp $v $this_version) -le 0 ]] + then + echo $v + break + fi + done +} + +selected_libc_version=$(select_by_version $this_libc_version "${libc_preset_versions[@]}") +selected_gcc_version=$(select_by_version $this_gcc_version "${gcc_preset_versions[@]}") + +[[ -z $selected_libc_version ]] && { + echo "No prebuilt third-party found to download for your environment: libc-$this_libc_version, GCC-$this_gcc_version, ABI $this_abi_version" 1>&2 + echo "Please invoke $this_dir/build-third-party.sh to build manually" 1>&2 + exit 1 +} + +selected_archive=vesoft-third-party-x86_64-libc-$selected_libc_version-gcc-$selected_gcc_version-abi-$this_abi_version.sh + +url=$url_base/$selected_archive +echo "Downloading $selected_archive..." +$download_cmd $url +[[ $? -ne 0 ]] && { + echo "Downloading $selected_archive failed" 1>&2 + exit 1 +} + +bash $selected_archive $@ + +rm -rf $selected_archive diff --git a/third-party/patches/fbthrift-2018-08-20.patch b/third-party/patches/fbthrift-2018-08-20.patch new file mode 100644 index 00000000000..a908b75e15f --- /dev/null +++ b/third-party/patches/fbthrift-2018-08-20.patch @@ -0,0 +1,192 @@ +diff --git a/thrift/compiler/parse/thriftl.ll b/thrift/compiler/parse/thriftl.ll +index 703ea6e19..b33be69d1 100644 +--- a/thrift/compiler/parse/thriftl.ll ++++ b/thrift/compiler/parse/thriftl.ll +@@ -312,27 +312,23 @@ st_identifier ([a-zA-Z-][\.a-zA-Z_0-9-]*) + } + + {identifier} { +- const char *val = strdup(yytext); +- return apache::thrift::yy::parser::make_tok_identifier(val); ++ return apache::thrift::yy::parser::make_tok_identifier(std::string{yytext}); + } + + {st_identifier} { +- const char *val = strdup(yytext); +- return apache::thrift::yy::parser::make_tok_st_identifier(val); ++ return apache::thrift::yy::parser::make_tok_st_identifier(std::string{yytext}); + } + + {dliteral} { +- char *val = strdup(yytext+1); +- val[strlen(val)-1] = '\0'; +- const char *const_val = val; +- return apache::thrift::yy::parser::make_tok_literal(const_val); ++ std::string val{yytext + 1}; ++ val = val.substr(0, val.length() - 1); ++ return apache::thrift::yy::parser::make_tok_literal(std::move(val)); + } + + {sliteral} { +- char *val = strdup(yytext+1); +- val[strlen(val)-1] = '\0'; +- const char *const_val = val; +- return apache::thrift::yy::parser::make_tok_literal(const_val); ++ std::string val{yytext + 1}; ++ val = val.substr(0, val.length() - 1); ++ return apache::thrift::yy::parser::make_tok_literal(std::move(val)); + } + + {doctext} { +diff --git a/thrift/compiler/parse/thrifty.yy b/thrift/compiler/parse/thrifty.yy +index d4b65bbe6..988956569 100644 +--- a/thrift/compiler/parse/thrifty.yy ++++ b/thrift/compiler/parse/thrifty.yy +@@ -67,7 +67,7 @@ int32_t y_enum_val = -1; + int g_arglist = 0; + const int struct_is_struct = 0; + const int struct_is_union = 1; +-char* y_enum_name = nullptr; ++const char* y_enum_name = nullptr; + + // Define an enum class for all types that have lineno embedded. + enum class LineType { +@@ -125,10 +125,10 @@ class parsing_driver; + /** + * Strings identifier + */ +-%token tok_identifier +-%token tok_literal +-%token tok_doctext +-%token tok_st_identifier ++%token tok_identifier ++%token tok_literal ++%token tok_doctext ++%token tok_st_identifier + + /** + * Constant values +@@ -242,7 +242,7 @@ class parsing_driver; + %type TypeAnnotations + %type TypeAnnotationList + %type TypeAnnotation +-%type TypeAnnotationValue ++%type TypeAnnotationValue + %type FunctionAnnotations + + %type Field +@@ -287,7 +287,7 @@ class parsing_driver; + %type Oneway + + %type CaptureDocText +-%type IntOrLiteral ++%type IntOrLiteral + + %% + +@@ -602,7 +602,7 @@ Enum: + tok_identifier + { + assert(y_enum_name == nullptr); +- y_enum_name = $3; ++ y_enum_name = $3.c_str(); + } + "{" EnumDefList "}" TypeAnnotations + { +@@ -666,7 +666,7 @@ EnumValue: + { + driver.debug("EnumValue -> tok_identifier = tok_int_constant"); + if ($3 < 0 && !driver.params.allow_neg_enum_vals) { +- driver.warning(1, "Negative value supplied for enum %s.", $1); ++ driver.warning(1, "Negative value supplied for enum %s.", $1.c_str()); + } + if ($3 < INT32_MIN || $3 > INT32_MAX) { + // Note: this used to be just a warning. However, since thrift always +@@ -674,7 +674,7 @@ EnumValue: + // I doubt this will affect many people, but users who run into this + // will have to update their thrift files to manually specify the + // truncated i32 value that thrift has always been using anyway. +- driver.failure("64-bit value supplied for enum %s will be truncated.", $1); ++ driver.failure("64-bit value supplied for enum %s will be truncated.", $1.c_str()); + } + y_enum_val = $3; + $$ = new t_enum_value($1, y_enum_val); +@@ -685,7 +685,7 @@ EnumValue: + { + driver.debug("EnumValue -> tok_identifier"); + if (y_enum_val == INT32_MAX) { +- driver.failure("enum value overflow at enum %s", $1); ++ driver.failure("enum value overflow at enum %s", $1.c_str()); + } + $$ = new t_enum_value($1); + +@@ -754,7 +754,7 @@ ConstValue: + $$ = new t_const_value(*const_value); + } else { + if (driver.mode == apache::thrift::parsing_mode::PROGRAM) { +- driver.warning(1, "Constant strings should be quoted: %s", $1); ++ driver.warning(1, "Constant strings should be quoted: %s", $1.c_str()); + } + $$ = new t_const_value($1); + } +@@ -878,13 +878,13 @@ Xception: + + if (!$$->has_field_named(v.c_str())) { + driver.failure("member specified as exception 'message' should be a valid" +- " struct member, '%s' in '%s' is not", v.c_str(), $3); ++ " struct member, '%s' in '%s' is not", v.c_str(), $3.c_str()); + } + + auto field = $$->get_field_named(v.c_str()); + if (!field->get_type()->is_string()) { + driver.failure("member specified as exception 'message' should be of type " +- "STRING, '%s' in '%s' is not", v.c_str(), $3); ++ "STRING, '%s' in '%s' is not", v.c_str(), $3.c_str()); + } + } + +@@ -929,7 +929,7 @@ Extends: + $$ = driver.scope_cache->get_service(driver.program->get_name() + "." + $2); + } + if ($$ == NULL) { +- driver.yyerror("Service \"%s\" has not been defined.", $2); ++ driver.yyerror("Service \"%s\" has not been defined.", $2.c_str()); + driver.end_parsing(); + } + } +@@ -1092,7 +1092,7 @@ Field: + { + driver.debug("tok_int_constant : Field -> FieldType tok_identifier"); + if ($2.auto_assigned) { +- driver.warning(1, "No field key specified for %s, resulting protocol may have conflicts or not be backwards compatible!", $5); ++ driver.warning(1, "No field key specified for %s, resulting protocol may have conflicts or not be backwards compatible!", $5.c_str()); + if (driver.params.strict >= 192) { + driver.yyerror("Implicit field keys are deprecated and not allowed with -strict"); + driver.end_parsing(); +@@ -1477,7 +1477,7 @@ TypeAnnotationValue: + | + { + driver.debug("TypeAnnotationValue ->"); +- $$ = strdup("1"); ++ $$ = "1"; + } + + FunctionAnnotations: +@@ -1519,7 +1519,7 @@ IntOrLiteral: + char buf[21]; // max len of int64_t as string + null terminator + driver.debug("IntOrLiteral -> tok_bool_constant"); + sprintf(buf, "%" PRIi64, $1); +- $$ = strdup(buf); ++ $$ = buf; + } + | + tok_int_constant +@@ -1527,7 +1527,7 @@ IntOrLiteral: + char buf[21]; // max len of int64_t as string + null terminator + driver.debug("IntOrLiteral -> tok_int_constant"); + sprintf(buf, "%" PRIi64, $1); +- $$ = strdup(buf); ++ $$ = buf; + } + + %% diff --git a/third-party/patches/proxygen-2018-08-20.patch b/third-party/patches/proxygen-2018-08-20.patch new file mode 100644 index 00000000000..077f78c06dd --- /dev/null +++ b/third-party/patches/proxygen-2018-08-20.patch @@ -0,0 +1,13 @@ +--- proxygen/configure.ac 2018-08-20 05:26:51.000000000 +0800 ++++ proxygen/configure.ac.new 2019-11-09 21:20:51.597440341 +0800 +@@ -205,8 +205,8 @@ + AC_MSG_ERROR([Please install gperf first.]) + fi + +-LIBS="$LIBS $BOOST_LDFLAGS -lpthread -pthread -lfolly -lglog" +-LIBS="$LIBS -ldouble-conversion -lboost_system -lboost_thread" ++LIBS="$LIBS $BOOST_LDFLAGS -lpthread -pthread" ++LIBS="$LIBS -ldouble-conversion -lboost_context -lboost_system -lboost_thread" + + AM_CONDITIONAL([HAVE_STD_THREAD], [test "$ac_cv_header_features" = "yes"]) + AM_CONDITIONAL([HAVE_X86_64], [test "$build_cpu" = "x86_64"]) diff --git a/third-party/patches/rocksdb-5.15.10.patch b/third-party/patches/rocksdb-5.15.10.patch new file mode 100644 index 00000000000..3ff0fd79656 --- /dev/null +++ b/third-party/patches/rocksdb-5.15.10.patch @@ -0,0 +1,5 @@ +448,449d447 +< add_subdirectory(third-party/gtest-1.7.0/fused-src/gtest) +< +830a829 +> add_subdirectory(third-party/gtest-1.7.0/fused-src/gtest)