diff --git a/build.sh b/build.sh index 43bd1d13a..d9bc39f9d 100755 --- a/build.sh +++ b/build.sh @@ -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} diff --git a/src/thirdparty/build_thirdparty.sh b/src/thirdparty/build_thirdparty.sh index be7095e5b..c4f75e1c4 100755 --- a/src/thirdparty/build_thirdparty.sh +++ b/src/thirdparty/build_thirdparty.sh @@ -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" \