diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d609b65ca9a..d2e8336fa2c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -57,6 +57,7 @@ jobs: echo Downloading Bazel curl -L https://github.com/bazelbuild/bazel/releases/download/2.0.0/bazel-2.0.0-installer-darwin-x86_64.sh -o bazel.sh --retry 10 bash bazel.sh + brew install libomp - name: Checkout repository uses: actions/checkout@v1 - name: Build project @@ -77,6 +78,7 @@ jobs: strategy: matrix: ext: ["", -mkl, -gpu, -mkl-gpu] + timeout-minutes: 480 steps: - name: Configure page file uses: al-cheb/configure-pagefile-action@v1.2 diff --git a/tensorflow-core/tensorflow-core-api/BUILD b/tensorflow-core/tensorflow-core-api/BUILD index 2e8278fae75..31849ee31be 100644 --- a/tensorflow-core/tensorflow-core-api/BUILD +++ b/tensorflow-core/tensorflow-core-api/BUILD @@ -1,25 +1,21 @@ -load("@org_tensorflow//tensorflow:tensorflow.bzl", "tf_copts") +load("@org_tensorflow//tensorflow:tensorflow.bzl", "tf_copts", "tf_cc_binary") load("@rules_java//java:defs.bzl", "java_proto_library") -cc_binary( +tf_cc_binary( name = "java_op_generator", - srcs = [ - "src/bazel/op_generator/op_gen_main.cc", - ], - copts = tf_copts(), linkopts = select({ "@org_tensorflow//tensorflow:windows": [], "//conditions:default": ["-lm"], }), deps = [ ":java_op_gen_lib", - "@org_tensorflow//tensorflow:libtensorflow_framework_import_lib", ], ) cc_library( name = "java_op_gen_lib", srcs = [ + "src/bazel/op_generator/op_gen_main.cc", "src/bazel/op_generator/op_generator.cc", "src/bazel/op_generator/op_specs.cc", "src/bazel/op_generator/source_writer.cc", @@ -45,12 +41,11 @@ filegroup( srcs = glob(["src/bazel/api_def/*"]) ) -cc_binary( +tf_cc_binary( name = "java_api_import", srcs = [ "src/bazel/api_def/import/api_import.cc", ], - copts = tf_copts(), linkopts = select({ "@org_tensorflow//tensorflow:windows": [], "//conditions:default": ["-lm"], @@ -58,7 +53,6 @@ cc_binary( deps = [ "@org_tensorflow//tensorflow/core:op_gen_lib", "@org_tensorflow//tensorflow/tools/api/lib:api_objects_proto_cc", - "@org_tensorflow//tensorflow:libtensorflow_framework_import_lib" ], ) diff --git a/tensorflow-core/tensorflow-core-api/WORKSPACE b/tensorflow-core/tensorflow-core-api/WORKSPACE index c089649de56..ccd642fa1fc 100644 --- a/tensorflow-core/tensorflow-core-api/WORKSPACE +++ b/tensorflow-core/tensorflow-core-api/WORKSPACE @@ -8,10 +8,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") http_archive( name = "org_tensorflow", patches = [ + ":tensorflow-visibility.patch", ":tensorflow-windows.patch", # https://github.com/tensorflow/tensorflow/issues/25213 ":tensorflow-proto.patch", - ":tensorflow-api-def.patch", - ":tensorflow-framework.patch" ], patch_tool = "patch", patch_args = ["-p1"], diff --git a/tensorflow-core/tensorflow-core-api/build.sh b/tensorflow-core/tensorflow-core-api/build.sh index d23e04fc58e..2523d6f7f29 100755 --- a/tensorflow-core/tensorflow-core-api/build.sh +++ b/tensorflow-core/tensorflow-core-api/build.sh @@ -18,7 +18,7 @@ else fi if [[ "${EXTENSION:-}" == *mkl* ]]; then - export BUILD_FLAGS="$BUILD_FLAGS --config=mkl" + export BUILD_FLAGS="$BUILD_FLAGS --config=mkl --define build_with_mkl_dnn_v1_only=false" fi if [[ "${EXTENSION:-}" == *gpu* ]]; then @@ -45,21 +45,21 @@ export TENSORFLOW_BIN=$BAZEL_BIN/external/org_tensorflow/tensorflow # Normalize some paths with symbolic links TENSORFLOW_SO=($TENSORFLOW_BIN/libtensorflow.so.?.?.?) if [[ -f $TENSORFLOW_SO ]]; then - export TENSORFLOW_LIB=$(basename $TENSORFLOW_SO) - ln -sf $TENSORFLOW_LIB $TENSORFLOW_BIN/libtensorflow.so - ln -sf $TENSORFLOW_LIB $TENSORFLOW_BIN/libtensorflow.so.2 + export TENSORFLOW_LIB=$TENSORFLOW_SO + ln -sf $(basename $TENSORFLOW_SO) $TENSORFLOW_BIN/libtensorflow.so + ln -sf $(basename $TENSORFLOW_SO) $TENSORFLOW_BIN/libtensorflow.so.2 fi TENSORFLOW_DYLIB=($TENSORFLOW_BIN/libtensorflow.?.?.?.dylib) if [[ -f $TENSORFLOW_DYLIB ]]; then - export TENSORFLOW_LIB=$(basename $TENSORFLOW_DYLIB) - ln -sf $TENSORFLOW_LIB $TENSORFLOW_BIN/libtensorflow.dylib - ln -sf $TENSORFLOW_LIB $TENSORFLOW_BIN/libtensorflow.2.dylib + export TENSORFLOW_LIB=$TENSORFLOW_DYLIB + ln -sf $(basename $TENSORFLOW_DYLIB) $TENSORFLOW_BIN/libtensorflow.dylib + ln -sf $(basename $TENSORFLOW_DYLIB) $TENSORFLOW_BIN/libtensorflow.2.dylib fi TENSORFLOW_DLLS=($TENSORFLOW_BIN/tensorflow.dll.if.lib $TENSORFLOW_BIN/libtensorflow.dll.ifso) for TENSORFLOW_DLL in ${TENSORFLOW_DLLS[@]}; do if [[ -f $TENSORFLOW_DLL ]]; then - export TENSORFLOW_LIB=$(basename $TENSORFLOW_DLL) - ln -sf $TENSORFLOW_LIB $TENSORFLOW_BIN/tensorflow.lib + export TENSORFLOW_LIB=$TENSORFLOW_DLL + ln -sf $(basename $TENSORFLOW_DLL) $TENSORFLOW_BIN/tensorflow.lib fi done ls -l $TENSORFLOW_BIN @@ -68,7 +68,7 @@ GEN_SRCS_DIR=src/gen/java mkdir -p $GEN_SRCS_DIR # Generate Java operator wrappers -LD_LIBRARY_PATH=$TENSORFLOW_BIN $BAZEL_BIN/java_op_generator \ +$BAZEL_BIN/java_op_generator \ --output_dir=$GEN_SRCS_DIR \ --api_dirs=$BAZEL_SRCS/external/org_tensorflow/tensorflow/core/api_def/base_api,src/bazel/api_def \ $TENSORFLOW_LIB diff --git a/tensorflow-core/tensorflow-core-api/external/tensorflow-framework.patch b/tensorflow-core/tensorflow-core-api/external/tensorflow-framework.patch deleted file mode 100644 index c7c633e4ef2..00000000000 --- a/tensorflow-core/tensorflow-core-api/external/tensorflow-framework.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/tensorflow/BUILD b/tensorflow/BUILD -index 55406a5686..c9e7464dba 100644 ---- a/tensorflow/BUILD -+++ b/tensorflow/BUILD -@@ -654,6 +654,7 @@ tf_cc_shared_object( - # as a workaround for https://github.com/tensorflow/tensorflow/issues/34117 - cc_import( - name = "libtensorflow_framework_import_lib", -+ visibility = ["//visibility:public"], - shared_library = select({ - "//tensorflow:macos": ":libtensorflow_framework.dylib", - "//conditions:default": ":libtensorflow_framework.so", diff --git a/tensorflow-core/tensorflow-core-api/external/tensorflow-api-def.patch b/tensorflow-core/tensorflow-core-api/external/tensorflow-visibility.patch similarity index 69% rename from tensorflow-core/tensorflow-core-api/external/tensorflow-api-def.patch rename to tensorflow-core/tensorflow-core-api/external/tensorflow-visibility.patch index 1302bbd35b1..03fda9811c3 100644 --- a/tensorflow-core/tensorflow-core-api/external/tensorflow-api-def.patch +++ b/tensorflow-core/tensorflow-core-api/external/tensorflow-visibility.patch @@ -1,3 +1,16 @@ +diff --git a/tensorflow/BUILD b/tensorflow/BUILD +index 55406a5686..35d1547dfb 100644 +--- a/tensorflow/BUILD ++++ b/tensorflow/BUILD +@@ -33,7 +33,7 @@ load( + load("@bazel_skylib//:bzl_library.bzl", "bzl_library") + + package( +- default_visibility = [":internal"], ++ default_visibility = ["//visibility:public"], + licenses = ["notice"], # Apache 2.0 + ) + diff --ruN a/tensorflow/core/api_def/BUILD b/tensorflow/core/api_def/BUILD --- a/tensorflow/core/api_def/BUILD 2020-03-26 18:19:19.000000000 -0400 +++ b/tensorflow/core/api_def/BUILD 2020-04-01 22:50:37.000000000 -0400 @@ -21,3 +34,4 @@ diff -ruN a/tensorflow/tools/api/lib/BUILD b/tensorflow/tools/api/lib/BUILD ) py_library( + \ No newline at end of file