Skip to content

Commit

Permalink
ARROW-197: Working first draft of a conda recipe for pyarrow
Browse files Browse the repository at this point in the history
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 <[email protected]>

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
  • Loading branch information
wesm committed May 15, 2016
1 parent 4bd13b8 commit 68b80a8
Show file tree
Hide file tree
Showing 6 changed files with 144 additions and 0 deletions.
45 changes: 45 additions & 0 deletions cpp/conda.recipe/build.sh
Original file line number Diff line number Diff line change
@@ -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
32 changes: 32 additions & 0 deletions cpp/conda.recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -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'
7 changes: 7 additions & 0 deletions cpp/src/arrow/parquet/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
1 change: 1 addition & 0 deletions cpp/src/arrow/types/primitive.h
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
18 changes: 18 additions & 0 deletions python/conda.recipe/build.sh
Original file line number Diff line number Diff line change
@@ -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
41 changes: 41 additions & 0 deletions python/conda.recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -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'

0 comments on commit 68b80a8

Please sign in to comment.