parquet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n...@apache.org
Subject parquet-cpp git commit: PARQUET-259: Support Travis CI in parquet-cpp
Date Thu, 07 May 2015 11:49:14 GMT
Repository: parquet-cpp
Updated Branches:
  refs/heads/master 592cf7131 -> ea30decd9


PARQUET-259: Support Travis CI in parquet-cpp

It doesn't appear like there are any tests to run yet, so the build just ensures that compilation
succeeds.

Author: Kalon Mills <kmills@adobe.com>
Author: Kashif Rasul <kashif.rasul@gmail.com>

Closes #9 from kalaxy/travis_ci_support and squashes the following commits:

71be03b [Kalon Mills] Add build status image to README.md.
1c4f376 [Kalon Mills] Support osx build in Travis CI.
bffeae9 [Kalon Mills] Fix osx include and remove superfluous library link.
b20cb84 [Kashif Rasul] fix stopwatch for os x and linux
64675de [Kalon Mills] Initial Travis CI support.
6659e3d [Kalon Mills] Remove superfluous dependencies.


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

Branch: refs/heads/master
Commit: ea30decd9f25ced017163de4a6dc79b8e60ef594
Parents: 592cf71
Author: Kalon Mills <kmills@adobe.com>
Authored: Thu May 7 04:48:28 2015 -0700
Committer: Nong Li <nong@apache.org>
Committed: Thu May 7 04:48:28 2015 -0700

----------------------------------------------------------------------
 .travis.yml            | 48 +++++++++++++++++++++++++++++++++++++++++++++
 CMakeLists.txt         |  2 +-
 README.md              |  2 +-
 example/CMakeLists.txt |  1 -
 src/impala/bit-util.h  |  6 +++++-
 src/util/stopwatch.h   | 16 ++++++++-------
 6 files changed, 64 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/parquet-cpp/blob/ea30decd/.travis.yml
----------------------------------------------------------------------
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..58b7641
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,48 @@
+language: cpp
+
+compiler:
+    - gcc
+    - clang
+
+os:
+    - linux
+    - osx
+
+addons:
+    apt:
+        packages:
+            - libboost-dev
+              #- libsnappy-dev currently handled by thirdparty scipts.
+            - libboost-program-options-dev #needed for thrift cpp compilation
+            - libboost-test-dev            #needed for thrift cpp compilation
+            - libssl-dev                   #needed for thrift cpp compilation
+            - libtool                      #needed for thrift cpp compilation
+            - bison                        #needed for thrift cpp compilation
+            - flex                         #needed for thrift cpp compilation
+            - pkg-config                   #needed for thrift cpp compilation
+
+before_install:
+    - pushd thirdparty
+    # thrift cpp
+    - >
+      if [ $TRAVIS_OS_NAME == linux ]; then
+        wget http://www.us.apache.org/dist/thrift/0.9.1/thrift-0.9.1.tar.gz &&
+        tar xfz thrift-0.9.1.tar.gz &&
+        pushd thrift-0.9.1 &&
+        ./configure --without-qt4 --without-c_glib --without-csharp --without-java --without-erlang
--without-nodejs --without-lua --without-python --without-perl --without-php --without-php_extension
--without-ruby --without-haskell --without-go --without-d --with-cpp --prefix=$HOME/local
&&
+        make clean &&
+        make install &&
+        popd;
+      fi
+    - if [ $TRAVIS_OS_NAME == osx ]; then brew install thrift; fi
+    # snappy and lz4
+    - ./download_thirdparty.sh
+    - ./build_thirdparty.sh
+    - popd
+
+before_script:
+    - mkdir build
+    - cd build
+    - THRIFT_HOME=$HOME/local cmake ..
+
+script: make

http://git-wip-us.apache.org/repos/asf/parquet-cpp/blob/ea30decd/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/CMakeLists.txt b/CMakeLists.txt
index bd742ba..ad0ed5f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -27,7 +27,7 @@ set(CMAKE_PREFIX_PATH ${THIRDPARTY_PREFIX})
 # find boost headers and libs
 set(Boost_DEBUG TRUE)
 set(Boost_USE_MULTITHREADED ON)
-find_package(Boost REQUIRED COMPONENTS thread regex-mt system-mt filesystem-mt)
+find_package(Boost REQUIRED)
 include_directories(SYSTEM ${Boost_INCLUDE_DIRS})
 set(LIBS ${LIBS} ${Boost_LIBRARIES})
 message(STATUS "Boost include dir: " ${Boost_INCLUDE_DIRS})

http://git-wip-us.apache.org/repos/asf/parquet-cpp/blob/ea30decd/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index aee1e4e..3af78d6 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-Parquet-cpp
+Parquet-cpp [![Build Status](https://travis-ci.org/apache/parquet-cpp.svg)](https://travis-ci.org/apache/parquet-cpp)
 ===========
 A C++ library to read parquet files.
 

http://git-wip-us.apache.org/repos/asf/parquet-cpp/blob/ea30decd/example/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/example/CMakeLists.txt b/example/CMakeLists.txt
index 1f59856..8844cdd 100644
--- a/example/CMakeLists.txt
+++ b/example/CMakeLists.txt
@@ -21,7 +21,6 @@ SET(LINK_LIBS
   Parquet
   ParquetCompression
   Example
-  rt
   ThriftParquet
   thriftstatic
   lz4static

http://git-wip-us.apache.org/repos/asf/parquet-cpp/blob/ea30decd/src/impala/bit-util.h
----------------------------------------------------------------------
diff --git a/src/impala/bit-util.h b/src/impala/bit-util.h
index 0c9c32d..c2b6055 100644
--- a/src/impala/bit-util.h
+++ b/src/impala/bit-util.h
@@ -16,7 +16,11 @@
 #ifndef IMPALA_BIT_UTIL_H
 #define IMPALA_BIT_UTIL_H
 
-#include <endian.h>
+#if defined(__APPLE__)
+  #include <machine/endian.h>
+#else
+  #include <endian.h>
+#endif
 
 #include "impala/compiler-util.h"
 #include "impala/logging.h"

http://git-wip-us.apache.org/repos/asf/parquet-cpp/blob/ea30decd/src/util/stopwatch.h
----------------------------------------------------------------------
diff --git a/src/util/stopwatch.h b/src/util/stopwatch.h
index bfdb4e9..145f130 100644
--- a/src/util/stopwatch.h
+++ b/src/util/stopwatch.h
@@ -17,6 +17,8 @@
 
 #include <iostream>
 #include <stdio.h>
+#include <ctime>
+#include <sys/time.h>
 
 namespace parquet_cpp {
 
@@ -26,22 +28,22 @@ class StopWatch {
   }
 
   void Start() {
-    clock_gettime(CLOCK_MONOTONIC, &start_);
+    gettimeofday(&start_time, 0);
   }
 
   // Returns time in nanoseconds.
   uint64_t Stop() {
-    timespec end;
-    clock_gettime(CLOCK_MONOTONIC, &end);
-    return (end.tv_sec - start_.tv_sec) * 1000L * 1000L * 1000L +
-           (end.tv_nsec - start_.tv_nsec);
+    struct timeval t_time;
+    gettimeofday(&t_time, 0);
+
+    return (1000L * 1000L * 1000L * (t_time.tv_sec - start_time.tv_sec)
+                   + (t_time.tv_usec - start_time.tv_usec));
   }
 
  private:
-  timespec start_;
+  struct timeval  start_time;
 };
 
 }
 
 #endif
-


Mime
View raw message