2016-06-22 11:42:04 -07:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2017-07-31 21:04:15 -07:00
|
|
|
set -x
|
|
|
|
|
2016-11-02 20:56:25 -07:00
|
|
|
# Cause the script to exit if a single command fails.
|
|
|
|
set -e
|
|
|
|
|
2016-06-22 11:42:04 -07:00
|
|
|
ROOT_DIR=$(cd "$(dirname "${BASH_SOURCE:-$0}")"; pwd)
|
|
|
|
|
2018-05-19 10:09:23 +08:00
|
|
|
function usage()
|
|
|
|
{
|
|
|
|
echo "Usage: build.sh [<args>]"
|
|
|
|
echo
|
|
|
|
echo "Options:"
|
|
|
|
echo " -h|--help print the help info"
|
2018-08-15 02:33:51 +08:00
|
|
|
echo " -l|--language language1[,language2]"
|
|
|
|
echo " a list of languages to build native libraries."
|
|
|
|
echo " Supported languages include \"python\" and \"java\"."
|
|
|
|
echo " If not specified, only python library will be built."
|
2018-05-19 10:09:23 +08:00
|
|
|
echo " -p|--python which python executable (default from which python)"
|
|
|
|
echo
|
|
|
|
}
|
2018-03-01 14:29:56 -08:00
|
|
|
|
2016-06-25 14:02:33 -07:00
|
|
|
# Determine how many parallel jobs to use for make based on the number of cores
|
|
|
|
unamestr="$(uname)"
|
|
|
|
if [[ "$unamestr" == "Linux" ]]; then
|
2019-02-23 11:58:59 -08:00
|
|
|
PARALLEL=1
|
2016-06-25 14:02:33 -07:00
|
|
|
elif [[ "$unamestr" == "Darwin" ]]; then
|
|
|
|
PARALLEL=$(sysctl -n hw.ncpu)
|
|
|
|
else
|
|
|
|
echo "Unrecognized platform."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2018-08-15 02:33:51 +08:00
|
|
|
RAY_BUILD_PYTHON="YES"
|
|
|
|
RAY_BUILD_JAVA="NO"
|
2018-05-19 10:09:23 +08:00
|
|
|
PYTHON_EXECUTABLE=""
|
|
|
|
BUILD_DIR=""
|
|
|
|
|
|
|
|
# Parse options
|
2019-05-01 21:29:48 -07:00
|
|
|
while [[ $# -gt 0 ]]; do
|
2018-05-19 10:09:23 +08:00
|
|
|
key="$1"
|
|
|
|
case $key in
|
|
|
|
-h|--help)
|
|
|
|
usage
|
|
|
|
exit 0
|
|
|
|
;;
|
|
|
|
-l|--languags)
|
|
|
|
LANGUAGE="$2"
|
2018-08-15 02:33:51 +08:00
|
|
|
RAY_BUILD_PYTHON="NO"
|
|
|
|
RAY_BUILD_JAVA="NO"
|
|
|
|
if [[ "$LANGUAGE" == *"python"* ]]; then
|
|
|
|
RAY_BUILD_PYTHON="YES"
|
|
|
|
fi
|
|
|
|
if [[ "$LANGUAGE" == *"java"* ]]; then
|
|
|
|
RAY_BUILD_JAVA="YES"
|
|
|
|
fi
|
|
|
|
if [ "$RAY_BUILD_PYTHON" == "NO" ] && [ "$RAY_BUILD_JAVA" == "NO" ]; then
|
|
|
|
echo "Unrecognized language: $LANGUAGE"
|
2018-05-19 10:09:23 +08:00
|
|
|
exit -1
|
|
|
|
fi
|
|
|
|
shift
|
|
|
|
;;
|
|
|
|
-p|--python)
|
|
|
|
PYTHON_EXECUTABLE="$2"
|
|
|
|
shift
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo "ERROR: unknown option \"$key\""
|
|
|
|
echo
|
|
|
|
usage
|
|
|
|
exit -1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
shift
|
|
|
|
done
|
|
|
|
|
|
|
|
if [[ -z "$PYTHON_EXECUTABLE" ]]; then
|
2019-05-01 21:29:48 -07:00
|
|
|
PYTHON_EXECUTABLE=$(which python)
|
2018-05-19 10:09:23 +08:00
|
|
|
fi
|
|
|
|
echo "Using Python executable $PYTHON_EXECUTABLE."
|
|
|
|
|
2019-05-01 21:29:48 -07:00
|
|
|
# Find the bazel executable. The script ci/travis/install-bazel.sh doesn't
|
|
|
|
# always put the bazel executable on the PATH.
|
|
|
|
BAZEL_EXECUTABLE=$(PATH="$PATH:$HOME/.bazel/bin" which bazel)
|
|
|
|
echo "Using Bazel executable $BAZEL_EXECUTABLE."
|
|
|
|
|
2018-08-15 02:33:51 +08:00
|
|
|
RAY_BUILD_PYTHON=$RAY_BUILD_PYTHON \
|
|
|
|
RAY_BUILD_JAVA=$RAY_BUILD_JAVA \
|
2019-05-01 21:29:48 -07:00
|
|
|
bash "$ROOT_DIR/setup_thirdparty.sh" "$PYTHON_EXECUTABLE"
|
2018-05-19 10:09:23 +08:00
|
|
|
|
2018-01-11 11:09:01 -08:00
|
|
|
# Now we build everything.
|
2018-06-02 07:28:27 +08:00
|
|
|
BUILD_DIR="$ROOT_DIR/build/"
|
|
|
|
if [ ! -d "${BUILD_DIR}" ]; then
|
2019-05-01 21:29:48 -07:00
|
|
|
mkdir -p "${BUILD_DIR}"
|
2018-05-19 10:09:23 +08:00
|
|
|
fi
|
|
|
|
|
|
|
|
pushd "$BUILD_DIR"
|
update ray cmake build process (#2853)
* use cmake to build ray project, no need to appply build.sh before cmake, fix some abuse of cmake, improve the build performance
* support boost external project, avoid using the system or build.sh boost
* keep compatible with build.sh, remove boost and arrow build from it.
* bugfix: parquet bison version control, plasma_java lib install problem
* bugfix: cmake, do not compile plasma java client if no need
* bugfix: component failures test timeout machenism has problem for plasma manager failed case
* bugfix: arrow use lib64 in centos, travis check-git-clang-format-output.sh does not support other branches except master
* revert some fix
* set arrow python executable, fix format error in component_failures_test.py
* make clean arrow python build directory
* update cmake code style, back to support cmake minimum version 3.4
2018-09-13 02:19:33 +08:00
|
|
|
|
2019-04-02 22:17:33 -07:00
|
|
|
# The following line installs pyarrow from S3, these wheels have been
|
|
|
|
# generated from https://github.com/ray-project/arrow-build from
|
|
|
|
# the commit listed in the command.
|
2019-08-07 16:54:48 -07:00
|
|
|
$PYTHON_EXECUTABLE -m pip install -q \
|
2019-05-28 16:04:16 -07:00
|
|
|
--target="$ROOT_DIR/python/ray/pyarrow_files" pyarrow==0.14.0.RAY \
|
2019-08-22 14:01:10 +08:00
|
|
|
--find-links https://s3-us-west-2.amazonaws.com/arrow-wheels/516e15028091b5e287200b5df77d77f72d9a6c9a/index.html
|
2019-04-02 22:17:33 -07:00
|
|
|
export PYTHON_BIN_PATH="$PYTHON_EXECUTABLE"
|
|
|
|
|
|
|
|
if [ "$RAY_BUILD_JAVA" == "YES" ]; then
|
2019-05-01 21:29:48 -07:00
|
|
|
$BAZEL_EXECUTABLE build //java:all --verbose_failures
|
2019-04-02 22:17:33 -07:00
|
|
|
fi
|
2019-03-22 14:30:05 +08:00
|
|
|
|
2019-04-02 22:17:33 -07:00
|
|
|
if [ "$RAY_BUILD_PYTHON" == "YES" ]; then
|
2019-05-01 21:29:48 -07:00
|
|
|
$BAZEL_EXECUTABLE build //:ray_pkg --verbose_failures
|
2019-02-23 11:58:59 -08:00
|
|
|
fi
|
2018-05-19 10:09:23 +08:00
|
|
|
|
2016-11-18 19:57:51 -08:00
|
|
|
popd
|