diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..58b7641f --- /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 diff --git a/CMakeLists.txt b/CMakeLists.txt index bd742ba3..ad0ed5f8 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}) diff --git a/README.md b/README.md index aee1e4ec..3af78d62 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. diff --git a/example/CMakeLists.txt b/example/CMakeLists.txt index 1f598560..8844cdd3 100644 --- a/example/CMakeLists.txt +++ b/example/CMakeLists.txt @@ -21,7 +21,6 @@ SET(LINK_LIBS Parquet ParquetCompression Example - rt ThriftParquet thriftstatic lz4static diff --git a/src/impala/bit-util.h b/src/impala/bit-util.h index 0c9c32d5..c2b6055a 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 +#if defined(__APPLE__) + #include +#else + #include +#endif #include "impala/compiler-util.h" #include "impala/logging.h" diff --git a/src/util/stopwatch.h b/src/util/stopwatch.h index bfdb4e97..145f1301 100644 --- a/src/util/stopwatch.h +++ b/src/util/stopwatch.h @@ -17,6 +17,8 @@ #include #include +#include +#include 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 -