Skip to content

Commit 60c1c6e

Browse files
dtsirogiannisImpala Public Jenkins
authored and
Impala Public Jenkins
committed
IMPALA-4966: Add flatbuffers to build
FlatBuffers version 1.6.0 is already included in the toolchain. This commit adds it to the build system. Change-Id: I2ca255ddf08ac846b454bfa1470ed67b1338d2b0 Reviewed-on: http://gerrit.cloudera.org:8080/6180 Reviewed-by: Dimitris Tsirogiannis <dtsirogiannis@cloudera.com> Tested-by: Impala Public Jenkins
1 parent 71eb569 commit 60c1c6e

File tree

4 files changed

+57
-4
lines changed

4 files changed

+57
-4
lines changed

CMakeLists.txt

+9
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ set_dep_root(BOOST)
7373
set_dep_root(BREAKPAD)
7474
set_dep_root(BZIP2)
7575
set_dep_root(CRCUTIL)
76+
set_dep_root(FLATBUFFERS)
7677
set_dep_root(GCC)
7778
set_dep_root(GFLAGS)
7879
set_dep_root(GLOG)
@@ -244,6 +245,14 @@ message(STATUS "Thrift library path: ${THRIFT_LIBS}")
244245
message(STATUS "Thrift static library: ${THRIFT_STATIC_LIB}")
245246
message(STATUS "Thrift compiler: ${THRIFT_COMPILER}")
246247

248+
# find flatbuffers headers, lib and compiler
249+
find_package(FlatBuffers REQUIRED)
250+
include_directories(${FLATBUFFERS_INCLUDE_DIR})
251+
set(LIBS ${LIBS} ${FLATBUFFERS_LIBS})
252+
message(STATUS "FlatBuffers include dir: ${FLATBUFFERS_INCLUDE_DIR}")
253+
message(STATUS "FlatBuffers library path: ${FLATBUFFERS_LIBS}")
254+
message(STATUS "FlatBuffers compiler: ${FLATBUFFERS_COMPILER}")
255+
247256
# find Snappy headers and libs
248257
find_package(Snappy REQUIRED)
249258
include_directories(${SNAPPY_INCLUDE_DIR})

bin/bootstrap_toolchain.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -349,10 +349,10 @@ def download_cdh_components(toolchain_root, cdh_components):
349349
if not os.path.exists(toolchain_root):
350350
os.makedirs(toolchain_root)
351351

352-
packages = ["avro", "binutils", "boost", "breakpad", "bzip2", "cmake", "crcutil", "gcc",
353-
"gflags", "glog", "gperftools", "gtest", "kudu", "libev", "llvm",
354-
("llvm", "3.8.0-asserts-p1"), "lz4", "openldap", "protobuf", "rapidjson", "re2",
355-
"snappy", "thrift", "tpc-h", "tpc-ds", "zlib"]
352+
packages = ["avro", "binutils", "boost", "breakpad", "bzip2", "cmake", "crcutil",
353+
"flatbuffers", "gcc", "gflags", "glog", "gperftools", "gtest", "kudu", "libev",
354+
"llvm", ("llvm", "3.8.0-asserts-p1"), "lz4", "openldap", "protobuf", "rapidjson",
355+
"re2", "snappy", "thrift", "tpc-h", "tpc-ds", "zlib"]
356356
bootstrap(toolchain_root, packages)
357357

358358
# Download the CDH components if necessary.

bin/impala-config.sh

+1
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ export IMPALA_BZIP2_VERSION=1.0.6-p2
8484
export IMPALA_CMAKE_VERSION=3.2.3-p1
8585
export IMPALA_CRCUTIL_VERSION=440ba7babeff77ffad992df3a10c767f184e946e
8686
export IMPALA_CYRUS_SASL_VERSION=2.1.23
87+
export IMPALA_FLATBUFFERS_VERSION=1.6.0
8788
export IMPALA_GCC_VERSION=4.9.2
8889
export IMPALA_GFLAGS_VERSION=2.0
8990
export IMPALA_GLOG_VERSION=0.3.2-p2

cmake_modules/FindFlatBuffers.cmake

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
##############################################################################
2+
# Licensed to the Apache Software Foundation (ASF) under one
3+
# or more contributor license agreements. See the NOTICE file
4+
# distributed with this work for additional information
5+
# regarding copyright ownership. The ASF licenses this file
6+
# to you under the Apache License, Version 2.0 (the
7+
# "License"); you may not use this file except in compliance
8+
# with the License. You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing,
13+
# software distributed under the License is distributed on an
14+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
# KIND, either express or implied. See the License for the
16+
# specific language governing permissions and limitations
17+
# under the License.
18+
##############################################################################
19+
20+
# Find FLATBUFFERS (flatbuffers/include, libflatbuffers.a, flatc)
21+
# This module defines:
22+
# FLATBUFFERS_INCLUDE_DIR, directory containing headers
23+
# FLATBUFFERS_LIBS, path to flatbuffers's static library
24+
# FLATBUFFERS_COMPILER, path to flatc compiler
25+
26+
find_path(FLATBUFFERS_INCLUDE_DIR flatbuffers/flatbuffers.h
27+
PATHS ${FLATBUFFERS_ROOT}/include
28+
NO_CMAKE_SYSTEM_PATH
29+
NO_SYSTEM_ENVIRONMENT_PATH)
30+
31+
find_library(FLATBUFFERS_LIBS libflatbuffers.a
32+
PATHS ${FLATBUFFERS_ROOT}/lib
33+
NO_CMAKE_SYSTEM_PATH
34+
NO_SYSTEM_ENVIRONMENT_PATH)
35+
36+
find_program(FLATBUFFERS_COMPILER flatc
37+
PATHS ${FLATBUFFERS_ROOT}/bin
38+
NO_CMAKE_SYSTEM_PATH
39+
NO_SYSTEM_ENVIRONMENT_PATH)
40+
41+
include(FindPackageHandleStandardArgs)
42+
find_package_handle_standard_args(FLATBUFFERS REQUIRED_VARS
43+
FLATBUFFERS_INCLUDE_DIR FLATBUFERS_LIBS FLATBUFFERS_COMPILER)

0 commit comments

Comments
 (0)