From c2d36840343feb7975e182d51222cf652264990f Mon Sep 17 00:00:00 2001 From: Wes McKinney Date: Fri, 13 May 2016 14:50:30 -0700 Subject: [PATCH 1/2] Add conda recipe and ensure that libarrow_parquet is installed as well --- cpp/conda.recipe/build.sh | 37 ++++++++++++++++++++++++++++ cpp/conda.recipe/meta.yaml | 25 +++++++++++++++++++ cpp/src/arrow/parquet/CMakeLists.txt | 7 ++++++ 3 files changed, 69 insertions(+) create mode 100644 cpp/conda.recipe/build.sh create mode 100644 cpp/conda.recipe/meta.yaml diff --git a/cpp/conda.recipe/build.sh b/cpp/conda.recipe/build.sh new file mode 100644 index 00000000000..d11f3a3df96 --- /dev/null +++ b/cpp/conda.recipe/build.sh @@ -0,0 +1,37 @@ +#!/bin/bash + +set -e +set -x + +cd $RECIPE_DIR + +# Build dependencies +export FLATBUFFERS_HOME=$PREFIX +export PARQUET_HOME=$PREFIX + +cd .. + +mkdir conda-build + +cp -r thirdparty conda-build/ + +cd conda-build +pwd + +# Build googletest for running unit tests +./thirdparty/download_thirdparty.sh +./thirdparty/build_thirdparty.sh gtest + +source thirdparty/versions.sh +export GTEST_HOME=`pwd`/thirdparty/$GTEST_BASEDIR + +cmake \ + -DCMAKE_BUILD_TYPE=release \ + -DCMAKE_INSTALL_PREFIX=$PREFIX \ + -DARROW_IPC=on \ + -DARROW_PARQUET=on \ + .. + +make +ctest -L unittest +make install diff --git a/cpp/conda.recipe/meta.yaml b/cpp/conda.recipe/meta.yaml new file mode 100644 index 00000000000..9d76c6b7931 --- /dev/null +++ b/cpp/conda.recipe/meta.yaml @@ -0,0 +1,25 @@ +package: + name: arrow-cpp + version: "0.1" + +build: + number: {{environ.get('TRAVIS_BUILD_NUMBER', 0)}} # [unix] + skip: true # [win] + +requirements: + build: + - cmake + - flatbuffers + - parquet-cpp + - thrift-cpp + +test: + commands: + - test -f $PREFIX/lib/libarrow.so + - test -f $PREFIX/lib/libarrow_parquet.so + - test -f $PREFIX/include/arrow/api.h + +about: + home: http://github.com/apache/arrow + license: Apache 2.0 + summary: 'C++ libraries for the reference Apache Arrow implementation' diff --git a/cpp/src/arrow/parquet/CMakeLists.txt b/cpp/src/arrow/parquet/CMakeLists.txt index 1ae6709652e..cd6f05d6b5f 100644 --- a/cpp/src/arrow/parquet/CMakeLists.txt +++ b/cpp/src/arrow/parquet/CMakeLists.txt @@ -42,4 +42,11 @@ ARROW_TEST_LINK_LIBRARIES(parquet-reader-test arrow_parquet) # Headers: top level install(FILES + reader.h + schema.h + utils.h DESTINATION include/arrow/parquet) + +install(TARGETS arrow_parquet + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib) From 4bf3d2c4c004b84e5f5036fbd03a0c966b2132df Mon Sep 17 00:00:00 2001 From: Wes McKinney Date: Sat, 14 May 2016 12:55:19 -0700 Subject: [PATCH 2/2] Finagle toolchain environment variables to get pyarrow conda package working --- cpp/conda.recipe/build.sh | 10 +++++++- cpp/conda.recipe/meta.yaml | 7 ++++++ cpp/src/arrow/types/primitive.h | 1 + python/conda.recipe/build.sh | 18 +++++++++++++++ python/conda.recipe/meta.yaml | 41 +++++++++++++++++++++++++++++++++ 5 files changed, 76 insertions(+), 1 deletion(-) create mode 100644 python/conda.recipe/build.sh create mode 100644 python/conda.recipe/meta.yaml diff --git a/cpp/conda.recipe/build.sh b/cpp/conda.recipe/build.sh index d11f3a3df96..ac1f9c89cc9 100644 --- a/cpp/conda.recipe/build.sh +++ b/cpp/conda.recipe/build.sh @@ -11,6 +11,7 @@ export PARQUET_HOME=$PREFIX cd .. +rm -rf conda-build mkdir conda-build cp -r thirdparty conda-build/ @@ -25,9 +26,16 @@ pwd source thirdparty/versions.sh export GTEST_HOME=`pwd`/thirdparty/$GTEST_BASEDIR +if [ `uname` == Linux ]; then + SHARED_LINKER_FLAGS='-static-libstdc++' +elif [ `uname` == Darwin ]; then + SHARED_LINKER_FLAGS='' +fi + cmake \ - -DCMAKE_BUILD_TYPE=release \ + -DCMAKE_BUILD_TYPE=debug \ -DCMAKE_INSTALL_PREFIX=$PREFIX \ + -DCMAKE_SHARED_LINKER_FLAGS=$SHARED_LINKER_FLAGS \ -DARROW_IPC=on \ -DARROW_PARQUET=on \ .. diff --git a/cpp/conda.recipe/meta.yaml b/cpp/conda.recipe/meta.yaml index 9d76c6b7931..2e834d5cbf8 100644 --- a/cpp/conda.recipe/meta.yaml +++ b/cpp/conda.recipe/meta.yaml @@ -5,6 +5,10 @@ package: build: number: {{environ.get('TRAVIS_BUILD_NUMBER', 0)}} # [unix] skip: true # [win] + script_env: + - CC [linux] + - CXX [linux] + - LD_LIBRARY_PATH [linux] requirements: build: @@ -13,6 +17,9 @@ requirements: - parquet-cpp - thrift-cpp + run: + - parquet-cpp + test: commands: - test -f $PREFIX/lib/libarrow.so diff --git a/cpp/src/arrow/types/primitive.h b/cpp/src/arrow/types/primitive.h index 6f6b2fed5a3..fc45f6c5b05 100644 --- a/cpp/src/arrow/types/primitive.h +++ b/cpp/src/arrow/types/primitive.h @@ -136,6 +136,7 @@ class NumericBuilder : public PrimitiveBuilder { using PrimitiveBuilder::Append; using PrimitiveBuilder::Init; using PrimitiveBuilder::Resize; + using PrimitiveBuilder::Reserve; // Scalar append. void Append(value_type val) { diff --git a/python/conda.recipe/build.sh b/python/conda.recipe/build.sh new file mode 100644 index 00000000000..a9d9aedead3 --- /dev/null +++ b/python/conda.recipe/build.sh @@ -0,0 +1,18 @@ +#!/bin/bash +set -ex + +# Build dependency +export ARROW_HOME=$PREFIX + +cd $RECIPE_DIR + +echo Setting the compiler... +if [ `uname` == Linux ]; then + EXTRA_CMAKE_ARGS=-DCMAKE_SHARED_LINKER_FLAGS=-static-libstdc++ +elif [ `uname` == Darwin ]; then + EXTRA_CMAKE_ARGS= +fi + +cd .. +$PYTHON setup.py build_ext --extra-cmake-args=$EXTRA_CMAKE_ARGS || exit 1 +$PYTHON setup.py install || exit 1 diff --git a/python/conda.recipe/meta.yaml b/python/conda.recipe/meta.yaml new file mode 100644 index 00000000000..85d24b6bc32 --- /dev/null +++ b/python/conda.recipe/meta.yaml @@ -0,0 +1,41 @@ +package: + name: pyarrow + version: "0.1" + +build: + number: {{environ.get('TRAVIS_BUILD_NUMBER', 0)}} # [unix] + rpaths: + - lib # [unix] + - lib/python{{environ.get('PY_VER')}}/site-packages/pyarrow # [unix] + script_env: + - CC [linux] + - CXX [linux] + - LD_LIBRARY_PATH [linux] + skip: true # [win] + +requirements: + build: + - cmake + - python + - setuptools + - cython + - numpy + - pandas + - arrow-cpp + - pytest + + run: + - arrow-cpp + - python + - numpy + - pandas + - six + +test: + imports: + - pyarrow + +about: + home: http://github.com/apache/arrow + license: Apache 2.0 + summary: 'Python bindings for Arrow C++ and interoperability tool for pandas and NumPy'