IMPALA-11257: Fix CMake warnings for module names and cmake_minimum_required
This fixes a few different CMake warnings:
1. This removes cmake_minimum_required invocations except for the
top-most CMakeLists.txt. This eliminates the warnings like this:
Compatibility with CMake < 2.8.12 will be removed from a future version of
CMake.
Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.
Moving to a later version also required setting CMAKE_ENABLE_EXPORTS
to continue exporting symbols.
2. This modifies the module names so that they match the corresponding
module names from Find*.cmake. This is mostly dealing with case
differences. This address warnings like:
The package name passed to `find_package_handle_standard_args` (PROTOBUF)
does not match the name of the calling package (Protobuf). This can lead
to problems in calling code that expects `find_package` result variables
(e.g., `_FOUND`) to follow a certain pattern.
This fixed the detection logic for KerberosPrograms, and so it required
adding more Kerberos packages to bin/bootstrap_build.sh.
3. This adds a missing .cc suffix. This addresses the following warning:
CMake Warning (dev) at be/src/util/CMakeLists.txt:141 (add_library):
Policy CMP0115 is not set: Source file extensions must be explicit. Run
"cmake --help-policy CMP0115" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
These fixes mostly match how these warnings were handled in
Apache Kudu.
Testing:
- Ran GVO
Change-Id: I2a97dd07cdd0831e90882a2035415ac71d670147
Reviewed-on: http://gerrit.cloudera.org:8080/18444
Reviewed-by: Joe McDonnell <joemcdonnell@cloudera.com>
Tested-by: Impala Public Jenkins <impala-public-jenkins@cloudera.com>
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e9a5e47..652cd2a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -15,7 +15,7 @@
# specific language governing permissions and limitations
# under the License.
-cmake_minimum_required(VERSION 3.2.3)
+cmake_minimum_required(VERSION 3.14)
# This is a Kudu-specific flag that disables Kudu targets that are test-only.
set(NO_TESTS 1)
@@ -36,6 +36,13 @@
# Build compile commands database
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
+# Codegen-dependent executables need to be linked with -rdynamic; otherwise LLVM
+# can't find dependent symbols at runtime.
+#
+# Rather than setting ENABLE_EXPORTS for each target, this enables it by default,
+# as most backend tests depend on codegen. See CMake CMP0065 for more information.
+set(CMAKE_ENABLE_EXPORTS ON)
+
# generate CTest input files
enable_testing()
diff --git a/be/CMakeLists.txt b/be/CMakeLists.txt
index 6340592..83a658c 100644
--- a/be/CMakeLists.txt
+++ b/be/CMakeLists.txt
@@ -15,9 +15,6 @@
# specific language governing permissions and limitations
# under the License.
-
-cmake_minimum_required(VERSION 2.6)
-
# generate CTest input files
enable_testing()
diff --git a/be/src/exec/CMakeLists.txt b/be/src/exec/CMakeLists.txt
index b26b7e5..6e6c889 100644
--- a/be/src/exec/CMakeLists.txt
+++ b/be/src/exec/CMakeLists.txt
@@ -17,8 +17,6 @@
add_subdirectory(parquet)
-cmake_minimum_required(VERSION 2.6)
-
# where to put generated libraries
set(LIBRARY_OUTPUT_PATH "${BUILD_OUTPUT_ROOT_DIRECTORY}/exec")
diff --git a/be/src/exec/parquet/CMakeLists.txt b/be/src/exec/parquet/CMakeLists.txt
index af405d2..f2c5b55 100644
--- a/be/src/exec/parquet/CMakeLists.txt
+++ b/be/src/exec/parquet/CMakeLists.txt
@@ -15,8 +15,6 @@
# specific language governing permissions and limitations
# under the License.
-cmake_minimum_required(VERSION 2.6)
-
# where to put generated libraries
set(LIBRARY_OUTPUT_PATH "${BUILD_OUTPUT_ROOT_DIRECTORY}/exec/parquet")
diff --git a/be/src/testutil/CMakeLists.txt b/be/src/testutil/CMakeLists.txt
index 17885fa..2ac8e6b 100644
--- a/be/src/testutil/CMakeLists.txt
+++ b/be/src/testutil/CMakeLists.txt
@@ -15,9 +15,6 @@
# specific language governing permissions and limitations
# under the License.
-
-cmake_minimum_required(VERSION 2.6)
-
# where to put generated libraries
set(LIBRARY_OUTPUT_PATH "${BUILD_OUTPUT_ROOT_DIRECTORY}/testutil")
diff --git a/be/src/util/CMakeLists.txt b/be/src/util/CMakeLists.txt
index a471ac1..fcf0b5e 100644
--- a/be/src/util/CMakeLists.txt
+++ b/be/src/util/CMakeLists.txt
@@ -85,7 +85,7 @@
parquet-bloom-filter.cc
parse-util.cc
path-builder.cc
- periodic-counter-updater
+ periodic-counter-updater.cc
pprof-path-handlers.cc
progress-updater.cc
process-state-info.cc
diff --git a/bin/bootstrap_build.sh b/bin/bootstrap_build.sh
index 447e6b7..c1b78a9 100755
--- a/bin/bootstrap_build.sh
+++ b/bin/bootstrap_build.sh
@@ -30,10 +30,12 @@
set -euxo pipefail
# Install non-java dependencies:
-sudo apt-get update
-sudo apt-get --yes install g++ gcc git libsasl2-dev libssl-dev make \
- python-dev python-setuptools python3-dev python3-setuptools libffi-dev libkrb5-dev
-
+# Kerberos setup would pop up dialog boxes without this
+export DEBIAN_FRONTEND=noninteractive
+sudo -E apt-get update
+sudo -E apt-get --yes install g++ gcc git libsasl2-dev libssl-dev make python-dev \
+ python-setuptools python3-dev python3-setuptools libffi-dev libkrb5-dev \
+ krb5-admin-server krb5-kdc krb5-user
source /etc/lsb-release
diff --git a/cmake_modules/FindCrcutil.cmake b/cmake_modules/FindCrcutil.cmake
index f6ec2b1..99e187d 100644
--- a/cmake_modules/FindCrcutil.cmake
+++ b/cmake_modules/FindCrcutil.cmake
@@ -36,5 +36,5 @@
NO_SYSTEM_ENVIRONMENT_PATH)
include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(CRCUTIL REQUIRED_VARS
+find_package_handle_standard_args(Crcutil REQUIRED_VARS
CRCUTIL_SHARED_LIB CRCUTIL_STATIC_LIB CRCUTIL_INCLUDE_DIR)
diff --git a/cmake_modules/FindFlatBuffers.cmake b/cmake_modules/FindFlatBuffers.cmake
index 2ae4d36..762b8b0 100644
--- a/cmake_modules/FindFlatBuffers.cmake
+++ b/cmake_modules/FindFlatBuffers.cmake
@@ -39,5 +39,5 @@
NO_SYSTEM_ENVIRONMENT_PATH)
include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(FLATBUFFERS REQUIRED_VARS
+find_package_handle_standard_args(FlatBuffers REQUIRED_VARS
FLATBUFFERS_INCLUDE_DIR FLATBUFFERS_STATIC_LIB FLATBUFFERS_COMPILER)
diff --git a/cmake_modules/FindKerberos.cmake b/cmake_modules/FindKerberos.cmake
index b435291..85e7d9f 100644
--- a/cmake_modules/FindKerberos.cmake
+++ b/cmake_modules/FindKerberos.cmake
@@ -32,4 +32,4 @@
# handle the QUIETLY and REQUIRED arguments and set KERBEROS_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(KERBEROS DEFAULT_MSG KERBEROS_LIBRARY KERBEROS_INCLUDE_DIR)
+find_package_handle_standard_args(Kerberos DEFAULT_MSG KERBEROS_LIBRARY KERBEROS_INCLUDE_DIR)
diff --git a/cmake_modules/FindKerberosPrograms.cmake b/cmake_modules/FindKerberosPrograms.cmake
index 27b181a..f5c0b3f 100644
--- a/cmake_modules/FindKerberosPrograms.cmake
+++ b/cmake_modules/FindKerberosPrograms.cmake
@@ -34,5 +34,5 @@
/usr/lib/mit/sbin)
endforeach(bin)
-find_package_handle_standard_args(Kerberos REQUIRED_VARS ${bins}
+find_package_handle_standard_args(KerberosPrograms REQUIRED_VARS ${bins}
FAIL_MESSAGE "Kerberos binaries not found: security tests will fail")
diff --git a/cmake_modules/FindLibEv.cmake b/cmake_modules/FindLibEv.cmake
index 40443f1..110e043 100644
--- a/cmake_modules/FindLibEv.cmake
+++ b/cmake_modules/FindLibEv.cmake
@@ -37,5 +37,5 @@
NO_SYSTEM_ENVIRONMENT_PATH)
include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(LIBEV REQUIRED_VARS
+find_package_handle_standard_args(LibEv REQUIRED_VARS
LIBEV_SHARED_LIB LIBEV_STATIC_LIB LIBEV_INCLUDE_DIR)
diff --git a/cmake_modules/FindLibUnwind.cmake b/cmake_modules/FindLibUnwind.cmake
index 53f012c..f38eb49 100644
--- a/cmake_modules/FindLibUnwind.cmake
+++ b/cmake_modules/FindLibUnwind.cmake
@@ -36,5 +36,5 @@
NO_SYSTEM_ENVIRONMENT_PATH)
include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(LIBUNWIND REQUIRED_VARS
+find_package_handle_standard_args(LibUnwind REQUIRED_VARS
LIBUNWIND_SHARED_LIB LIBUNWIND_STATIC_LIB LIBUNWIND_INCLUDE_DIR)
diff --git a/cmake_modules/FindProtobuf.cmake b/cmake_modules/FindProtobuf.cmake
index f300141..10b3b71 100644
--- a/cmake_modules/FindProtobuf.cmake
+++ b/cmake_modules/FindProtobuf.cmake
@@ -230,7 +230,7 @@
NO_SYSTEM_ENVIRONMENT_PATH)
include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(PROTOBUF REQUIRED_VARS
+find_package_handle_standard_args(Protobuf REQUIRED_VARS
PROTOBUF_SHARED_LIBRARY PROTOBUF_STATIC_LIBRARY
PROTOBUF_PROTOC_SHARED_LIBRARY PROTOBUF_PROTOC_STATIC_LIBRARY
PROTOBUF_INCLUDE_DIR PROTOBUF_PROTOC_EXECUTABLE)
diff --git a/common/fbs/CMakeLists.txt b/common/fbs/CMakeLists.txt
index 446fc52..3247628 100644
--- a/common/fbs/CMakeLists.txt
+++ b/common/fbs/CMakeLists.txt
@@ -15,8 +15,6 @@
# specific language governing permissions and limitations
# under the License.
-cmake_minimum_required(VERSION 2.6)
-
# Helper function to generate build rules. For each input flatbuffer file (*.fbs), this
# function will generate a rule that maps the input file to an output c++ file.
# The flatbuffers compiler will generate multiple output files for each input file. In
diff --git a/common/function-registry/CMakeLists.txt b/common/function-registry/CMakeLists.txt
index 013632f..23ae524 100644
--- a/common/function-registry/CMakeLists.txt
+++ b/common/function-registry/CMakeLists.txt
@@ -15,9 +15,6 @@
# specific language governing permissions and limitations
# under the License.
-
-cmake_minimum_required(VERSION 2.6)
-
set(BE_OUTPUT_DIR ${CMAKE_SOURCE_DIR}/be/generated-sources)
set(FE_OUTPUT_DIR ${CMAKE_SOURCE_DIR}/fe/generated-sources/gen-java/org/apache/impala/)
diff --git a/common/protobuf/CMakeLists.txt b/common/protobuf/CMakeLists.txt
index 85b8ab9..d2fc36f 100644
--- a/common/protobuf/CMakeLists.txt
+++ b/common/protobuf/CMakeLists.txt
@@ -15,9 +15,6 @@
# specific language governing permissions and limitations
# under the License.
-
-cmake_minimum_required(VERSION 2.6)
-
add_custom_target(proto-deps)
set(PROTOBUF_OUTPUT_DIR ${CMAKE_SOURCE_DIR}/be/generated-sources/gen-cpp/)
diff --git a/common/thrift/CMakeLists.txt b/common/thrift/CMakeLists.txt
index d841566..6171137 100644
--- a/common/thrift/CMakeLists.txt
+++ b/common/thrift/CMakeLists.txt
@@ -15,9 +15,6 @@
# specific language governing permissions and limitations
# under the License.
-
-cmake_minimum_required(VERSION 2.6)
-
# Helper function to generate build rules. For each input thrift file, this function will
# generate a rule that maps the input file to the output c++ file.
# Thrift will generate multiple output files for each input (including java files) and