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-647: [C++] Use Boost shared libraries for tests and utilities
Date Sat, 18 Mar 2017 20:40:43 GMT
Repository: arrow
Updated Branches:
  refs/heads/master 5ef684003 -> 019f90d75


ARROW-647: [C++] Use Boost shared libraries for tests and utilities

Boost shared libraries are used when ARROW_BOOST_USE_SHARED is true.
Without this change, tests and utilities use Boost static libraries
event when ARROW_BOOST_USE_SHARED.

CentOS 7 provides boost-system and boost-filesystem packages but they
include only shared libraries. They don't include static libraries.

Apache Arrow C++ requires Boost static libraries only for tests and
utilities. We can support CentOS 7 by making Boost static libraries
optional.

Author: Kouhei Sutou <kou@clear-code.com>

Closes #400 from kou/use-boost-shared-libraries-for-tests-and-utilities and squashes the following
commits:

094b69f [Kouhei Sutou] [C++] Use Boost shared libraries for tests and utilities


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

Branch: refs/heads/master
Commit: 019f90d75a21f6ff7b00d657310ad1c61e5ace01
Parents: 5ef6840
Author: Kouhei Sutou <kou@clear-code.com>
Authored: Sat Mar 18 16:40:37 2017 -0400
Committer: Wes McKinney <wes.mckinney@twosigma.com>
Committed: Sat Mar 18 16:40:37 2017 -0400

----------------------------------------------------------------------
 cpp/CMakeLists.txt               | 46 ++++++++++++++++++++---------------
 cpp/src/arrow/io/CMakeLists.txt  | 16 ++++--------
 cpp/src/arrow/ipc/CMakeLists.txt | 19 +++++----------
 3 files changed, 37 insertions(+), 44 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/arrow/blob/019f90d7/cpp/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt
index b39646e..197aa9c 100644
--- a/cpp/CMakeLists.txt
+++ b/cpp/CMakeLists.txt
@@ -410,29 +410,35 @@ endfunction()
 # ----------------------------------------------------------------------
 # Add Boost dependencies (code adapted from Apache Kudu (incubating))
 
-# Find static boost headers and libs
-# TODO Differentiate here between release and debug builds
 set(Boost_DEBUG TRUE)
 set(Boost_USE_MULTITHREADED ON)
-set(Boost_USE_STATIC_LIBS ON)
-find_package(Boost COMPONENTS system filesystem REQUIRED)
-if ("${CMAKE_BUILD_TYPE}" STREQUAL "DEBUG")
-  set(BOOST_STATIC_SYSTEM_LIBRARY ${Boost_SYSTEM_LIBRARY_DEBUG})
-  set(BOOST_STATIC_FILESYSTEM_LIBRARY ${Boost_FILESYSTEM_LIBRARY_DEBUG})
-else()
-  set(BOOST_STATIC_SYSTEM_LIBRARY ${Boost_SYSTEM_LIBRARY_RELEASE})
-  set(BOOST_STATIC_FILESYSTEM_LIBRARY ${Boost_FILESYSTEM_LIBRARY_RELEASE})
-endif()
-
-# Find shared Boost libraries.
-set(Boost_USE_STATIC_LIBS OFF)
-find_package(Boost COMPONENTS system filesystem REQUIRED)
-if ("${CMAKE_BUILD_TYPE}" STREQUAL "DEBUG")
-  set(BOOST_SHARED_SYSTEM_LIBRARY ${Boost_SYSTEM_LIBRARY_DEBUG})
-  set(BOOST_SHARED_FILESYSTEM_LIBRARY ${Boost_FILESYSTEM_LIBRARY_DEBUG})
+if (ARROW_BOOST_USE_SHARED)
+  # Find shared Boost libraries.
+  set(Boost_USE_STATIC_LIBS OFF)
+  find_package(Boost COMPONENTS system filesystem REQUIRED)
+  if ("${CMAKE_BUILD_TYPE}" STREQUAL "DEBUG")
+    set(BOOST_SHARED_SYSTEM_LIBRARY ${Boost_SYSTEM_LIBRARY_DEBUG})
+    set(BOOST_SHARED_FILESYSTEM_LIBRARY ${Boost_FILESYSTEM_LIBRARY_DEBUG})
+  else()
+    set(BOOST_SHARED_SYSTEM_LIBRARY ${Boost_SYSTEM_LIBRARY_RELEASE})
+    set(BOOST_SHARED_FILESYSTEM_LIBRARY ${Boost_FILESYSTEM_LIBRARY_RELEASE})
+  endif()
+  set(BOOST_SYSTEM_LIBRARY boost_system_shared)
+  set(BOOST_FILESYSTEM_LIBRARY boost_filesystem_shared)
 else()
-  set(BOOST_SHARED_SYSTEM_LIBRARY ${Boost_SYSTEM_LIBRARY_RELEASE})
-  set(BOOST_SHARED_FILESYSTEM_LIBRARY ${Boost_FILESYSTEM_LIBRARY_RELEASE})
+  # Find static boost headers and libs
+  # TODO Differentiate here between release and debug builds
+  set(Boost_USE_STATIC_LIBS ON)
+  find_package(Boost COMPONENTS system filesystem REQUIRED)
+  if ("${CMAKE_BUILD_TYPE}" STREQUAL "DEBUG")
+    set(BOOST_STATIC_SYSTEM_LIBRARY ${Boost_SYSTEM_LIBRARY_DEBUG})
+    set(BOOST_STATIC_FILESYSTEM_LIBRARY ${Boost_FILESYSTEM_LIBRARY_DEBUG})
+  else()
+    set(BOOST_STATIC_SYSTEM_LIBRARY ${Boost_SYSTEM_LIBRARY_RELEASE})
+    set(BOOST_STATIC_FILESYSTEM_LIBRARY ${Boost_FILESYSTEM_LIBRARY_RELEASE})
+  endif()
+  set(BOOST_SYSTEM_LIBRARY boost_system_static)
+  set(BOOST_FILESYSTEM_LIBRARY boost_filesystem_static)
 endif()
 
 message(STATUS "Boost include dir: " ${Boost_INCLUDE_DIRS})

http://git-wip-us.apache.org/repos/asf/arrow/blob/019f90d7/cpp/src/arrow/io/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/cpp/src/arrow/io/CMakeLists.txt b/cpp/src/arrow/io/CMakeLists.txt
index 69621d3..af3acbf 100644
--- a/cpp/src/arrow/io/CMakeLists.txt
+++ b/cpp/src/arrow/io/CMakeLists.txt
@@ -56,19 +56,13 @@ else()
   )
 endif()
 
-if (ARROW_BOOST_USE_SHARED)
-  set(ARROW_IO_SHARED_PRIVATE_LINK_LIBS
-    boost_system_shared
-    boost_filesystem_shared)
-else()
-  set(ARROW_IO_SHARED_PRIVATE_LINK_LIBS
-    boost_system_static
-    boost_filesystem_static)
-endif()
+set(ARROW_IO_SHARED_PRIVATE_LINK_LIBS
+  ${BOOST_SYSTEM_LIBRARY}
+  ${BOOST_FILESYSTEM_LIBRARY})
 
 set(ARROW_IO_STATIC_PRIVATE_LINK_LIBS
-  boost_system_static
-  boost_filesystem_static)
+  ${BOOST_SYSTEM_LIBRARY}
+  ${BOOST_FILESYSTEM_LIBRARY})
 
 set(ARROW_IO_TEST_LINK_LIBS
   arrow_io_static)

http://git-wip-us.apache.org/repos/asf/arrow/blob/019f90d7/cpp/src/arrow/ipc/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/cpp/src/arrow/ipc/CMakeLists.txt b/cpp/src/arrow/ipc/CMakeLists.txt
index 4a5e319..c73af63 100644
--- a/cpp/src/arrow/ipc/CMakeLists.txt
+++ b/cpp/src/arrow/ipc/CMakeLists.txt
@@ -90,8 +90,8 @@ if (ARROW_BUILD_TESTS)
       arrow_static
       gflags
       gtest
-      boost_filesystem_static
-      boost_system_static
+      ${BOOST_FILESYSTEM_LIBRARY}
+      ${BOOST_SYSTEM_LIBRARY}
       dl)
     set_target_properties(json-integration-test
       PROPERTIES LINK_FLAGS "-undefined dynamic_lookup")
@@ -103,8 +103,8 @@ if (ARROW_BUILD_TESTS)
       gflags
       gtest
       pthread
-      boost_filesystem_static
-      boost_system_static
+      ${BOOST_FILESYSTEM_LIBRARY}
+      ${BOOST_SYSTEM_LIBRARY}
       dl)
   endif()
 endif()
@@ -170,17 +170,10 @@ set(UTIL_LINK_LIBS
   arrow_ipc_static
   arrow_io_static
   arrow_static
-  boost_filesystem_static
-  boost_system_static
+  ${BOOST_FILESYSTEM_LIBRARY}
+  ${BOOST_SYSTEM_LIBRARY}
   dl)
 
-if (NOT APPLE)
-  set(UTIL_LINK_LIBS
-    ${UTIL_LINK_LIBS}
-    boost_filesystem_static
-    boost_system_static)
-endif()
-
 if (ARROW_BUILD_UTILITIES)
   add_executable(file-to-stream file-to-stream.cc)
   target_link_libraries(file-to-stream ${UTIL_LINK_LIBS})


Mime
View raw message