From d096c648e7ad6ad80c82c329722660a8a87469b1 Mon Sep 17 00:00:00 2001 From: Kalon Mills Date: Fri, 8 Jan 2016 13:22:15 -0700 Subject: [PATCH] Update build instructions. Also update travis ci to follow the same pattern as in the build instructions. --- .travis.yml | 15 +++++++-------- README.md | 53 +++++++++++++++++++++++++++++++++-------------------- 2 files changed, 40 insertions(+), 28 deletions(-) diff --git a/.travis.yml b/.travis.yml index 28caf607..4ca229fd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,7 +30,8 @@ addons: - pkg-config #needed for thrift cpp compilation before_install: - - pushd thirdparty + - mkdir $HOME/build_dir + - cd $HOME/build_dir - > if [ $TRAVIS_OS_NAME == osx ]; then brew update && @@ -38,17 +39,15 @@ before_install: fi - > if [ $TRAVIS_OS_NAME == linux ]; then - ./download_thirdparty.sh && - ./build_thirdparty.sh && - export THRIFT_HOME=$TRAVIS_BUILD_DIR/thirdparty/installed SNAPPY_HOME=$TRAVIS_BUILD_DIR/thirdparty/installed LZ4_HOME=$TRAVIS_BUILD_DIR/thirdparty/installed; + cp -r $TRAVIS_BUILD_DIR/thirdparty . && + ./thirdparty/download_thirdparty.sh && + ./thirdparty/build_thirdparty.sh && + export THRIFT_HOME=$HOME/build_dir/thirdparty/installed SNAPPY_HOME=$HOME/build_dir/thirdparty/installed LZ4_HOME=$HOME/build_dir/thirdparty/installed; fi - - popd before_script: - export CC="gcc-4.9" - export CXX="g++-4.9" - - mkdir build - - cd build - - cmake .. + - cmake $TRAVIS_BUILD_DIR script: make diff --git a/README.md b/README.md index 86b66ac3..a4830485 100644 --- a/README.md +++ b/README.md @@ -2,30 +2,43 @@ Parquet-cpp [![Build Status](https://travis-ci.org/apache/parquet-cpp.svg)](http =========== A C++ library to read parquet files. -To build you will need all the dependencies for thrift. - -Then run: -
- -./thirdparty/download_thirdparty.sh - -
- -./thirdparty/build_thirdparty.sh - -
- -THRIFT_HOME=$PWD/thirdparty/installed/ cmake -D CMAKE_PREFIX_PATH=$PWD/thirdparty/installed/ . - -
- -make - +## Third Party Dependencies +- snappy +- lz4 +- thrift 0.7+ [install instructions](https://thrift.apache.org/docs/install/) + +Many package managers support some or all of these dependencies. E.g.: +```shell +ubuntu$ sudo apt-get install libboost-dev libsnappy-dev liblz4-dev +``` +```shell +mac$ brew install boost snappy lz4 thrift +``` + +The thirdparty directory contains helper scripts to manually install third-party dependencies on Linux. You can use them like so. +- `mkdir ` +- `cd ` +- `cp -r /thirdparty .` +- `./thirdparty/download_thirdparty.sh` +- `./thirdparty/build_thirdparty.sh` +- Use the thirdparty/installed directory when configuring HOME dirs for dependencies. +Ex., `THRIFT_HOME=$PWD/thirdparty/installed SNAPPY_HOME=$PWD/thirdparty/installed LZ4_HOME=$PWD/thirdparty/installed cmake ` + +You can also take a look at our [.travis.yml](.travis.yml) to see how that build env is set up. + + +## Build +- `cmake .` + - You can customize dependent library locations through various environment variables: + - THRIFT_HOME customizes the thrift installed location. + - SNAPPY_HOME customizes the snappy installed location. + - LZ4_HOME customizes the lz4 installed location. +- `make` The binaries will be built to ./debug which contains the libraries to link against as well as a few example executables. -Incremental builds can be done afterwords with just make . +Incremental builds can be done afterwords with just `make`. Design ========