Skip to content

Instantly share code, notes, and snippets.

@rampage644
Created November 24, 2014 15:56
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rampage644/74b7f1200c3c11c5be02 to your computer and use it in GitHub Desktop.
Save rampage644/74b7f1200c3c11c5be02 to your computer and use it in GitHub Desktop.
Impala build

Building Impala

  • Version: cdh5-2.0_5.2.0
  • OS: Archlinux 3.17.2-1-ARCH x86_64
  • gcc version 4.9.2

Berkeley DB version >= 5

Apply this patch:

git apply db5.patch
 diff --git a/thirdparty/cyrus-sasl-2.1.23/sasldb/db_berkeley.c b/thirdparty/cyrus-sasl-2.1.23/sasldb/db_berkeley.c
index f655687..2c2083b 100644
--- a/thirdparty/cyrus-sasl-2.1.23/sasldb/db_berkeley.c
+++ b/thirdparty/cyrus-sasl-2.1.23/sasldb/db_berkeley.c
@@ -101,6 +101,8 @@ static int berkeleydb_open(const sasl_utils_t *utils,
     if (ret == 0 && *mbdb != NULL)
     {
 #if DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 1
+  ret = (*mbdb)->open(*mbdb, NULL, path, NULL, DB_HASH, flags, 0660);
+#elif DB_VERSION_MAJOR >= 5
    ret = (*mbdb)->open(*mbdb, NULL, path, NULL, DB_HASH, flags, 0660);
 #else
    ret = (*mbdb)->open(*mbdb, path, NULL, DB_HASH, flags, 0660);
diff --git a/thirdparty/cyrus-sasl-2.1.23/utils/dbconverter-2.c b/thirdparty/cyrus-sasl-2.1.23/utils/dbconverter-2.c
index d188e00..840f7ff 100644
--- a/thirdparty/cyrus-sasl-2.1.23/utils/dbconverter-2.c
+++ b/thirdparty/cyrus-sasl-2.1.23/utils/dbconverter-2.c
@@ -216,6 +216,8 @@ static int berkeleydb_open(const char *path,DB **mbdb)
     {
 #if DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 1
    ret = (*mbdb)->open(*mbdb, NULL, path, NULL, DB_HASH, DB_CREATE, 0664);
+#elif DB_VERSION_MAJOR >= 5
+    ret = (*mbdb)->open(*mbdb, NULL, path, NULL, DB_HASH, DB_CREATE, 0664);
 #else
    ret = (*mbdb)->open(*mbdb, path, NULL, DB_HASH, DB_CREATE, 0664);
 #endif

Thrift

Bug

Apply patch:

diff --git a/thirdparty/thrift-0.9.0/compiler/cpp/src/main.h b/thirdparty/thrift-0.9.0/compiler/cpp/src/main.h
index 667fc43..cdf0d6f 100644
--- a/thirdparty/thrift-0.9.0/compiler/cpp/src/main.h
+++ b/thirdparty/thrift-0.9.0/compiler/cpp/src/main.h
@@ -28,7 +28,7 @@
  * Defined in the flex library
  */
 
-int yylex(void);
+extern "C" int yylex(void);
 
 int yyparse(void);

Boost 1.46.1

wget -c 'http://sourceforge.net/projects/boost/files/boost/1.46.1/boost_1_46_1.tar.bz2/download'
tar xf download

First fix some bugs in boost sources

find . -type f -print0 | xargs -0 sed -i 's/TIME_UTC/TIME_UTC_/g'
// typedef  ::boost::long_long_type            int64_t;
typedef long int int64_t;
// typedef  ::boost::ulong_long_type   uint64_t;
typedef long unsigned int uint64_t;
// #if defined(BOOST_HAS_STDINT_H) && (!defined(__GLIBC__) ||
// defined(__GLIBC_HAVE_LONG_LONG))
# if defined(BOOST_HAS_STDINT_H)                    \
&& (!defined(__GLIBC__)                 \
    || defined(__GLIBC_HAVE_LONG_LONG)          \
    || (defined(__GLIBC__) && ((__GLIBC__ > 2) || ((__GLIBC__ == 2) && 
(__GLIBC_MINOR__ >= 17)))))

Fast reference to build the boost

./bootstrap.sh --prefix=install --with-libraries=filesystem, regex, system
sudo ./bjam --layout=tagged --libdir=/usr/lib64 cxxflags=-fPIC threading=multi install

LLVM 3.3

wget http://llvm.org/releases/3.3/llvm-3.3.src.tar.gz
tar xvf llvm-3.3.src.tar.gz
cd llvm-3.3.src/tools/
svn co http://llvm.org/svn/llvm-project/cfe/tags/RELEASE_33/final/ clang
cd ../projects/
svn co http://llvm.org/svn/llvm-project/compiler-rt/tags/RELEASE_33/final
cd ..
./configure --with-pic
make -j4 REQUIRES_RTTI=1

Exports

export JAVA_HOME
export LLVM_HOME=<path-to-llvm-bin-dir>/Release+Asserts/bin
export BOOST_ROOT=<path-to-boost-root>/install

Build

./buildall.sh # builds everything

. ./bin/impala-config.sh # sets all ENV vars
./bin/build_thirdparty.sh # builds thirdparty dependecies

cmake .
./bin/make_impala.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment