Skip to content

Commit 1870d08

Browse files
committed
Try to fix builds on Windows by setting Bazel output to TMP directory
1 parent c37aed2 commit 1870d08

File tree

1 file changed

+3
-1
lines changed
  • tensorflow-core/tensorflow-core-api

1 file changed

+3
-1
lines changed

tensorflow-core/tensorflow-core-api/build.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@ export BAZEL_USE_CPP_ONLY_TOOLCHAIN=1
77

88
export BAZEL_VC="${VCINSTALLDIR:-}"
99
if [[ -d $BAZEL_VC ]]; then
10+
export BAZEL_BUILD="--output_user_root=$(cygpath -w $TMP) build"
1011
export BUILD_FLAGS="--copt=//arch:AVX `#--copt=//arch:AVX2` --define=override_eigen_strong_inline=true"
1112
export PYTHON_BIN_PATH=$(which python.exe)
1213
else
14+
export BAZEL_BUILD="build"
1315
export BUILD_FLAGS="--copt=-msse4.1 --copt=-msse4.2 --copt=-mavx `#--copt=-mavx2 --copt=-mfma` --linkopt=-lstdc++ --host_linkopt=-lstdc++"
1416
export PYTHON_BIN_PATH=$(which python3)
1517
fi
@@ -33,7 +35,7 @@ BUILD_FLAGS="$BUILD_FLAGS --experimental_repo_remote_exec --python_path="$PYTHON
3335
BUILD_FLAGS="$BUILD_FLAGS --distinct_host_configuration=true"
3436

3537
# Build C/C++ API of TensorFlow itself including a target to generate ops for Java
36-
bazel --bazelrc=tensorflow.bazelrc build $BUILD_FLAGS ${BUILD_USER_FLAGS:-} \
38+
bazel --bazelrc=tensorflow.bazelrc $BAZEL_BUILD $BUILD_FLAGS ${BUILD_USER_FLAGS:-} \
3739
@org_tensorflow//tensorflow:tensorflow_cc \
3840
@org_tensorflow//tensorflow/tools/lib_package:jnilicenses_generate \
3941
:java_proto_gen_sources \

0 commit comments

Comments
 (0)