]> git.proxmox.com Git - ceph.git/blob - ceph/src/arrow/python/examples/minimal_build/build_venv.sh
import quincy 17.2.0
[ceph.git] / ceph / src / arrow / python / examples / minimal_build / build_venv.sh
1 #!/usr/bin/env bash
2 # Licensed to the Apache Software Foundation (ASF) under one
3 # or more contributor license agreements. See the NOTICE file
4 # distributed with this work for additional information
5 # regarding copyright ownership. The ASF licenses this file
6 # to you under the Apache License, Version 2.0 (the
7 # "License"); you may not use this file except in compliance
8 # with the License. You may obtain a copy of the License at
9 #
10 # http://www.apache.org/licenses/LICENSE-2.0
11 #
12 # Unless required by applicable law or agreed to in writing,
13 # software distributed under the License is distributed on an
14 # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 # KIND, either express or implied. See the License for the
16 # specific language governing permissions and limitations
17 # under the License.
18
19 set -e
20
21 #----------------------------------------------------------------------
22 # Change this to whatever makes sense for your system
23
24 WORKDIR=${WORKDIR:-$HOME}
25 MINICONDA=$WORKDIR/miniconda-for-arrow
26 LIBRARY_INSTALL_DIR=$WORKDIR/local-libs
27 CPP_BUILD_DIR=$WORKDIR/arrow-cpp-build
28 ARROW_ROOT=$WORKDIR/arrow
29 export ARROW_HOME=$WORKDIR/dist
30 export LD_LIBRARY_PATH=$ARROW_HOME/lib:$LD_LIBRARY_PATH
31
32 virtualenv $WORKDIR/venv
33 source $WORKDIR/venv/bin/activate
34
35 git clone https://github.com/apache/arrow.git $ARROW_ROOT
36
37 pip install -r $ARROW_ROOT/python/requirements-build.txt \
38 -r $ARROW_ROOT/python/requirements-test.txt
39
40 #----------------------------------------------------------------------
41 # Build C++ library
42
43 mkdir -p $CPP_BUILD_DIR
44 pushd $CPP_BUILD_DIR
45
46 cmake -GNinja \
47 -DCMAKE_BUILD_TYPE=DEBUG \
48 -DCMAKE_INSTALL_PREFIX=$ARROW_HOME \
49 -DCMAKE_INSTALL_LIBDIR=lib \
50 -DARROW_WITH_BZ2=ON \
51 -DARROW_WITH_ZLIB=ON \
52 -DARROW_WITH_ZSTD=ON \
53 -DARROW_WITH_LZ4=ON \
54 -DARROW_WITH_SNAPPY=ON \
55 -DARROW_WITH_BROTLI=ON \
56 -DARROW_PARQUET=ON \
57 -DARROW_PYTHON=ON \
58 $ARROW_ROOT/cpp
59
60 ninja install
61
62 popd
63
64 #----------------------------------------------------------------------
65 # Build and test Python library
66 pushd $ARROW_ROOT/python
67
68 rm -rf build/ # remove any pesky pre-existing build directory
69
70 export PYARROW_BUILD_TYPE=Debug
71 export PYARROW_CMAKE_GENERATOR=Ninja
72 export PYARROW_WITH_PARQUET=1
73
74 # You can run either "develop" or "build_ext --inplace". Your pick
75
76 # python setup.py build_ext --inplace
77 python setup.py develop
78
79 # git submodules are required for unit tests
80 git submodule update --init
81 export PARQUET_TEST_DATA="$ARROW_ROOT/cpp/submodules/parquet-testing/data"
82 export ARROW_TEST_DATA="$ARROW_ROOT/testing/data"
83
84 py.test pyarrow