Add correct Python executable to Path when building arrow. (#820)

* Tell cmake which python to use when building arrow.

* Pass different path into cmake when building arrow so that cmake finds the right python.

* Add correct python executable to PATH when running cmake for ray.
This commit is contained in:
Robert Nishihara 2017-08-07 14:47:34 -07:00 committed by Philipp Moritz
parent 0225581078
commit 3071ba0070
2 changed files with 21 additions and 4 deletions

View file

@ -32,17 +32,27 @@ popd
bash "$ROOT_DIR/src/thirdparty/download_thirdparty.sh" bash "$ROOT_DIR/src/thirdparty/download_thirdparty.sh"
bash "$ROOT_DIR/src/thirdparty/build_thirdparty.sh" $PYTHON_EXECUTABLE bash "$ROOT_DIR/src/thirdparty/build_thirdparty.sh" $PYTHON_EXECUTABLE
# Get the directory of the Python executable.
PYTHON_EXECUTABLE_DIR=$(dirname $PYTHON_EXECUTABLE)
# Now build everything. # Now build everything.
pushd "$ROOT_DIR/python/ray/core" pushd "$ROOT_DIR/python/ray/core"
# We use these variables to set PKG_CONFIG_PATH, which is important so that # We use these variables to set PKG_CONFIG_PATH, which is important so that
# in cmake, pkg-config can find plasma. # in cmake, pkg-config can find plasma.
TP_DIR=$ROOT_DIR/src/thirdparty TP_DIR=$ROOT_DIR/src/thirdparty
ARROW_HOME=$TP_DIR/arrow/cpp/build/cpp-install ARROW_HOME=$TP_DIR/arrow/cpp/build/cpp-install
if [ "$VALGRIND" = "1" ] if [[ "$VALGRIND" = "1" ]]; then
then # Pass a slightly different path into this command so that cmake finds the
PKG_CONFIG_PATH=$ARROW_HOME/lib/pkgconfig cmake -DCMAKE_BUILD_TYPE=Debug ../../.. # right Python interpreter and libraries.
PATH=$PYTHON_EXECUTABLE_DIR:$PATH \
PKG_CONFIG_PATH=$ARROW_HOME/lib/pkgconfig \
cmake -DCMAKE_BUILD_TYPE=Debug ../../..
else else
PKG_CONFIG_PATH=$ARROW_HOME/lib/pkgconfig cmake -DCMAKE_BUILD_TYPE=Release ../../.. # Pass a slightly different path into this command so that cmake finds the
# right Python interpreter and libraries.
PATH=$PYTHON_EXECUTABLE_DIR:$PATH \
PKG_CONFIG_PATH=$ARROW_HOME/lib/pkgconfig \
cmake -DCMAKE_BUILD_TYPE=Release ../../..
fi fi
make clean make clean
make -j${PARALLEL} make -j${PARALLEL}

View file

@ -31,6 +31,13 @@ cd $TP_DIR/arrow/cpp
mkdir -p $TP_DIR/arrow/cpp/build mkdir -p $TP_DIR/arrow/cpp/build
cd $TP_DIR/arrow/cpp/build cd $TP_DIR/arrow/cpp/build
export ARROW_HOME=$TP_DIR/arrow/cpp/build/cpp-install export ARROW_HOME=$TP_DIR/arrow/cpp/build/cpp-install
# Get the directory of the Python executable.
PYTHON_EXECUTABLE_DIR=$(dirname $PYTHON_EXECUTABLE)
# Pass a slightly different path into this command so that cmake finds the right
# Python interpreter and libraries.
PATH=$PYTHON_EXECUTABLE_DIR:$PATH \
cmake -DCMAKE_BUILD_TYPE=Release \ cmake -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_FLAGS="-g -O3" \ -DCMAKE_C_FLAGS="-g -O3" \
-DCMAKE_CXX_FLAGS="-g -O3" \ -DCMAKE_CXX_FLAGS="-g -O3" \