arrow-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From w...@apache.org
Subject arrow git commit: ARROW-1274: [C++] Fix CMake >= 3.3 warning. Also add option to suppress ExternalProject output
Date Thu, 27 Jul 2017 16:21:53 GMT
Repository: arrow
Updated Branches:
  refs/heads/master d76e43e72 -> cae3510d2


ARROW-1274: [C++] Fix CMake >= 3.3 warning. Also add option to suppress ExternalProject
output

The default is the current behavior, but if enabled the build output will log ExternalProject
build progress to files instead of dumping everything to the console. It might be nice to
change the default to ON but we could do that in a separate patch

Author: Wes McKinney <wes.mckinney@twosigma.com>

Closes #891 from wesm/ARROW-1274 and squashes the following commits:

a43d4e8 [Wes McKinney] Set verbose externalproject logging to true
10f8e92 [Wes McKinney] Fix CMake >= 3.3 warning. Also add option for verbose ExternalProject
logging, otherwise suppress


Project: http://git-wip-us.apache.org/repos/asf/arrow/repo
Commit: http://git-wip-us.apache.org/repos/asf/arrow/commit/cae3510d
Tree: http://git-wip-us.apache.org/repos/asf/arrow/tree/cae3510d
Diff: http://git-wip-us.apache.org/repos/asf/arrow/diff/cae3510d

Branch: refs/heads/master
Commit: cae3510d28d7a218f524d03ac07e21b4fb2f566b
Parents: d76e43e
Author: Wes McKinney <wes.mckinney@twosigma.com>
Authored: Thu Jul 27 12:21:48 2017 -0400
Committer: Wes McKinney <wes.mckinney@twosigma.com>
Committed: Thu Jul 27 12:21:48 2017 -0400

----------------------------------------------------------------------
 cpp/CMakeLists.txt                          | 28 +++++++++++++++--
 cpp/cmake_modules/ThirdpartyToolchain.cmake | 40 ++++++++++++++++++------
 2 files changed, 57 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/arrow/blob/cae3510d/cpp/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt
index 1e9aef0..07b8e15 100644
--- a/cpp/CMakeLists.txt
+++ b/cpp/CMakeLists.txt
@@ -162,6 +162,10 @@ if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}")
     "Build with zstd compression"
     ON)
 
+  option(ARROW_VERBOSE_THIRDPARTY_BUILD
+    "If off, output from ExternalProjects will be logged to files rather than shown"
+    ON)
+
   if (MSVC)
     set(BROTLI_MSVC_STATIC_LIB_SUFFIX "_static" CACHE STRING
       "Brotli static lib suffix used on Windows with MSVC (default _static)")
@@ -303,8 +307,28 @@ include_directories(src)
 # For generate_export_header() and add_compiler_export_flags().
 include(GenerateExportHeader)
 
-# Sets -fvisibility=hidden for gcc
-add_compiler_export_flags()
+# Adapted from Apache Kudu: https://github.com/apache/kudu/commit/bd549e13743a51013585
+# Honor visibility properties for all target types. See
+# "cmake --help-policy CMP0063" for details.
+#
+# This policy was only added to cmake in version 3.3, so until the cmake in
+# thirdparty is updated, we must check if the policy exists before setting it.
+if(POLICY CMP0063)
+  cmake_policy(SET CMP0063 NEW)
+endif()
+
+if (PARQUET_BUILD_SHARED)
+  if (POLICY CMP0063)
+    set_target_properties(arrow_shared
+      PROPERTIES
+      C_VISIBILITY_PRESET hidden
+      CXX_VISIBILITY_PRESET hidden
+      VISIBILITY_INLINES_HIDDEN 1)
+  else()
+    # Sets -fvisibility=hidden for gcc
+    add_compiler_export_flags()
+  endif()
+endif()
 
 ############################################################
 # Benchmarking

http://git-wip-us.apache.org/repos/asf/arrow/blob/cae3510d/cpp/cmake_modules/ThirdpartyToolchain.cmake
----------------------------------------------------------------------
diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake
index 721e866..6d47386 100644
--- a/cpp/cmake_modules/ThirdpartyToolchain.cmake
+++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake
@@ -35,6 +35,16 @@ string(TOUPPER ${CMAKE_BUILD_TYPE} UPPERCASE_BUILD_TYPE)
 set(EP_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${UPPERCASE_BUILD_TYPE}}")
 set(EP_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_${UPPERCASE_BUILD_TYPE}}")
 
+if (NOT ARROW_VERBOSE_THIRDPARTY_BUILD)
+  set(EP_LOG_OPTIONS
+    LOG_CONFIGURE 1
+    LOG_BUILD 1
+    LOG_INSTALL 1
+    LOG_DOWNLOAD 1)
+else()
+  set(EP_LOG_OPTIONS)
+endif()
+
 if (NOT MSVC)
   # Set -fPIC on all external projects
   set(EP_CXX_FLAGS "${EP_CXX_FLAGS} -fPIC")
@@ -205,7 +215,8 @@ if(ARROW_BUILD_TESTS OR ARROW_BUILD_BENCHMARKS)
     ExternalProject_Add(googletest_ep
       URL "https://github.com/google/googletest/archive/release-${GTEST_VERSION}.tar.gz"
       BUILD_BYPRODUCTS ${GTEST_STATIC_LIB} ${GTEST_MAIN_STATIC_LIB}
-      CMAKE_ARGS ${GTEST_CMAKE_ARGS})
+      CMAKE_ARGS ${GTEST_CMAKE_ARGS}
+      ${EP_LOG_OPTIONS})
   else()
     find_package(GTest REQUIRED)
     set(GTEST_VENDORED 0)
@@ -250,6 +261,7 @@ if(ARROW_BUILD_TESTS OR ARROW_BUILD_BENCHMARKS)
 
     ExternalProject_Add(gflags_ep
       URL ${GFLAGS_URL}
+      ${EP_LOG_OPTIONS}
       BUILD_IN_SOURCE 1
       BUILD_BYPRODUCTS "${GFLAGS_STATIC_LIB}"
       CMAKE_ARGS ${GFLAGS_CMAKE_ARGS})
@@ -300,7 +312,8 @@ if(ARROW_BUILD_BENCHMARKS)
     ExternalProject_Add(gbenchmark_ep
       URL "https://github.com/google/benchmark/archive/v${GBENCHMARK_VERSION}.tar.gz"
       BUILD_BYPRODUCTS "${GBENCHMARK_STATIC_LIB}"
-      CMAKE_ARGS ${GBENCHMARK_CMAKE_ARGS})
+      CMAKE_ARGS ${GBENCHMARK_CMAKE_ARGS}
+      ${EP_LOG_OPTIONS})
   else()
     find_package(GBenchmark REQUIRED)
     set(GBENCHMARK_VENDORED 0)
@@ -327,6 +340,7 @@ if (ARROW_IPC)
       CONFIGURE_COMMAND ""
       BUILD_COMMAND ""
       BUILD_IN_SOURCE 1
+      ${EP_LOG_OPTIONS}
       INSTALL_COMMAND "")
 
     ExternalProject_Get_Property(rapidjson_ep SOURCE_DIR)
@@ -356,7 +370,8 @@ if (ARROW_IPC)
       CMAKE_ARGS
       "-DCMAKE_CXX_FLAGS=${FLATBUFFERS_CMAKE_CXX_FLAGS}"
       "-DCMAKE_INSTALL_PREFIX:PATH=${FLATBUFFERS_PREFIX}"
-      "-DFLATBUFFERS_BUILD_TESTS=OFF")
+      "-DFLATBUFFERS_BUILD_TESTS=OFF"
+      ${EP_LOG_OPTIONS})
 
     set(FLATBUFFERS_INCLUDE_DIR "${FLATBUFFERS_PREFIX}/include")
     set(FLATBUFFERS_COMPILER "${FLATBUFFERS_PREFIX}/bin/flatc")
@@ -395,6 +410,7 @@ if (ARROW_JEMALLOC)
     ExternalProject_Add(jemalloc_ep
       URL https://github.com/jemalloc/jemalloc/releases/download/${JEMALLOC_VERSION}/jemalloc-${JEMALLOC_VERSION}.tar.bz2
       CONFIGURE_COMMAND ./configure "--prefix=${JEMALLOC_PREFIX}" "--with-jemalloc-prefix="
+      ${EP_LOG_OPTIONS}
       BUILD_IN_SOURCE 1
       BUILD_COMMAND ${MAKE}
       BUILD_BYPRODUCTS "${JEMALLOC_STATIC_LIB}" "${JEMALLOC_SHARED_LIB}"
@@ -475,6 +491,7 @@ if (ARROW_WITH_ZLIB)
 
     ExternalProject_Add(zlib_ep
       URL "http://zlib.net/fossils/zlib-1.2.8.tar.gz"
+      ${EP_LOG_OPTIONS}
       BUILD_BYPRODUCTS "${ZLIB_STATIC_LIB}"
       CMAKE_ARGS ${ZLIB_CMAKE_ARGS})
     set(ZLIB_VENDORED 1)
@@ -529,6 +546,7 @@ if (ARROW_WITH_SNAPPY)
                         ./config.h)
       ExternalProject_Add(snappy_ep
         UPDATE_COMMAND ${SNAPPY_UPDATE_COMMAND}
+        ${EP_LOG_OPTIONS}
         BUILD_IN_SOURCE 1
         BUILD_COMMAND ${MAKE}
         INSTALL_DIR ${SNAPPY_PREFIX}
@@ -538,6 +556,7 @@ if (ARROW_WITH_SNAPPY)
     else()
       ExternalProject_Add(snappy_ep
         CONFIGURE_COMMAND ./configure --with-pic "--prefix=${SNAPPY_PREFIX}" ${SNAPPY_CXXFLAGS}
+        ${EP_LOG_OPTIONS}
         BUILD_IN_SOURCE 1
         BUILD_COMMAND ${MAKE}
         INSTALL_DIR ${SNAPPY_PREFIX}
@@ -586,6 +605,7 @@ if (ARROW_WITH_BROTLI)
       URL "https://github.com/google/brotli/archive/${BROTLI_VERSION}.tar.gz"
       BUILD_BYPRODUCTS "${BROTLI_STATIC_LIBRARY_ENC}" "${BROTLI_STATIC_LIBRARY_DEC}" "${BROTLI_STATIC_LIBRARY_COMMON}"
       ${BROTLI_BUILD_BYPRODUCTS}
+      ${EP_LOG_OPTIONS}
       CMAKE_ARGS ${BROTLI_CMAKE_ARGS}
       STEP_TARGETS headers_copy)
     if (MSVC)
@@ -624,7 +644,7 @@ if (ARROW_WITH_LZ4)
   if("${LZ4_HOME}" STREQUAL "")
     set(LZ4_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/lz4_ep-prefix/src/lz4_ep")
     set(LZ4_INCLUDE_DIR "${LZ4_BUILD_DIR}/lib")
-  
+
     if (MSVC)
       set(LZ4_STATIC_LIB "${LZ4_BUILD_DIR}/visual/VS2010/bin/x64_${CMAKE_BUILD_TYPE}/liblz4_static.lib")
       set(LZ4_BUILD_COMMAND BUILD_COMMAND msbuild.exe /m /p:Configuration=${CMAKE_BUILD_TYPE}
/p:Platform=x64 /p:PlatformToolset=v140 /t:Build ${LZ4_BUILD_DIR}/visual/VS2010/lz4.sln)
@@ -632,9 +652,10 @@ if (ARROW_WITH_LZ4)
       set(LZ4_STATIC_LIB "${LZ4_BUILD_DIR}/lib/liblz4.a")
       set(LZ4_BUILD_COMMAND BUILD_COMMAND ${CMAKE_SOURCE_DIR}/build-support/build-lz4-lib.sh)
     endif()
-  
+
     ExternalProject_Add(lz4_ep
         URL "https://github.com/lz4/lz4/archive/v${LZ4_VERSION}.tar.gz"
+        ${EP_LOG_OPTIONS}
         UPDATE_COMMAND ""
         PATCH_COMMAND ""
         CONFIGURE_COMMAND ""
@@ -643,22 +664,22 @@ if (ARROW_WITH_LZ4)
         BUILD_BYPRODUCTS ${LZ4_STATIC_LIB}
         ${LZ4_BUILD_COMMAND}
         )
-  
+
     set(LZ4_VENDORED 1)
   else()
     find_package(Lz4 REQUIRED)
     set(LZ4_VENDORED 0)
   endif()
-  
+
   include_directories(SYSTEM ${LZ4_INCLUDE_DIR})
   ADD_THIRDPARTY_LIB(lz4_static
     STATIC_LIB ${LZ4_STATIC_LIB})
-  
+
   if (LZ4_VENDORED)
     add_dependencies(lz4_static lz4_ep)
   endif()
 endif()
-  
+
 if (ARROW_WITH_ZSTD)
 # ----------------------------------------------------------------------
 # ZSTD
@@ -677,6 +698,7 @@ if (ARROW_WITH_ZSTD)
 
     ExternalProject_Add(zstd_ep
         URL "https://github.com/facebook/zstd/archive/v${ZSTD_VERSION}.tar.gz"
+        ${EP_LOG_OPTIONS}
         UPDATE_COMMAND ""
         PATCH_COMMAND ""
         CONFIGURE_COMMAND ""


Mime
View raw message