Skip to content

Commit

Permalink
Migrate TensorFlow for --incompatible_skip_genfiles_symlink
Browse files Browse the repository at this point in the history
Since Bazel 0.25, both bazel-genfiles and bazel-bin point to the same location.
In Bazel 1.0, bazel-genfiles symlink won't be generated anymore, everything was there are
now merged into bazel-bin folder.

Related: bazelbuild/bazel#8651
PiperOrigin-RevId: 278815738
Change-Id: I0982662ad511e4fae1562a5cdd9c6543d7366480
  • Loading branch information
tensorflower-gardener authored and MohamedNourArm committed Nov 6, 2019
1 parent 7dcb9ee commit ef22568
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions tensorflow/compiler/xla/g3doc/tfcompile.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,11 @@ For details on the underlying `tfcompile` tool, see

This step uses the header file (`test_graph_tfmatmul.h`) generated by the
`tf_library` build macro in the previous step to invoke the generated code. The
header file is located in the `bazel-genfiles` directory corresponding to the
header file is located in the `bazel-bin` directory corresponding to the
build package, and is named based on the name attribute set on the `tf_library`
build macro. For example, the header generated for `test_graph_tfmatmul` would
be `test_graph_tfmatmul.h`. Below is an abbreviated version of what is
generated. The generated file, in `bazel-genfiles`, contains additional useful
generated. The generated file, in `bazel-bin`, contains additional useful
comments.

```c++
Expand Down
4 changes: 2 additions & 2 deletions tensorflow/lite/g3doc/guide/android.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ bazel build --cxxopt='-std=c++11' -c opt \
//tensorflow/lite/java:tensorflow-lite
```

This will generate an AAR file in `bazel-genfiles/tensorflow/lite/java/`. Note
This will generate an AAR file in `bazel-bin/tensorflow/lite/java/`. Note
that this builds a "fat" AAR with several different architectures; if you don't
need all of them, use the subset appropriate for your deployment environment.
From there, there are several approaches you can take to use the .aar in your
Expand Down Expand Up @@ -169,7 +169,7 @@ Execute the following command from your root checkout directory:

```sh
mvn install:install-file \
-Dfile=bazel-genfiles/tensorflow/lite/java/tensorflow-lite.aar \
-Dfile=bazel-bin/tensorflow/lite/java/tensorflow-lite.aar \
-DgroupId=org.tensorflow \
-DartifactId=tensorflow-lite -Dversion=0.1.100 -Dpackaging=aar
```
Expand Down
4 changes: 2 additions & 2 deletions tensorflow/lite/g3doc/guide/ops_select.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,13 @@ bazel build --cxxopt='--std=c++11' -c opt \
//tensorflow/lite/java:tensorflow-lite-with-select-tf-ops
```

This will generate an AAR file in `bazel-genfiles/tensorflow/lite/java/`. From
This will generate an AAR file in `bazel-bin/tensorflow/lite/java/`. From
there, you can either import the AAR directly into your project, or publish the
custom AAR to your local Maven repository:

```sh
mvn install:install-file \
-Dfile=bazel-genfiles/tensorflow/lite/java/tensorflow-lite-with-select-tf-ops.aar \
-Dfile=bazel-bin/tensorflow/lite/java/tensorflow-lite-with-select-tf-ops.aar \
-DgroupId=org.tensorflow \
-DartifactId=tensorflow-lite-with-select-tf-ops -Dversion=0.1.100 -Dpackaging=aar
```
Expand Down
2 changes: 1 addition & 1 deletion tensorflow/lite/lib_package/create_ios_frameworks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ cd $TFLITE_DIR/../..
echo "Generate LICENSE files and copy to target"
bazel build //tensorflow/tools/lib_package:clicenses_generate
cp $TFLITE_DIR/../../LICENSE $FW_DIR_TFLITE
cp $TFLITE_DIR/../../bazel-genfiles/tensorflow/tools/lib_package/THIRD_PARTY_TF_C_LICENSES \
cp $TFLITE_DIR/../../bazel-bin/tensorflow/tools/lib_package/THIRD_PARTY_TF_C_LICENSES \
$FW_DIR_TFLITE

echo "Copying static libraries"
Expand Down
2 changes: 1 addition & 1 deletion tensorflow/tools/ci_build/builds/libtensorflow.sh
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ function build_libtensorflow_tarball() {
cp bazel-bin/tensorflow/tools/lib_package/libtensorflow_jni.tar.gz ${DIR}/libtensorflow_jni${TARBALL_SUFFIX}.tar.gz
cp bazel-bin/tensorflow/java/libtensorflow.jar ${DIR}
cp_normalized_srcjar bazel-bin/tensorflow/java/libtensorflow-src.jar ${DIR}/libtensorflow-src.jar
cp bazel-genfiles/tensorflow/tools/lib_package/libtensorflow_proto.zip ${DIR}
cp bazel-bin/tensorflow/tools/lib_package/libtensorflow_proto.zip ${DIR}
chmod -x ${DIR}/*
}

Expand Down
6 changes: 3 additions & 3 deletions tensorflow/tools/ci_build/windows/libtensorflow_cpu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ mkdir -p ${DIR}
cp bazel-bin/tensorflow/java/tensorflow_jni.dll ${DIR}/tensorflow_jni.dll
zip -j ${DIR}/libtensorflow_jni-cpu-windows-$(uname -m).zip \
${DIR}/tensorflow_jni.dll \
bazel-genfiles/tensorflow/tools/lib_package/include/tensorflow/THIRD_PARTY_TF_JNI_LICENSES \
bazel-bin/tensorflow/tools/lib_package/include/tensorflow/THIRD_PARTY_TF_JNI_LICENSES \
LICENSE
rm -f ${DIR}/tensorflow_jni.dll

Expand All @@ -61,7 +61,7 @@ mkdir -p ${DIR}/include/tensorflow/c
mkdir -p ${DIR}/include/tensorflow/c/eager
mkdir -p ${DIR}/lib
cp bazel-bin/tensorflow/tensorflow.dll ${DIR}/lib/tensorflow.dll
cp bazel-genfiles/tensorflow/tensorflow.lib ${DIR}/lib/tensorflow.lib
cp bazel-bin/tensorflow/tensorflow.lib ${DIR}/lib/tensorflow.lib
cp tensorflow/c/c_api.h \
tensorflow/c/tf_attrtype.h \
tensorflow/c/tf_datatype.h \
Expand All @@ -70,7 +70,7 @@ cp tensorflow/c/c_api.h \
${DIR}/include/tensorflow/c
cp tensorflow/c/eager/c_api.h ${DIR}/include/tensorflow/c/eager
cp LICENSE ${DIR}/LICENSE
cp bazel-genfiles/tensorflow/tools/lib_package/THIRD_PARTY_TF_C_LICENSES ${DIR}/
cp bazel-bin/tensorflow/tools/lib_package/THIRD_PARTY_TF_C_LICENSES ${DIR}/
cd ${DIR}
zip libtensorflow-cpu-windows-$(uname -m).zip \
lib/tensorflow.dll \
Expand Down
6 changes: 3 additions & 3 deletions tensorflow/tools/ci_build/windows/libtensorflow_gpu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ mkdir -p ${DIR}
cp bazel-bin/tensorflow/java/tensorflow_jni.dll ${DIR}/tensorflow_jni.dll
zip -j ${DIR}/libtensorflow_jni-gpu-windows-$(uname -m).zip \
${DIR}/tensorflow_jni.dll \
bazel-genfiles/tensorflow/tools/lib_package/include/tensorflow/THIRD_PARTY_TF_JNI_LICENSES \
bazel-bin/tensorflow/tools/lib_package/include/tensorflow/THIRD_PARTY_TF_JNI_LICENSES \
LICENSE
rm -f ${DIR}/tensorflow_jni.dll

Expand All @@ -61,7 +61,7 @@ mkdir -p ${DIR}/include/tensorflow/c
mkdir -p ${DIR}/include/tensorflow/c/eager
mkdir -p ${DIR}/lib
cp bazel-bin/tensorflow/tensorflow.dll ${DIR}/lib/tensorflow.dll
cp bazel-genfiles/tensorflow/tensorflow.lib ${DIR}/lib/tensorflow.lib
cp bazel-bin/tensorflow/tensorflow.lib ${DIR}/lib/tensorflow.lib
cp tensorflow/c/c_api.h \
tensorflow/c/tf_attrtype.h \
tensorflow/c/tf_datatype.h \
Expand All @@ -70,7 +70,7 @@ cp tensorflow/c/c_api.h \
${DIR}/include/tensorflow/c
cp tensorflow/c/eager/c_api.h ${DIR}/include/tensorflow/c/eager
cp LICENSE ${DIR}/LICENSE
cp bazel-genfiles/tensorflow/tools/lib_package/THIRD_PARTY_TF_C_LICENSES ${DIR}/
cp bazel-bin/tensorflow/tools/lib_package/THIRD_PARTY_TF_C_LICENSES ${DIR}/
cd ${DIR}
zip libtensorflow-gpu-windows-$(uname -m).zip \
lib/tensorflow.dll \
Expand Down

0 comments on commit ef22568

Please sign in to comment.