Skip to content

Commit

Permalink
small changes
Browse files Browse the repository at this point in the history
  • Loading branch information
lhelontra committed Mar 8, 2020
1 parent ab503f6 commit ef8873f
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions build_tensorflow/build_tensorflow.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,16 @@ TF_GIT_URL=${TF_GIT_URL:-"https://github.com/tensorflow/tensorflow"}
WORKDIR=${WORKDIR:-"$DIR"}
BAZEL_BIN="$(command -v bazel)"

function set_selected_python_default() {
PYTHON_BIN_PATH=$(command -v python${TF_PYTHON_VERSION})
default_python=$(command -v python)
[ -z "$default_python" ] && {
default_python="$(dirname $PYTHON_BIN_PATH)/python"
}
rm -f $default_python &>/dev/null
ln -sf $PYTHON_BIN_PATH $default_python &>/dev/null
}

function log_failure_msg() {
echo -ne "[${RED}ERROR${NC}] $@\n"
}
Expand Down Expand Up @@ -85,6 +95,7 @@ function build_bazel()
ln -sf "${WORKDIR}/bin/bazel-${BAZEL_VERSION}" "${WORKDIR}/bin/bazel" &>/dev/null
return 0
fi
set_selected_python_default

cd $WORKDIR

Expand Down Expand Up @@ -198,11 +209,8 @@ function configure_tensorflow()
$BAZEL_BIN clean
export PYTHON_BIN_PATH=$(command -v python${TF_PYTHON_VERSION})
export ${TF_BUILD_VARS}

# TODO: llvm calling python2 (remove in future)
local default_python="$(command -v python)"
rm -f $(command -v python) &>/dev/null
ln -sf $PYTHON_BIN_PATH $default_python &>/dev/null

set_selected_python_default

# if need_cuda is enabled, search sdk
if [ "$TF_NEED_CUDA" == "1" ]; then
Expand Down

0 comments on commit ef8873f

Please sign in to comment.