You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@parquet.apache.org by we...@apache.org on 2017/05/31 21:24:21 UTC

parquet-cpp git commit: PARQUET-999: Improve MSVC build - Enable PARQUET_BUILD_BENCHMARKS

Repository: parquet-cpp
Updated Branches:
  refs/heads/master 48ded9c02 -> fb787dda4


PARQUET-999: Improve MSVC build - Enable PARQUET_BUILD_BENCHMARKS

Author: rip.nsk <ri...@gmail.com>

Closes #346 from rip-nsk/PARQUET-999 and squashes the following commits:

c30d90b [rip.nsk] Use CMAKE_BUILD_TYPE for GBENCHMARK if MSVC
ba0bdac [rip.nsk] workaround inaccuracy in benchmark_api.h: use BENCHMARK_TEMPLATE2 instead of "VA_ARGS" BENCHMARK_TEMPLATE
c17ce8d [rip.nsk] Enable PARQUET_BUILD_BENCHMARKS for windows


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

Branch: refs/heads/master
Commit: fb787dda4decf2455e0a978e44127b9b9ecdc76e
Parents: 48ded9c
Author: rip.nsk <ri...@gmail.com>
Authored: Wed May 31 17:24:14 2017 -0400
Committer: Wes McKinney <we...@twosigma.com>
Committed: Wed May 31 17:24:14 2017 -0400

----------------------------------------------------------------------
 CMakeLists.txt                                  |  8 +++++--
 cmake_modules/ThirdpartyToolchain.cmake         |  6 ++++-
 .../arrow/arrow-reader-writer-benchmark.cc      | 24 ++++++++++----------
 src/parquet/util/CMakeLists.txt                 |  5 ++++
 4 files changed, 28 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/parquet-cpp/blob/fb787dda/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b329ace..80c5e0d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -226,8 +226,12 @@ function(ADD_PARQUET_BENCHMARK REL_BENCHMARK_NAME)
     set(NO_COLOR "")
   endif()
 
-  add_test(${BENCHMARK_NAME}
-    ${BUILD_SUPPORT_DIR}/run-test.sh ${CMAKE_BINARY_DIR} benchmark ${BENCHMARK_PATH} ${NO_COLOR})
+  if(WIN32)
+    add_test(${BENCHMARK_NAME} ${BENCHMARK_PATH} ${NO_COLOR})
+  else()
+    add_test(${BENCHMARK_NAME}
+      ${BUILD_SUPPORT_DIR}/run-test.sh ${CMAKE_BINARY_DIR} benchmark ${BENCHMARK_PATH} ${NO_COLOR})
+  endif()
   set_tests_properties(${BENCHMARK_NAME} PROPERTIES LABELS "benchmark")
   if(ARGN)
     set_tests_properties(${BENCHMARK_NAME} PROPERTIES ${ARGN})

http://git-wip-us.apache.org/repos/asf/parquet-cpp/blob/fb787dda/cmake_modules/ThirdpartyToolchain.cmake
----------------------------------------------------------------------
diff --git a/cmake_modules/ThirdpartyToolchain.cmake b/cmake_modules/ThirdpartyToolchain.cmake
index b324ffb..85922a7 100644
--- a/cmake_modules/ThirdpartyToolchain.cmake
+++ b/cmake_modules/ThirdpartyToolchain.cmake
@@ -448,10 +448,14 @@ if(PARQUET_BUILD_BENCHMARKS AND NOT IGNORE_OPTIONAL_PACKAGES)
     set(GBENCHMARK_INCLUDE_DIR "${GBENCHMARK_PREFIX}/include")
     set(GBENCHMARK_STATIC_LIB "${GBENCHMARK_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}benchmark${CMAKE_STATIC_LIBRARY_SUFFIX}")
     set(GBENCHMARK_CMAKE_ARGS
-          "-DCMAKE_BUILD_TYPE=Release"
           "-DCMAKE_INSTALL_PREFIX:PATH=${GBENCHMARK_PREFIX}"
           "-DBENCHMARK_ENABLE_TESTING=OFF"
           "-DCMAKE_CXX_FLAGS=${EP_CXX_FLAGS}")
+    if (MSVC)
+      set(GBENCHMARK_CMAKE_ARGS ${GBENCHMARK_CMAKE_ARGS} "-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}")
+    else()
+      set(GBENCHMARK_CMAKE_ARGS ${GBENCHMARK_CMAKE_ARGS} "-DCMAKE_BUILD_TYPE=Release")
+    endif()
     if (APPLE)
       set(GBENCHMARK_CMAKE_ARGS ${GBENCHMARK_CMAKE_ARGS} "-DBENCHMARK_USE_LIBCXX=ON")
     endif()

http://git-wip-us.apache.org/repos/asf/parquet-cpp/blob/fb787dda/src/parquet/arrow/arrow-reader-writer-benchmark.cc
----------------------------------------------------------------------
diff --git a/src/parquet/arrow/arrow-reader-writer-benchmark.cc b/src/parquet/arrow/arrow-reader-writer-benchmark.cc
index 7d8c107..b9aa4a2 100644
--- a/src/parquet/arrow/arrow-reader-writer-benchmark.cc
+++ b/src/parquet/arrow/arrow-reader-writer-benchmark.cc
@@ -114,14 +114,14 @@ static void BM_WriteColumn(::benchmark::State& state) {
   SetBytesProcessed<nullable, ParquetType>(state);
 }
 
-BENCHMARK_TEMPLATE(BM_WriteColumn, false, Int32Type);
-BENCHMARK_TEMPLATE(BM_WriteColumn, true, Int32Type);
+BENCHMARK_TEMPLATE2(BM_WriteColumn, false, Int32Type);
+BENCHMARK_TEMPLATE2(BM_WriteColumn, true, Int32Type);
 
-BENCHMARK_TEMPLATE(BM_WriteColumn, false, Int64Type);
-BENCHMARK_TEMPLATE(BM_WriteColumn, true, Int64Type);
+BENCHMARK_TEMPLATE2(BM_WriteColumn, false, Int64Type);
+BENCHMARK_TEMPLATE2(BM_WriteColumn, true, Int64Type);
 
-BENCHMARK_TEMPLATE(BM_WriteColumn, false, DoubleType);
-BENCHMARK_TEMPLATE(BM_WriteColumn, true, DoubleType);
+BENCHMARK_TEMPLATE2(BM_WriteColumn, false, DoubleType);
+BENCHMARK_TEMPLATE2(BM_WriteColumn, true, DoubleType);
 
 template <bool nullable, typename ParquetType>
 static void BM_ReadColumn(::benchmark::State& state) {
@@ -141,14 +141,14 @@ static void BM_ReadColumn(::benchmark::State& state) {
   SetBytesProcessed<nullable, ParquetType>(state);
 }
 
-BENCHMARK_TEMPLATE(BM_ReadColumn, false, Int32Type);
-BENCHMARK_TEMPLATE(BM_ReadColumn, true, Int32Type);
+BENCHMARK_TEMPLATE2(BM_ReadColumn, false, Int32Type);
+BENCHMARK_TEMPLATE2(BM_ReadColumn, true, Int32Type);
 
-BENCHMARK_TEMPLATE(BM_ReadColumn, false, Int64Type);
-BENCHMARK_TEMPLATE(BM_ReadColumn, true, Int64Type);
+BENCHMARK_TEMPLATE2(BM_ReadColumn, false, Int64Type);
+BENCHMARK_TEMPLATE2(BM_ReadColumn, true, Int64Type);
 
-BENCHMARK_TEMPLATE(BM_ReadColumn, false, DoubleType);
-BENCHMARK_TEMPLATE(BM_ReadColumn, true, DoubleType);
+BENCHMARK_TEMPLATE2(BM_ReadColumn, false, DoubleType);
+BENCHMARK_TEMPLATE2(BM_ReadColumn, true, DoubleType);
 
 }  // namespace benchmark
 

http://git-wip-us.apache.org/repos/asf/parquet-cpp/blob/fb787dda/src/parquet/util/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/src/parquet/util/CMakeLists.txt b/src/parquet/util/CMakeLists.txt
index 1778696..e8fbdc7 100644
--- a/src/parquet/util/CMakeLists.txt
+++ b/src/parquet/util/CMakeLists.txt
@@ -39,6 +39,11 @@ if (PARQUET_BUILD_BENCHMARKS)
     target_link_libraries(parquet_benchmark_main
       gbenchmark
     )
+  elseif(WIN32)
+    target_link_libraries(parquet_benchmark_main
+      gbenchmark
+      shlwapi.lib # workaround for bug(?) in gbenchmark: unresolved external symbol __imp_SHGetValueA
+    )
   else()
     target_link_libraries(parquet_benchmark_main
       gbenchmark