arrow-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From u..@apache.org
Subject arrow git commit: ARROW-954: Flag for compiling Arrow with header-only boost
Date Tue, 09 May 2017 14:01:22 GMT
Repository: arrow
Updated Branches:
  refs/heads/master ccf83f485 -> 670612e6f


ARROW-954: Flag for compiling Arrow with header-only boost

Author: Philipp Moritz <pcmoritz@gmail.com>

Closes #647 from pcmoritz/boost-header-only and squashes the following commits:

3605341 [Philipp Moritz] run find_package(Boost) in header-only mode
445de50 [Philipp Moritz] bring back tests
3f1ef1f [Philipp Moritz] reintroduce ARROW_HDFS
a047ad4 [Philipp Moritz] deactivate json-integration-test for header-only boost
b2b2015 [Philipp Moritz] make it possible to compile arrow with header-only boost


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

Branch: refs/heads/master
Commit: 670612e6fdf699486641ed0d39d22257eb8acdb2
Parents: ccf83f4
Author: Philipp Moritz <pcmoritz@gmail.com>
Authored: Tue May 9 16:01:05 2017 +0200
Committer: Uwe L. Korn <uwelk@xhochy.com>
Committed: Tue May 9 16:01:05 2017 +0200

----------------------------------------------------------------------
 cpp/CMakeLists.txt               | 75 +++++++++++++++++++++++------------
 cpp/src/arrow/io/CMakeLists.txt  |  4 +-
 cpp/src/arrow/ipc/CMakeLists.txt | 29 ++++++++------
 3 files changed, 69 insertions(+), 39 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/arrow/blob/670612e6/cpp/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt
index 72e5ea9..2146379 100644
--- a/cpp/CMakeLists.txt
+++ b/cpp/CMakeLists.txt
@@ -101,6 +101,10 @@ if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}")
     "Rely on jemalloc shared libraries where relevant"
     ON)
 
+  option(ARROW_HDFS
+    "Build the Arrow HDFS bridge"
+    ON)
+
   option(ARROW_BOOST_USE_SHARED
     "Rely on boost shared libraries where relevant"
     ON)
@@ -136,6 +140,12 @@ if(NOT ARROW_BUILD_BENCHMARKS)
   set(NO_BENCHMARKS 1)
 endif()
 
+if(ARROW_HDFS)
+  set(ARROW_BOOST_HEADER_ONLY 0)
+else()
+  set(ARROW_BOOST_HEADER_ONLY 1)
+endif()
+
 include(BuildUtils)
 
 ############################################################
@@ -437,44 +447,54 @@ if (ARROW_BOOST_USE_SHARED)
     add_definitions(-DBOOST_ALL_DYN_LINK)
   endif()
 
-  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_HEADER_ONLY)
+    find_package(Boost)
   else()
-    set(BOOST_SHARED_SYSTEM_LIBRARY ${Boost_SYSTEM_LIBRARY_RELEASE})
-    set(BOOST_SHARED_FILESYSTEM_LIBRARY ${Boost_FILESYSTEM_LIBRARY_RELEASE})
+    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)
   endif()
-  set(BOOST_SYSTEM_LIBRARY boost_system_shared)
-  set(BOOST_FILESYSTEM_LIBRARY boost_filesystem_shared)
 else()
   # 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 regex 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})
+  if (ARROW_BOOST_HEADER_ONLY)
+    find_package(Boost)
   else()
-    set(BOOST_STATIC_SYSTEM_LIBRARY ${Boost_SYSTEM_LIBRARY_RELEASE})
-    set(BOOST_STATIC_FILESYSTEM_LIBRARY ${Boost_FILESYSTEM_LIBRARY_RELEASE})
+    find_package(Boost COMPONENTS system filesystem regex 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()
-  set(BOOST_SYSTEM_LIBRARY boost_system_static)
-  set(BOOST_FILESYSTEM_LIBRARY boost_filesystem_static)
 endif()
 
 message(STATUS "Boost include dir: " ${Boost_INCLUDE_DIRS})
 message(STATUS "Boost libraries: " ${Boost_LIBRARIES})
 
-ADD_THIRDPARTY_LIB(boost_system
-    STATIC_LIB "${BOOST_STATIC_SYSTEM_LIBRARY}"
-    SHARED_LIB "${BOOST_SHARED_SYSTEM_LIBRARY}")
+if (NOT ARROW_BOOST_HEADER_ONLY)
+  ADD_THIRDPARTY_LIB(boost_system
+      STATIC_LIB "${BOOST_STATIC_SYSTEM_LIBRARY}"
+      SHARED_LIB "${BOOST_SHARED_SYSTEM_LIBRARY}")
 
-ADD_THIRDPARTY_LIB(boost_filesystem
-    STATIC_LIB "${BOOST_STATIC_FILESYSTEM_LIBRARY}"
-    SHARED_LIB "${BOOST_SHARED_FILESYSTEM_LIBRARY}")
+  ADD_THIRDPARTY_LIB(boost_filesystem
+      STATIC_LIB "${BOOST_STATIC_FILESYSTEM_LIBRARY}"
+      SHARED_LIB "${BOOST_SHARED_FILESYSTEM_LIBRARY}")
 
-SET(ARROW_BOOST_LIBS boost_system boost_filesystem)
+  SET(ARROW_BOOST_LIBS boost_system boost_filesystem)
+endif()
 
 include_directories(SYSTEM ${Boost_INCLUDE_DIR})
 
@@ -938,8 +958,6 @@ set(ARROW_SRCS
   src/arrow/visitor.cc
 
   src/arrow/io/file.cc
-  src/arrow/io/hdfs.cc
-  src/arrow/io/hdfs-internal.cc
   src/arrow/io/interfaces.cc
   src/arrow/io/memory.cc
 
@@ -948,6 +966,13 @@ set(ARROW_SRCS
   src/arrow/util/key_value_metadata.cc
 )
 
+if (NOT ARROW_BOOST_HEADER_ONLY)
+  set(ARROW_SRCS ${ARROW_SRCS}
+    src/arrow/io/hdfs.cc
+    src/arrow/io/hdfs-internal.cc
+  )
+endif()
+
 if (ARROW_IPC)
   set(ARROW_SRCS ${ARROW_SRCS}
     src/arrow/ipc/feather.cc

http://git-wip-us.apache.org/repos/asf/arrow/blob/670612e6/cpp/src/arrow/io/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/cpp/src/arrow/io/CMakeLists.txt b/cpp/src/arrow/io/CMakeLists.txt
index cd48974..544b4b7 100644
--- a/cpp/src/arrow/io/CMakeLists.txt
+++ b/cpp/src/arrow/io/CMakeLists.txt
@@ -19,7 +19,9 @@
 # arrow_io : Arrow IO interfaces
 
 ADD_ARROW_TEST(io-file-test)
-ADD_ARROW_TEST(io-hdfs-test)
+if (NOT ARROW_BOOST_HEADER_ONLY)
+  ADD_ARROW_TEST(io-hdfs-test)
+endif()
 ADD_ARROW_TEST(io-memory-test)
 
 ADD_ARROW_BENCHMARK(io-memory-benchmark)

http://git-wip-us.apache.org/repos/asf/arrow/blob/670612e6/cpp/src/arrow/ipc/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/cpp/src/arrow/ipc/CMakeLists.txt b/cpp/src/arrow/ipc/CMakeLists.txt
index 41ab5d7..9cc61bc 100644
--- a/cpp/src/arrow/ipc/CMakeLists.txt
+++ b/cpp/src/arrow/ipc/CMakeLists.txt
@@ -21,19 +21,22 @@
 ADD_ARROW_TEST(feather-test)
 ADD_ARROW_TEST(ipc-read-write-test)
 ADD_ARROW_TEST(ipc-json-test)
-ADD_ARROW_TEST(json-integration-test)
-
-if (ARROW_BUILD_TESTS)
-  target_link_libraries(json-integration-test
-    gflags)
-
-  if (UNIX)
-    if (APPLE)
-      set_target_properties(json-integration-test
-        PROPERTIES LINK_FLAGS "-undefined dynamic_lookup")
-    else()
-      target_link_libraries(json-integration-test
-        pthread)
+
+if (NOT ARROW_BOOST_HEADER_ONLY)
+  ADD_ARROW_TEST(json-integration-test)
+
+  if (ARROW_BUILD_TESTS)
+    target_link_libraries(json-integration-test
+      gflags)
+
+    if (UNIX)
+      if (APPLE)
+        set_target_properties(json-integration-test
+          PROPERTIES LINK_FLAGS "-undefined dynamic_lookup")
+      else()
+        target_link_libraries(json-integration-test
+          pthread)
+      endif()
     endif()
   endif()
 endif()


Mime
View raw message