Skip to content

Commit 68b80a8

Browse files
committed
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 <wesm@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
1 parent 4bd13b8 commit 68b80a8

File tree

6 files changed

+144
-0
lines changed

6 files changed

+144
-0
lines changed

cpp/conda.recipe/build.sh

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#!/bin/bash
2+
3+
set -e
4+
set -x
5+
6+
cd $RECIPE_DIR
7+
8+
# Build dependencies
9+
export FLATBUFFERS_HOME=$PREFIX
10+
export PARQUET_HOME=$PREFIX
11+
12+
cd ..
13+
14+
rm -rf conda-build
15+
mkdir conda-build
16+
17+
cp -r thirdparty conda-build/
18+
19+
cd conda-build
20+
pwd
21+
22+
# Build googletest for running unit tests
23+
./thirdparty/download_thirdparty.sh
24+
./thirdparty/build_thirdparty.sh gtest
25+
26+
source thirdparty/versions.sh
27+
export GTEST_HOME=`pwd`/thirdparty/$GTEST_BASEDIR
28+
29+
if [ `uname` == Linux ]; then
30+
SHARED_LINKER_FLAGS='-static-libstdc++'
31+
elif [ `uname` == Darwin ]; then
32+
SHARED_LINKER_FLAGS=''
33+
fi
34+
35+
cmake \
36+
-DCMAKE_BUILD_TYPE=debug \
37+
-DCMAKE_INSTALL_PREFIX=$PREFIX \
38+
-DCMAKE_SHARED_LINKER_FLAGS=$SHARED_LINKER_FLAGS \
39+
-DARROW_IPC=on \
40+
-DARROW_PARQUET=on \
41+
..
42+
43+
make
44+
ctest -L unittest
45+
make install

cpp/conda.recipe/meta.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
package:
2+
name: arrow-cpp
3+
version: "0.1"
4+
5+
build:
6+
number: {{environ.get('TRAVIS_BUILD_NUMBER', 0)}} # [unix]
7+
skip: true # [win]
8+
script_env:
9+
- CC [linux]
10+
- CXX [linux]
11+
- LD_LIBRARY_PATH [linux]
12+
13+
requirements:
14+
build:
15+
- cmake
16+
- flatbuffers
17+
- parquet-cpp
18+
- thrift-cpp
19+
20+
run:
21+
- parquet-cpp
22+
23+
test:
24+
commands:
25+
- test -f $PREFIX/lib/libarrow.so
26+
- test -f $PREFIX/lib/libarrow_parquet.so
27+
- test -f $PREFIX/include/arrow/api.h
28+
29+
about:
30+
home: http://github.com/apache/arrow
31+
license: Apache 2.0
32+
summary: 'C++ libraries for the reference Apache Arrow implementation'

cpp/src/arrow/parquet/CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,11 @@ ARROW_TEST_LINK_LIBRARIES(parquet-reader-test arrow_parquet)
4242

4343
# Headers: top level
4444
install(FILES
45+
reader.h
46+
schema.h
47+
utils.h
4548
DESTINATION include/arrow/parquet)
49+
50+
install(TARGETS arrow_parquet
51+
LIBRARY DESTINATION lib
52+
ARCHIVE DESTINATION lib)

cpp/src/arrow/types/primitive.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ class NumericBuilder : public PrimitiveBuilder<T> {
136136
using PrimitiveBuilder<T>::Append;
137137
using PrimitiveBuilder<T>::Init;
138138
using PrimitiveBuilder<T>::Resize;
139+
using PrimitiveBuilder<T>::Reserve;
139140

140141
// Scalar append.
141142
void Append(value_type val) {

python/conda.recipe/build.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash
2+
set -ex
3+
4+
# Build dependency
5+
export ARROW_HOME=$PREFIX
6+
7+
cd $RECIPE_DIR
8+
9+
echo Setting the compiler...
10+
if [ `uname` == Linux ]; then
11+
EXTRA_CMAKE_ARGS=-DCMAKE_SHARED_LINKER_FLAGS=-static-libstdc++
12+
elif [ `uname` == Darwin ]; then
13+
EXTRA_CMAKE_ARGS=
14+
fi
15+
16+
cd ..
17+
$PYTHON setup.py build_ext --extra-cmake-args=$EXTRA_CMAKE_ARGS || exit 1
18+
$PYTHON setup.py install || exit 1

python/conda.recipe/meta.yaml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
package:
2+
name: pyarrow
3+
version: "0.1"
4+
5+
build:
6+
number: {{environ.get('TRAVIS_BUILD_NUMBER', 0)}} # [unix]
7+
rpaths:
8+
- lib # [unix]
9+
- lib/python{{environ.get('PY_VER')}}/site-packages/pyarrow # [unix]
10+
script_env:
11+
- CC [linux]
12+
- CXX [linux]
13+
- LD_LIBRARY_PATH [linux]
14+
skip: true # [win]
15+
16+
requirements:
17+
build:
18+
- cmake
19+
- python
20+
- setuptools
21+
- cython
22+
- numpy
23+
- pandas
24+
- arrow-cpp
25+
- pytest
26+
27+
run:
28+
- arrow-cpp
29+
- python
30+
- numpy
31+
- pandas
32+
- six
33+
34+
test:
35+
imports:
36+
- pyarrow
37+
38+
about:
39+
home: http://github.com/apache/arrow
40+
license: Apache 2.0
41+
summary: 'Python bindings for Arrow C++ and interoperability tool for pandas and NumPy'

0 commit comments

Comments
 (0)