From 5d1165fad2b2c6174d6e0c70b000a873003c7bfc Mon Sep 17 00:00:00 2001 From: yangzhg <780531911@qq.com> Date: Thu, 26 Sep 2019 09:34:41 +0800 Subject: [PATCH] Fix direct compilation failed #1862 (#1875) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix direct compilation failed: fix compile thirdparty in ubuntu will install libs to lib dir instead of lib64 fix compile error in gcc5 due to the defect of c++11 (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60970) fix gcc version check will not work on some OS --- be/src/olap/key_coder.cpp | 9 ++++++++- env.sh | 2 +- thirdparty/build-thirdparty.sh | 2 ++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/be/src/olap/key_coder.cpp b/be/src/olap/key_coder.cpp index 816dfe0b9fcb4f..8624e25f089568 100644 --- a/be/src/olap/key_coder.cpp +++ b/be/src/olap/key_coder.cpp @@ -27,6 +27,13 @@ KeyCoder::KeyCoder(TraitsType traits) _decode_ascending(traits.decode_ascending) { } +struct EnumClassHash { + template + std::size_t operator()(T t) const { + return static_cast(t); + } +}; + // Helper class used to get KeyCoder class KeyCoderResolver { public: @@ -71,7 +78,7 @@ class KeyCoderResolver { _coder_map.emplace(field_type, new KeyCoder(KeyCoderTraits())); } - std::unordered_map _coder_map; + std::unordered_map _coder_map; }; const KeyCoder* get_key_coder(FieldType type) { diff --git a/env.sh b/env.sh index 2bbe6853cd1036..24a4aa60159dfc 100755 --- a/env.sh +++ b/env.sh @@ -54,7 +54,7 @@ if [[ -z ${DORIS_GCC_HOME} ]]; then export DORIS_GCC_HOME=$(dirname `which gcc`)/.. fi -gcc_ver=`${DORIS_GCC_HOME}/bin/gcc -dumpversion` +gcc_ver=`${DORIS_GCC_HOME}/bin/gcc -dumpfullversion -dumpversion` required_ver="5.3.1" if [[ ! "$(printf '%s\n' "$required_ver" "$gcc_ver" | sort -V | head -n1)" = "$required_ver" ]]; then echo "Error: GCC version (${gcc_ver}) must be greater than or equal to ${required_ver}" diff --git a/thirdparty/build-thirdparty.sh b/thirdparty/build-thirdparty.sh index 92513ae224e01e..a78341791d43be 100755 --- a/thirdparty/build-thirdparty.sh +++ b/thirdparty/build-thirdparty.sh @@ -322,6 +322,7 @@ build_snappy() { mkdir build -p && cd build rm -rf CMakeCache.txt CMakeFiles/ CFLAGS="-O3" CXXFLAGS="-O3" $CMAKE_CMD -DCMAKE_INSTALL_PREFIX=$TP_INSTALL_DIR \ + -DCMAKE_INSTALL_LIBDIR=lib64 \ -DCMAKE_POSITION_INDEPENDENT_CODE=On \ -DCMAKE_INSTALL_INCLUDEDIR=$TP_INCLUDE_DIR/snappy \ -DSNAPPY_BUILD_TESTS=0 ../ @@ -536,6 +537,7 @@ build_arrow() { cmake -DARROW_PARQUET=ON -DARROW_IPC=OFF -DARROW_BUILD_SHARED=OFF \ -DCMAKE_INSTALL_PREFIX=$TP_INSTALL_DIR \ + -DCMAKE_INSTALL_LIBDIR=lib64 \ -DARROW_BOOST_USE_SHARED=OFF -DBoost_NO_BOOST_CMAKE=ON -DBOOST_ROOT=$TP_INSTALL_DIR \ -Dgflags_ROOT=$TP_INSTALL_DIR/ \ -DSnappy_ROOT=$TP_INSTALL_DIR/ \