Skip to content

Commit

Permalink
Add correct Python executable to Path when building arrow. (ray-proje…
Browse files Browse the repository at this point in the history
…ct#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.
  • Loading branch information
robertnishihara authored and pcmoritz committed Aug 7, 2017
1 parent 0225581 commit 3071ba0
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
18 changes: 14 additions & 4 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,27 @@ popd
bash "$ROOT_DIR/src/thirdparty/download_thirdparty.sh"
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.
pushd "$ROOT_DIR/python/ray/core"
# We use these variables to set PKG_CONFIG_PATH, which is important so that
# in cmake, pkg-config can find plasma.
TP_DIR=$ROOT_DIR/src/thirdparty
ARROW_HOME=$TP_DIR/arrow/cpp/build/cpp-install
if [ "$VALGRIND" = "1" ]
then
PKG_CONFIG_PATH=$ARROW_HOME/lib/pkgconfig cmake -DCMAKE_BUILD_TYPE=Debug ../../..
if [[ "$VALGRIND" = "1" ]]; then
# 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=Debug ../../..
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
make clean
make -j${PARALLEL}
Expand Down
7 changes: 7 additions & 0 deletions src/thirdparty/build_thirdparty.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ cd $TP_DIR/arrow/cpp
mkdir -p $TP_DIR/arrow/cpp/build
cd $TP_DIR/arrow/cpp/build
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 \
-DCMAKE_C_FLAGS="-g -O3" \
-DCMAKE_CXX_FLAGS="-g -O3" \
Expand Down

0 comments on commit 3071ba0

Please sign in to comment.