i am using centos-7 machine to build a TF model server from source code when i executed a bazel build command "bazel build --cxxopt=-std=c++11 -c opt tensorflow_serving/... --incompatible_remove_native_http_archive=false --incompatible_package_name_is_a_function=false"it is not giving any error but bazel-bin directory is not available.
please find output of the command and help me out to find the TF model bin
In case Bazel wasn't able to create the symlinks for bazel-bin, the error would have been printed as one of the first message of a build, so we can't see this from the screenshot. You can check via "bazel shutdown && bazel build" - maybe your directory is read-only or you don't have write permissions there?
However, you should be able to find the output files in the directory printed by this command (run it inside your workspace where you also did the build): bazel info bazel-bin.
Hope this helps!
Hi everyone, I am trying to compile tensorflow from source using bazel [version:0.26.0] and bazelisk [1.1.0] and seems like I am getting the same error. When bazel is building tensorflow, bazel-bin is missed. Now I am attaching the error:
FAILED: Build did NOT complete successfully
Internal error thrown during build. Printing stack trace: java.lang.UnsupportedOperationException: /media/ipouplana/Nuevo_vol/Project_Housing/tensorflow-2.0.0/bazel-bin (Function not implemented)
at com.google.devtools.build.lib.unix.NativePosixFiles.symlink(Native Method)
at com.google.devtools.build.lib.unix.UnixFileSystem.createSymbolicLink(UnixFileSystem.java:333)
at com.google.devtools.build.lib.vfs.Path.createSymbolicLink(Path.java:583)
at com.google.devtools.build.lib.vfs.FileSystemUtils.ensureSymbolicLink(FileSystemUtils.java:353)
at com.google.devtools.build.lib.vfs.FileSystemUtils.ensureSymbolicLink(FileSystemUtils.java:304)
at com.google.devtools.build.lib.buildtool.OutputDirectoryLinksUtils.createLink(OutputDirectoryLinksUtils.java:271)
at com.google.devtools.build.lib.buildtool.OutputDirectoryLinksUtils.createOutputDirectoryLinks(OutputDirectoryLinksUtils.java:200)
at com.google.devtools.build.lib.buildtool.ExecutionTool.executeBuild(ExecutionTool.java:273)
at com.google.devtools.build.lib.buildtool.BuildTool.buildTargets(BuildTool.java:166)
at com.google.devtools.build.lib.buildtool.BuildTool.processRequest(BuildTool.java:272)
at com.google.devtools.build.lib.runtime.commands.BuildCommand.exec(BuildCommand.java:97)
at com.google.devtools.build.lib.runtime.BlazeCommandDispatcher.execExclusively(BlazeCommandDispatcher.java:498)
at com.google.devtools.build.lib.runtime.BlazeCommandDispatcher.exec(BlazeCommandDispatcher.java:206)
at com.google.devtools.build.lib.server.GrpcServerImpl.executeCommand(GrpcServerImpl.java:749)
at com.google.devtools.build.lib.server.GrpcServerImpl.access$1600(GrpcServerImpl.java:103)
at com.google.devtools.build.lib.server.GrpcServerImpl$2.lambda$run$0(GrpcServerImpl.java:818)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
java.lang.UnsupportedOperationException: /media/ipouplana/Nuevo_vol/Project_Housing/tensorflow-2.0.0/bazel-bin (Function not implemented)
at com.google.devtools.build.lib.unix.NativePosixFiles.symlink(Native Method)
at com.google.devtools.build.lib.unix.UnixFileSystem.createSymbolicLink(UnixFileSystem.java:333)
at com.google.devtools.build.lib.vfs.Path.createSymbolicLink(Path.java:583)
at com.google.devtools.build.lib.vfs.FileSystemUtils.ensureSymbolicLink(FileSystemUtils.java:353)
at com.google.devtools.build.lib.vfs.FileSystemUtils.ensureSymbolicLink(FileSystemUtils.java:304)
at com.google.devtools.build.lib.buildtool.OutputDirectoryLinksUtils.createLink(OutputDirectoryLinksUtils.java:271)
at com.google.devtools.build.lib.buildtool.OutputDirectoryLinksUtils.createOutputDirectoryLinks(OutputDirectoryLinksUtils.java:200)
at com.google.devtools.build.lib.buildtool.ExecutionTool.executeBuild(ExecutionTool.java:273)
at com.google.devtools.build.lib.buildtool.BuildTool.buildTargets(BuildTool.java:166)
at com.google.devtools.build.lib.buildtool.BuildTool.processRequest(BuildTool.java:272)
at com.google.devtools.build.lib.runtime.commands.BuildCommand.exec(BuildCommand.java:97)
at com.google.devtools.build.lib.runtime.BlazeCommandDispatcher.execExclusively(BlazeCommandDispatcher.java:498)
at com.google.devtools.build.lib.runtime.BlazeCommandDispatcher.exec(BlazeCommandDispatcher.java:206)
at com.google.devtools.build.lib.server.GrpcServerImpl.executeCommand(GrpcServerImpl.java:749)
at com.google.devtools.build.lib.server.GrpcServerImpl.access$1600(GrpcServerImpl.java:103)
at com.google.devtools.build.lib.server.GrpcServerImpl$2.lambda$run$0(GrpcServerImpl.java:818)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
java.lang.UnsupportedOperationException: /media/ipouplana/Nuevo_vol/Project_Housing/tensorflow-2.0.0/bazel-bin (Function not implemented)
at com.google.devtools.build.lib.unix.NativePosixFiles.symlink(Native Method)
at com.google.devtools.build.lib.unix.UnixFileSystem.createSymbolicLink(UnixFileSystem.java:333)
at com.google.devtools.build.lib.vfs.Path.createSymbolicLink(Path.java:583)
at com.google.devtools.build.lib.vfs.FileSystemUtils.ensureSymbolicLink(FileSystemUtils.java:353)
at com.google.devtools.build.lib.vfs.FileSystemUtils.ensureSymbolicLink(FileSystemUtils.java:304)
at com.google.devtools.build.lib.buildtool.OutputDirectoryLinksUtils.createLink(OutputDirectoryLinksUtils.java:271)
at com.google.devtools.build.lib.buildtool.OutputDirectoryLinksUtils.createOutputDirectoryLinks(OutputDirectoryLinksUtils.java:200)
at com.google.devtools.build.lib.buildtool.ExecutionTool.executeBuild(ExecutionTool.java:273)
at com.google.devtools.build.lib.buildtool.BuildTool.buildTargets(BuildTool.java:166)
at com.google.devtools.build.lib.buildtool.BuildTool.processRequest(BuildTool.java:272)
at com.google.devtools.build.lib.runtime.commands.BuildCommand.exec(BuildCommand.java:97)
at com.google.devtools.build.lib.runtime.BlazeCommandDispatcher.execExclusively(BlazeCommandDispatcher.java:498)
at com.google.devtools.build.lib.runtime.BlazeCommandDispatcher.exec(BlazeCommandDispatcher.java:206)
at com.google.devtools.build.lib.server.GrpcServerImpl.executeCommand(GrpcServerImpl.java:749)
at com.google.devtools.build.lib.server.GrpcServerImpl.access$1600(GrpcServerImpl.java:103)
at com.google.devtools.build.lib.server.GrpcServerImpl$2.lambda$run$0(GrpcServerImpl.java:818)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
FAILED: Build did NOT complete successfully
I have run bazel info bazel-bin and I've got this information:
INFO: Options provided by the client:
Inherited 'common' options: --isatty=1 --terminal_columns=178
INFO: Reading rc options for 'info' from /media/ipouplana/Nuevo_vol/Project_Housing/tensorflow-2.0.0/.bazelrc:
Inherited 'build' options: --apple_platform_type=macos --define framework_shared_object=true --define open_source_build=true --define=use_fast_cpp_protos=true --define=allow_oversize_protos=true --spawn_strategy=standalone --strategy=Genrule=standalone -c opt --announce_rc --define=grpc_no_ares=true --define=PREFIX=/usr --define=LIBDIR=$(PREFIX)/lib --define=INCLUDEDIR=$(PREFIX)/include --config=v2
INFO: Reading rc options for 'info' from /media/ipouplana/Nuevo_vol/Project_Housing/tensorflow-2.0.0/.tf_configure.bazelrc:
Inherited 'build' options: --action_env PYTHON_BIN_PATH=/usr/bin/python3 --action_env PYTHON_LIB_PATH=/usr/local/lib/python3.5/dist-packages --python_path=/usr/bin/python3 --config=xla --action_env TF_CONFIGURE_IOS=0
INFO: Found applicable config definition build:v2 in file /media/ipouplana/Nuevo_vol/Project_Housing/tensorflow-2.0.0/.bazelrc: --define=tf_api_version=2
INFO: Found applicable config definition build:xla in file /media/ipouplana/Nuevo_vol/Project_Housing/tensorflow-2.0.0/.tf_configure.bazelrc: --define with_xla_support=true
/home/ipouplana/.cache/bazel/_bazel_ipouplana/e247190474a2073cbd54243f45564ce4/execroot/org_tensorflow/bazel-out/k8-opt/bin
Can you help me to find my error? I've checked the permissions and I can read and write in the directory.
Thanks in advance!!!!
@jgonzalezusua What filesystem is your /media/ipouplana using? The error message suggests that it does not support symlinks. Bazel should not crash in that case and we can try to fix that (if it hasn't been fixed already in a later version), but in the meantime, you can try this workaround: bazel build --symlink_prefix=/ when you run Bazel. This will tell Bazel to not create the symlink so it will hopefully work.
The filesystem I'm using is exfat. Now I am trying the workaround you told me, I will tell you if it is fixed or I still get errors. Thanks for your help!!
Ok, finally I got to build the package, the problem now is that the folder bazel-bin has not been created so when I move to the following step, which is to use this command:
./bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg
I get an error saying that this folder is not found.
The folder bazel-bin is a so called "convenience symlink" that Bazel creates, which points to the actual location underneath Bazel's "output base" (which is where it stores all the outputs of a build). Creating the symlink doesn't work on exFAT, but you can still get to the folder by printing its path:
cd into your workspace where you also ran bazel build.bazel info bazel-bin. This will print a path. You can append tensorflow/tools/pip_package/build_pip_package to it to get your file. :)Or in one step, this should also work directly:
cd /media/ipouplana/Nuevo_vol/Project_Housing/tensorflow-2.0.0
$(bazel info bazel-bin)/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg
I can't get the path, when I run bazel info bazel-bin I obtain the following:
INFO: Options provided by the client:
Inherited 'common' options: --isatty=1 --terminal_columns=107
INFO: Reading rc options for 'info' from /media/ipouplana/Nuevo_vol/Project_Housing/tensorflow-2.0.0/.bazelrc:
Inherited 'build' options: --apple_platform_type=macos --define framework_shared_object=true --define open_source_build=true --define=use_fast_cpp_protos=true --define=allow_oversize_protos=true --spawn_strategy=standalone --strategy=Genrule=standalone -c opt --announce_rc --define=grpc_no_ares=true --define=PREFIX=/usr --define=LIBDIR=$(PREFIX)/lib --define=INCLUDEDIR=$(PREFIX)/include --config=v2
INFO: Reading rc options for 'info' from /media/ipouplana/Nuevo_vol/Project_Housing/tensorflow-2.0.0/.tf_configure.bazelrc:
Inherited 'build' options: --action_env PYTHON_BIN_PATH=/usr/bin/python3 --action_env PYTHON_LIB_PATH=/home/ipouplana/Kratos/ --python_path=/usr/bin/python3 --action_env PYTHONPATH=/home/ipouplana/Kratos/:/opt/COMPSs/Bindings/python/3/ --config=xla --action_env TF_CONFIGURE_IOS=0
INFO: Found applicable config definition build:v2 in file /media/ipouplana/Nuevo_vol/Project_Housing/tensorflow-2.0.0/.bazelrc: --define=tf_api_version=2
INFO: Found applicable config definition build:xla in file /media/ipouplana/Nuevo_vol/Project_Housing/tensorflow-2.0.0/.tf_configure.bazelrc: --define with_xla_support=true
/home/ipouplana/.cache/bazel/_bazel_ipouplana/e247190474a2073cbd54243f45564ce4/execroot/org_tensorflow/bazel-out/k8-opt/bin
I also tried to run the two lines that you wrote at the end of the message but when I run
$(bazel info bazel-bin)/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg
I obtained "syntactic error in the element _/tensorflow/tools/pip_package/build_pip_package_"
You do get the path in the output - it's in the last line, but it's not very visible on your terminal:
/home/ipouplana/.cache/bazel/_bazel_ipouplana/e247190474a2073cbd54243f45564ce4/execroot/org_tensorflow/bazel-out/k8-opt/bin
First of all, thanks for your attention. I obtain the following error, seems like bazel-bin has not been created
/home/ipouplana/.cache/bazel/_bazel_ipouplana/e247190474a2073cbd54243f45564ce4/execroot/org_tensorflow/bazel-out/k8-opt/bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg
mar nov 26 10:33:52 CET 2019 : === Preparing sources in dir: /tmp/tmp.NMJhNBK3A2
Could not find bazel-bin. Did you run from the root of the build tree?
I'm sorry - it seems like that TensorFlow script requires the bazel-bin symlink to be present :(
I have just two remaining ideas:
cd /home/ipouplana/.cache/bazel/_bazel_ipouplana/e247190474a2073cbd54243f45564ce4/execroot/org_tensorflow/bazel-out/k8-opt && ln -s bin bazel-bin && bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg. The idea is to create the bazel-bin symlink that the TensorFlow build_pip_package script expects to exist. I don't know if this will actually work.bazel build there.The hack does not actually work, I've moved the workspace to another filesystem and now I am building tensorflow. I will let you know if it works. Thanks for your attention and patience!!
Ok, finally I have built tensorflow in my computer, thanks for your attention and your patience.
Glad to hear that it worked out in the end :)
@jgonzalezusua What filesystem is your
/media/ipouplanausing? The error message suggests that it does not support symlinks. Bazel should not crash in that case and we can try to fix that (if it hasn't been fixed already in a later version), but in the meantime, you can try this workaround:bazel build --symlink_prefix=/when you run Bazel. This will tell Bazel to not create the symlink so it will hopefully work.
adding this symlink flag with bazel worked
bazel build --symlink_prefix=/