Skip to content

Commit

Permalink
Fix direct compilation failed apache#1862 (apache#1875)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
yangzhg authored and imay committed Sep 26, 2019
1 parent f3bbdfe commit 5d1165f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
9 changes: 8 additions & 1 deletion be/src/olap/key_coder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ KeyCoder::KeyCoder(TraitsType traits)
_decode_ascending(traits.decode_ascending) {
}

struct EnumClassHash {
template <typename T>
std::size_t operator()(T t) const {
return static_cast<std::size_t>(t);
}
};

// Helper class used to get KeyCoder
class KeyCoderResolver {
public:
Expand Down Expand Up @@ -71,7 +78,7 @@ class KeyCoderResolver {
_coder_map.emplace(field_type, new KeyCoder(KeyCoderTraits<field_type>()));
}

std::unordered_map<FieldType, KeyCoder*> _coder_map;
std::unordered_map<FieldType, KeyCoder*, EnumClassHash> _coder_map;
};

const KeyCoder* get_key_coder(FieldType type) {
Expand Down
2 changes: 1 addition & 1 deletion env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down
2 changes: 2 additions & 0 deletions thirdparty/build-thirdparty.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 ../
Expand Down Expand Up @@ -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/ \
Expand Down

0 comments on commit 5d1165f

Please sign in to comment.