Repository: arrow
Updated Branches:
  refs/heads/master 4bd13b852 -> 68b80a838


ARROW-197: Working first draft of a conda recipe for pyarrow

Includes ARROW-196. I will close that PR and merge these together as I had to 
make some additional changes. Requires PARQUET-617. Closes #76

Author: Wes McKinney <w...@apache.org>

Closes #77 from wesm/ARROW-197 and squashes the following commits:

4bf3d2c [Wes McKinney] Finagle toolchain environment variables to get pyarrow 
conda package working
c2d3684 [Wes McKinney] Add conda recipe and ensure that libarrow_parquet is 
installed as well


Project: http://git-wip-us.apache.org/repos/asf/arrow/repo
Commit: http://git-wip-us.apache.org/repos/asf/arrow/commit/68b80a83
Tree: http://git-wip-us.apache.org/repos/asf/arrow/tree/68b80a83
Diff: http://git-wip-us.apache.org/repos/asf/arrow/diff/68b80a83

Branch: refs/heads/master
Commit: 68b80a83876b1306f80d3914eef98f51100a8009
Parents: 4bd13b8
Author: Wes McKinney <w...@apache.org>
Authored: Sat May 14 18:53:22 2016 -0700
Committer: Wes McKinney <w...@apache.org>
Committed: Sat May 14 18:53:22 2016 -0700

----------------------------------------------------------------------
 cpp/conda.recipe/build.sh            | 45 +++++++++++++++++++++++++++++++
 cpp/conda.recipe/meta.yaml           | 32 ++++++++++++++++++++++
 cpp/src/arrow/parquet/CMakeLists.txt |  7 +++++
 cpp/src/arrow/types/primitive.h      |  1 +
 python/conda.recipe/build.sh         | 18 +++++++++++++
 python/conda.recipe/meta.yaml        | 41 ++++++++++++++++++++++++++++
 6 files changed, 144 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/arrow/blob/68b80a83/cpp/conda.recipe/build.sh
----------------------------------------------------------------------
diff --git a/cpp/conda.recipe/build.sh b/cpp/conda.recipe/build.sh
new file mode 100644
index 0000000..ac1f9c8
--- /dev/null
+++ b/cpp/conda.recipe/build.sh
@@ -0,0 +1,45 @@
+#!/bin/bash
+
+set -e
+set -x
+
+cd $RECIPE_DIR
+
+# Build dependencies
+export FLATBUFFERS_HOME=$PREFIX
+export PARQUET_HOME=$PREFIX
+
+cd ..
+
+rm -rf conda-build
+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
+
+if [ `uname` == Linux ]; then
+    SHARED_LINKER_FLAGS='-static-libstdc++'
+elif [ `uname` == Darwin ]; then
+    SHARED_LINKER_FLAGS=''
+fi
+
+cmake \
+    -DCMAKE_BUILD_TYPE=debug \
+    -DCMAKE_INSTALL_PREFIX=$PREFIX \
+    -DCMAKE_SHARED_LINKER_FLAGS=$SHARED_LINKER_FLAGS \
+    -DARROW_IPC=on \
+    -DARROW_PARQUET=on \
+    ..
+
+make
+ctest -L unittest
+make install

http://git-wip-us.apache.org/repos/asf/arrow/blob/68b80a83/cpp/conda.recipe/meta.yaml
----------------------------------------------------------------------
diff --git a/cpp/conda.recipe/meta.yaml b/cpp/conda.recipe/meta.yaml
new file mode 100644
index 0000000..2e834d5
--- /dev/null
+++ b/cpp/conda.recipe/meta.yaml
@@ -0,0 +1,32 @@
+package:
+  name: arrow-cpp
+  version: "0.1"
+
+build:
+  number: {{environ.get('TRAVIS_BUILD_NUMBER', 0)}}    # [unix]
+  skip: true  # [win]
+  script_env:
+    - CC [linux]
+    - CXX [linux]
+    - LD_LIBRARY_PATH [linux]
+
+requirements:
+  build:
+    - cmake
+    - flatbuffers
+    - parquet-cpp
+    - thrift-cpp
+
+  run:
+    - parquet-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'

http://git-wip-us.apache.org/repos/asf/arrow/blob/68b80a83/cpp/src/arrow/parquet/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/cpp/src/arrow/parquet/CMakeLists.txt 
b/cpp/src/arrow/parquet/CMakeLists.txt
index 1ae6709..cd6f05d 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)

http://git-wip-us.apache.org/repos/asf/arrow/blob/68b80a83/cpp/src/arrow/types/primitive.h
----------------------------------------------------------------------
diff --git a/cpp/src/arrow/types/primitive.h b/cpp/src/arrow/types/primitive.h
index 6f6b2fe..fc45f6c 100644
--- a/cpp/src/arrow/types/primitive.h
+++ b/cpp/src/arrow/types/primitive.h
@@ -136,6 +136,7 @@ class NumericBuilder : public PrimitiveBuilder<T> {
   using PrimitiveBuilder<T>::Append;
   using PrimitiveBuilder<T>::Init;
   using PrimitiveBuilder<T>::Resize;
+  using PrimitiveBuilder<T>::Reserve;
 
   // Scalar append.
   void Append(value_type val) {

http://git-wip-us.apache.org/repos/asf/arrow/blob/68b80a83/python/conda.recipe/build.sh
----------------------------------------------------------------------
diff --git a/python/conda.recipe/build.sh b/python/conda.recipe/build.sh
new file mode 100644
index 0000000..a9d9aed
--- /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

http://git-wip-us.apache.org/repos/asf/arrow/blob/68b80a83/python/conda.recipe/meta.yaml
----------------------------------------------------------------------
diff --git a/python/conda.recipe/meta.yaml b/python/conda.recipe/meta.yaml
new file mode 100644
index 0000000..85d24b6
--- /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'

Reply via email to