Skip to content

Commit

Permalink
IMPALA-4651: Add LibEv to build
Browse files Browse the repository at this point in the history
Add libev 4.20 to the Impala build. This is a dependency of KRPC.

FindLibEv.cmake was taken from Apache Kudu.

Change-Id: Iaf0646533592e6a8cd929a8cb015b83a7ea3008f
Reviewed-on: http://gerrit.cloudera.org:8080/5659
Tested-by: Impala Public Jenkins
Reviewed-by: Henry Robinson <[email protected]>
  • Loading branch information
Henry Robinson authored and jenkins committed Jan 12, 2017
1 parent 671614e commit c46e414
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ set_dep_root(GFLAGS)
set_dep_root(GLOG)
set_dep_root(GPERFTOOLS)
set_dep_root(GTEST)
set_dep_root(LIBEV)
set_dep_root(LLVM)
set(LLVM_DEBUG_ROOT $ENV{IMPALA_TOOLCHAIN}/llvm-$ENV{IMPALA_LLVM_DEBUG_VERSION})
set_dep_root(LZ4)
Expand Down Expand Up @@ -310,6 +311,11 @@ ADD_THIRDPARTY_LIB(protoc
STATIC_LIB "${PROTOBUF_PROTOC_STATIC_LIBRARY}"
DEPS protobuf)

find_package(LibEv REQUIRED)
include_directories(SYSTEM ${LIBEV_INCLUDE_DIR})
ADD_THIRDPARTY_LIB(libev
STATIC_LIB "${LIBEV_STATIC_LIB}")

###################################################################

# KuduClient can use GLOG
Expand Down
6 changes: 3 additions & 3 deletions bin/bootstrap_toolchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,9 +350,9 @@ def download_cdh_components(toolchain_root, cdh_components):
os.makedirs(toolchain_root)

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

# Download the CDH components if necessary.
Expand Down
1 change: 1 addition & 0 deletions bin/impala-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ export IMPALA_GFLAGS_VERSION=2.0
export IMPALA_GLOG_VERSION=0.3.2-p2
export IMPALA_GPERFTOOLS_VERSION=2.5
export IMPALA_GTEST_VERSION=1.6.0
export IMPALA_LIBEV_VERSION=4.20
export IMPALA_LLVM_VERSION=3.8.0-p1
export IMPALA_LLVM_ASAN_VERSION=3.8.0-p1
# Debug builds should use the release+asserts build to get additional coverage.
Expand Down
41 changes: 41 additions & 0 deletions cmake_modules/FindLibEv.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

# - Find LIBEV (ev++.h, libev.a, and libev.so)
# This module defines
# LIBEV_INCLUDE_DIR, directory containing headers
# LIBEV_SHARED_LIB, path to libev's shared library
# LIBEV_STATIC_LIB, path to libev's static library
# LIBEV_FOUND, whether libev has been found

find_path(LIBEV_INCLUDE_DIR ev++.h PATHS
${LIBEV_ROOT}/include
# make sure we don't accidentally pick up a different version
NO_CMAKE_SYSTEM_PATH
NO_SYSTEM_ENVIRONMENT_PATH)
find_library(LIBEV_SHARED_LIB ev PATHS
${LIBEV_ROOT}/lib
NO_CMAKE_SYSTEM_PATH
NO_SYSTEM_ENVIRONMENT_PATH)
find_library(LIBEV_STATIC_LIB libev.a PATHS
${LIBEV_ROOT}/lib
NO_CMAKE_SYSTEM_PATH
NO_SYSTEM_ENVIRONMENT_PATH)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(LIBEV REQUIRED_VARS
LIBEV_SHARED_LIB LIBEV_STATIC_LIB LIBEV_INCLUDE_DIR)

0 comments on commit c46e414

Please sign in to comment.