I downloaded and installed all of the prerequisites mentioned on the TensorFlow Build from source on Windows page, ran python configure.py, accepted all of the defaults, and ran bazel build //tensorflow/tools/pip_package:build_pip_package, as that page directed. Here is the result.
(venv) C:\Users\me\Documents\GitHub\tensorflow>python configure.py
You have bazel 5.0.0 installed.
Please specify the location of python. [Default is C:\Users\me\Documents\GitHub\tensorflow\venv\Scripts\python.exe]:
Found possible Python library paths:
C:\Users\me\Documents\GitHub\tensorflow\venv\lib\site-packages
Please input the desired Python library path to use. Default is [C:\Users\me\Documents\GitHub\tensorflow\venv\lib\site-packages]
Do you wish to build TensorFlow with ROCm support? [y/N]:
No ROCm support will be enabled for TensorFlow.
Do you wish to build TensorFlow with CUDA support? [y/N]:
No CUDA support will be enabled for TensorFlow.
Please specify optimization flags to use during compilation when bazel option "--config=opt" is specified [Default is /arch:AVX]:
Would you like to override eigen strong inline for some C++ compilation to reduce the compilation time? [Y/n]:
Eigen strong inline overridden.
Would you like to interactively configure ./WORKSPACE for Android builds? [y/N]:
Not configuring the WORKSPACE for Android builds.
Preconfigured Bazel build configs. You can use any of the below by adding "--config=<>" to your build command. See .bazelrc for more details.
--config=mkl # Build with MKL support.
--config=mkl_aarch64 # Build with oneDNN and Compute Library for the Arm Architecture (ACL).
--config=monolithic # Config for mostly static monolithic build.
--config=numa # Build with NUMA support.
--config=dynamic_kernels # (Experimental) Build kernels into separate shared objects.
--config=v1 # Build with TensorFlow 1 API instead of TF 2 API.
Preconfigured Bazel build configs to DISABLE default on features:
--config=nogcp # Disable GCP support.
--config=nonccl # Disable NVIDIA NCCL support.
(venv) C:\Users\me\Documents\GitHub\tensorflow>bazel build //tensorflow/tools/pip_package:build_pip_package
INFO: Options provided by the client:
Inherited 'common' options: --isatty=1 --terminal_columns=120
INFO: Reading rc options for 'build' from c:\users\me\documents\github\tensorflow\.bazelrc:
Inherited 'common' options: --experimental_repo_remote_exec
INFO: Options provided by the client:
'build' options: --python_path=C:/Users/me/Documents/GitHub/tensorflow/venv/Scripts/python.exe
INFO: Reading rc options for 'build' from c:\users\me\documents\github\tensorflow\.bazelrc:
'build' options: --define framework_shared_object=true --define=use_fast_cpp_protos=true --define=allow_oversize_protos=true --spawn_strategy=standalone -c opt --announce_rc --define=grpc_no_ares=true --noincompatible_remove_legacy_whole_archive --enable_platform_specific_config --define=with_xla_support=true --config=short_logs --config=v2 --define=no_aws_support=true --define=no_hdfs_support=true --experimental_cc_shared_library --experimental_link_static_libraries_once=false
INFO: Reading rc options for 'build' from c:\users\me\documents\github\tensorflow\.tf_configure.bazelrc:
'build' options: --action_env PYTHON_BIN_PATH=C:/Users/me/Documents/GitHub/tensorflow/venv/Scripts/python.exe --action_env PYTHON_LIB_PATH=C:/Users/me/Documents/GitHub/tensorflow/venv/lib/site-packages --python_path=C:/Users/me/Documents/GitHub/tensorflow/venv/Scripts/python.exe --copt=/d2ReducedOptimizeHugeFunctions --host_copt=/d2ReducedOptimizeHugeFunctions --define=override_eigen_strong_inline=true
INFO: Reading rc options for 'build' from c:\users\me\documents\github\tensorflow\.bazelrc:
'build' options: --deleted_packages=tensorflow/compiler/mlir/tfrt,tensorflow/compiler/mlir/tfrt/benchmarks,tensorflow/compiler/mlir/tfrt/jit/python_binding,tensorflow/compiler/mlir/tfrt/jit/transforms,tensorflow/compiler/mlir/tfrt/python_tests,tensorflow/compiler/mlir/tfrt/tests,tensorflow/compiler/mlir/tfrt/tests/ir,tensorflow/compiler/mlir/tfrt/tests/analysis,tensorflow/compiler/mlir/tfrt/tests/jit,tensorflow/compiler/mlir/tfrt/tests/lhlo_to_tfrt,tensorflow/compiler/mlir/tfrt/tests/lhlo_to_jitrt,tensorflow/compiler/mlir/tfrt/tests/tf_to_corert,tensorflow/compiler/mlir/tfrt/tests/tf_to_tfrt_data,tensorflow/compiler/mlir/tfrt/tests/saved_model,tensorflow/compiler/mlir/tfrt/transforms/lhlo_gpu_to_tfrt_gpu,tensorflow/core/runtime_fallback,tensorflow/core/runtime_fallback/conversion,tensorflow/core/runtime_fallback/kernel,tensorflow/core/runtime_fallback/opdefs,tensorflow/core/runtime_fallback/runtime,tensorflow/core/runtime_fallback/util,tensorflow/core/tfrt/common,tensorflow/core/tfrt/eager,tensorflow/core/tfrt/eager/backends/cpu,tensorflow/core/tfrt/eager/backends/gpu,tensorflow/core/tfrt/eager/core_runtime,tensorflow/core/tfrt/eager/cpp_tests/core_runtime,tensorflow/core/tfrt/gpu,tensorflow/core/tfrt/run_handler_thread_pool,tensorflow/core/tfrt/runtime,tensorflow/core/tfrt/saved_model,tensorflow/core/tfrt/graph_executor,tensorflow/core/tfrt/saved_model/tests,tensorflow/core/tfrt/tpu,tensorflow/core/tfrt/utils
INFO: Found applicable config definition build:short_logs in file c:\users\me\documents\github\tensorflow\.bazelrc: --output_filter=DONT_MATCH_ANYTHING
INFO: Found applicable config definition build:v2 in file c:\users\me\documents\github\tensorflow\.bazelrc: --define=tf_api_version=2 --action_env=TF2_BEHAVIOR=1
INFO: Found applicable config definition build:windows in file c:\users\me\documents\github\tensorflow\.bazelrc: --copt=/W0 --host_copt=/W0 --copt=/Zc:__cplusplus --host_copt=/Zc:__cplusplus --copt=/D_USE_MATH_DEFINES --host_copt=/D_USE_MATH_DEFINES --features=compiler_param_file --copt=/d2ReducedOptimizeHugeFunctions --host_copt=/d2ReducedOptimizeHugeFunctions --cxxopt=/std:c++17 --host_cxxopt=/std:c++17 --config=monolithic --copt=-DWIN32_LEAN_AND_MEAN --host_copt=-DWIN32_LEAN_AND_MEAN --copt=-DNOGDI --host_copt=-DNOGDI --copt=/experimental:preprocessor --host_copt=/experimental:preprocessor --linkopt=/DEBUG --host_linkopt=/DEBUG --linkopt=/OPT:REF --host_linkopt=/OPT:REF --linkopt=/OPT:ICF --host_linkopt=/OPT:ICF --verbose_failures --features=compiler_param_file --distinct_host_configuration=false
INFO: Found applicable config definition build:monolithic in file c:\users\me\documents\github\tensorflow\.bazelrc: --define framework_shared_object=false --experimental_link_static_libraries_once=false
WARNING: Download from https://storage.googleapis.com/mirror.tensorflow.org/github.com/tensorflow/runtime/archive/e1212041914020e9ff402c8c3c04e5e3c771d166.tar.gz failed: class java.io.FileNotFoundException GET returned 404 Not Found
WARNING: Download from https://storage.googleapis.com/mirror.tensorflow.org/github.com/llvm/llvm-project/archive/5ae0472694f5d53c0b889a48dc042961291d2341.tar.gz failed: class java.io.FileNotFoundException GET returned 404 Not Found
INFO: Build options --copt, --cxxopt, --features, and 2 more have changed, discarding analysis cache.
ERROR: C:/users/me/documents/github/tensorflow/tensorflow/BUILD:1034:21: //tensorflow:libtensorflow_framework.so.2.10.0: no such attribute 'shared_lib_name' in 'cc_shared_library' rule
ERROR: C:/users/me/documents/github/tensorflow/tensorflow/BUILD:1034:21: //tensorflow:libtensorflow_framework.so.2.10.0: no such attribute 'win_def_file' in 'cc_shared_library' rule
ERROR: C:/users/me/documents/github/tensorflow/tensorflow/BUILD:1034:21: //tensorflow:libtensorflow_framework.2.10.0.dylib: no such attribute 'shared_lib_name' in 'cc_shared_library' rule
ERROR: C:/users/me/documents/github/tensorflow/tensorflow/BUILD:1034:21: //tensorflow:libtensorflow_framework.2.10.0.dylib: no such attribute 'win_def_file' in 'cc_shared_library' rule
ERROR: C:/users/me/documents/github/tensorflow/tensorflow/BUILD:1034:21: //tensorflow:tensorflow_framework.dll: no such attribute 'shared_lib_name' in 'cc_shared_library' rule
ERROR: C:/users/me/documents/github/tensorflow/tensorflow/BUILD:1034:21: //tensorflow:tensorflow_framework.dll: no such attribute 'win_def_file' in 'cc_shared_library' rule
ERROR: C:/users/me/documents/github/tensorflow/tensorflow/BUILD:1156:21: //tensorflow:libtensorflow_cc.so.2.10.0: no such attribute 'shared_lib_name' in 'cc_shared_library' rule
ERROR: C:/users/me/documents/github/tensorflow/tensorflow/BUILD:1156:21: //tensorflow:libtensorflow_cc.so.2.10.0: no such attribute 'win_def_file' in 'cc_shared_library' rule
ERROR: C:/users/me/documents/github/tensorflow/tensorflow/BUILD:1156:21: //tensorflow:libtensorflow_cc.2.10.0.dylib: no such attribute 'shared_lib_name' in 'cc_shared_library' rule
ERROR: C:/users/me/documents/github/tensorflow/tensorflow/BUILD:1156:21: //tensorflow:libtensorflow_cc.2.10.0.dylib: no such attribute 'win_def_file' in 'cc_shared_library' rule
ERROR: C:/users/me/documents/github/tensorflow/tensorflow/BUILD:1156:21: //tensorflow:tensorflow_cc.dll: no such attribute 'shared_lib_name' in 'cc_shared_library' rule
ERROR: C:/users/me/documents/github/tensorflow/tensorflow/BUILD:1156:21: //tensorflow:tensorflow_cc.dll: no such attribute 'win_def_file' in 'cc_shared_library' rule
ERROR: C:/users/me/documents/github/tensorflow/tensorflow/tools/pip_package/BUILD:278:10: errors encountered resolving select() keys for //tensorflow/tools/pip_package:build_pip_package
ERROR: Analysis of target '//tensorflow/tools/pip_package:build_pip_package' failed; build aborted:
INFO: Elapsed time: 155.947s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (9 packages loaded, 12 targets configured)
I'm running these commands in a Visual Studio 2022 Developer Command Prompt in a Python 3.9.7 virtual environment. I tried both the master branch, shown here, and the v2.9.1 tag. They both have the same problems. I'm posting this problem here as directed on the TensorFlow Build and install error messages page.
Related
I am trying to generate compile commands for TensorFlow as described in this article. However, when I run ./create_compile_commands.sh //tensorflow/tools/pip_package:build_pip_package, I get the following error:
INFO: Options provided by the client:
Inherited 'common' options: --isatty=1 --terminal_columns=205
INFO: Reading rc options for 'build' from /media/nimashiri/DATA/vsprojects/ICSE23/ml_repos_cloned/tensorflow/.bazelrc:
'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 -c opt --announce_rc --define=grpc_no_ares=true --define=PREFIX=/usr --define=LIBDIR=$(PREFIX)/lib --define=INCLUDEDIR=$(PREFIX)/include --copt=-w --config=v2
INFO: Found applicable config definition build:v2 in file /media/nimashiri/DATA/vsprojects/ICSE23/ml_repos_cloned/tensorflow/.bazelrc: --define=tf_api_version=2 --action_env=TF2_BEHAVIOR=1
DEBUG: Rule 'io_bazel_rules_docker' indicated that a canonical reproducible form can be obtained by modifying arguments shallow_since = "1556410077 -0400"
DEBUG: Repository io_bazel_rules_docker instantiated at:
/media/nimashiri/DATA/vsprojects/ICSE23/ml_repos_cloned/tensorflow/WORKSPACE:35:30: in <toplevel>
/home/nimashiri/.cache/bazel/_bazel_nimashiri/95da0dbf75375842593bb476d831db34/external/bazel_toolchains/repositories/repositories.bzl:37:23: in repositories
Repository rule git_repository defined at:
/home/nimashiri/.cache/bazel/_bazel_nimashiri/95da0dbf75375842593bb476d831db34/external/bazel_tools/tools/build_defs/repo/git.bzl:199:33: in <toplevel>
ERROR: /home/nimashiri/.cache/bazel/_bazel_nimashiri/95da0dbf75375842593bb476d831db34/external/io_bazel_rules_docker/container/image.bzl:550:31: invalid escape sequence: \s. Use '\\' to insert '\'.
ERROR: /home/nimashiri/.cache/bazel/_bazel_nimashiri/95da0dbf75375842593bb476d831db34/external/io_bazel_rules_docker/container/image.bzl:550:40: invalid escape sequence: \c. Use '\\' to insert '\'.
INFO: Repository bazel_skylib instantiated at:
/media/nimashiri/DATA/vsprojects/ICSE23/ml_repos_cloned/tensorflow/WORKSPACE:23:21: in <toplevel>
/home/nimashiri/.cache/bazel/_bazel_nimashiri/95da0dbf75375842593bb476d831db34/external/io_bazel_rules_closure/closure/repositories.bzl:81:21: in closure_repositories
/home/nimashiri/.cache/bazel/_bazel_nimashiri/95da0dbf75375842593bb476d831db34/external/io_bazel_rules_closure/closure/repositories.bzl:203:17: in bazel_skylib
Repository rule http_archive defined at:
/home/nimashiri/.cache/bazel/_bazel_nimashiri/95da0dbf75375842593bb476d831db34/external/bazel_tools/tools/build_defs/repo/http.bzl:353:31: in <toplevel>
ERROR: error loading package '': at /media/nimashiri/DATA/vsprojects/ICSE23/ml_repos_cloned/tensorflow/third_party/toolchains/preconfig/generate/workspace.bzl:6:5: at /home/nimashiri/.cache/bazel/_bazel_nimashiri/95da0dbf75375842593bb476d831db34/external/io_bazel_rules_docker/container/container.bzl:18:6: compilation of module 'container/image.bzl' failed
INFO: Elapsed time: 2.102s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded)
Fetching https://github.com/bazelbuild/bazel-skylib/releases/download/0.8.0/bazel-skylib.0.8.0.tar.gz
Any idea how to resolve it?
I followed this tutorial for cross compilation of aarch64
https://www.tensorflow.org/lite/guide/build_arm
1- I cloned tensorflow repo
2- ran bazel build --config=elinux_aarch64 -c opt //tensorflow/lite:libtensorflowlite.so
logs
INFO: Options provided by the client:
Inherited 'common' options: --isatty=1 --terminal_columns=211
INFO: Reading rc options for 'build' from c:\users\mohamed_gamal\downloads\tensorflow_src.bazelrc:
Inherited 'common' options: --experimental_repo_remote_exec
INFO: Options provided by the client:
'build' options: --python_path=C:/Users/Mohamed_Gamal/AppData/Local/Microsoft/WindowsApps/python.exe
INFO: Reading rc options for 'build' from c:\users\mohamed_gamal\downloads\tensorflow_src.bazelrc:
'build' options: --define framework_shared_object=true --java_toolchain=//tensorflow/tools/toolchains/java:tf_java_toolchain --host_java_toolchain=//tensorflow/tools/toolchains/java:tf_java_toolchain --define=use_fast_cpp_protos=true --define=allow_oversize_protos=true --spawn_strategy=standalone -c opt --announce_rc --define=grpc_no_ares=true --noincompatible_remove_legacy_whole_archive --enable_platform_specific_config --define=with_xla_support=true --config=short_logs --config=v2 --define=no_aws_support=true --define=no_hdfs_support=true --experimental_cc_shared_library --deleted_packages=tensorflow/compiler/mlir/tfrt,tensorflow/compiler/mlir/tfrt/benchmarks,tensorflow/compiler/mlir/tfrt/jit/python_binding,tensorflow/compiler/mlir/tfrt/jit/transforms,tensorflow/compiler/mlir/tfrt/python_tests,tensorflow/compiler/mlir/tfrt/tests,tensorflow/compiler/mlir/tfrt/tests/analysis,tensorflow/compiler/mlir/tfrt/tests/jit,tensorflow/compiler/mlir/tfrt/tests/lhlo_to_tfrt,tensorflow/compiler/mlir/tfrt/tests/tf_to_corert,tensorflow/compiler/mlir/tfrt/tests/tf_to_tfrt_data,tensorflow/compiler/mlir/tfrt/tests/saved_model,tensorflow/compiler/mlir/tfrt/transforms/lhlo_gpu_to_tfrt_gpu,tensorflow/core/runtime_fallback,tensorflow/core/runtime_fallback/conversion,tensorflow/core/runtime_fallback/kernel,tensorflow/core/runtime_fallback/opdefs,tensorflow/core/runtime_fallback/runtime,tensorflow/core/runtime_fallback/util,tensorflow/core/tfrt/common,tensorflow/core/tfrt/eager,tensorflow/core/tfrt/eager/backends/cpu,tensorflow/core/tfrt/eager/backends/gpu,tensorflow/core/tfrt/eager/core_runtime,tensorflow/core/tfrt/eager/cpp_tests/core_runtime,tensorflow/core/tfrt/gpu,tensorflow/core/tfrt/run_handler_thread_pool,tensorflow/core/tfrt/runtime,tensorflow/core/tfrt/saved_model,tensorflow/core/tfrt/graph_executor,tensorflow/core/tfrt/saved_model/tests,tensorflow/core/tfrt/tpu,tensorflow/core/tfrt/utils
INFO: Found applicable config definition build:short_logs in file c:\users\mohamed_gamal\downloads\tensorflow_src.bazelrc: --output_filter=DONT_MATCH_ANYTHING
INFO: Found applicable config definition build:v2 in file c:\users\mohamed_gamal\downloads\tensorflow_src.bazelrc: --define=tf_api_version=2 --action_env=TF2_BEHAVIOR=1
INFO: Found applicable config definition build:elinux_aarch64 in file c:\users\mohamed_gamal\downloads\tensorflow_src.bazelrc: --config=elinux --cpu=aarch64 --distinct_host_configuration=true
INFO: Found applicable config definition build:elinux in file c:\users\mohamed_gamal\downloads\tensorflow_src.bazelrc: --crosstool_top=#local_config_embedded_arm//:toolchain --host_crosstool_top=#bazel_tools//tools/cpp:toolchain
INFO: Found applicable config definition build:windows in file c:\users\mohamed_gamal\downloads\tensorflow_src.bazelrc: --copt=/W0 --copt=/D_USE_MATH_DEFINES --host_copt=/D_USE_MATH_DEFINES --cxxopt=/std:c++14 --host_cxxopt=/std:c++14 --config=monolithic --copt=-DWIN32_LEAN_AND_MEAN --host_copt=-DWIN32_LEAN_AND_MEAN --copt=-DNOGDI --host_copt=-DNOGDI --copt=/experimental:preprocessor --host_copt=/experimental:preprocessor --linkopt=/DEBUG --host_linkopt=/DEBUG --linkopt=/OPT:REF --host_linkopt=/OPT:REF --linkopt=/OPT:ICF --host_linkopt=/OPT:ICF --verbose_failures --features=compiler_param_file --distinct_host_configuration=false
INFO: Found applicable config definition build:monolithic in file c:\users\mohamed_gamal\downloads\tensorflow_src.bazelrc: --define framework_shared_object=false
WARNING: Download from https://storage.googleapis.com/mirror.tensorflow.org/github.com/tensorflow/runtime/archive/9df1c45bd751eeff53f6811501e015c7eba4b536.tar.gz failed: class com.google.devtools.build.lib.bazel.repository.downloader.UnrecoverableHttpException GET returned 404 Not Found
WARNING: Download from https://mirror.bazel.build/github.com/bazelbuild/rules_cc/archive/081771d4a0e9d7d3aa0eed2ef389fa4700dfb23e.tar.gz failed: class com.google.devtools.build.lib.bazel.repository.downloader.UnrecoverableHttpException GET returned 404 Not Found
INFO: Repository local_config_embedded_arm instantiated at:
C:/users/mohamed_gamal/downloads/tensorflow_src/WORKSPACE:15:14: in
C:/users/mohamed_gamal/downloads/tensorflow_src/tensorflow/workspace2.bzl:868:19: in workspace
C:/users/mohamed_gamal/downloads/tensorflow_src/tensorflow/workspace2.bzl:118:34: in _tf_toolchains
Repository rule arm_linux_toolchain_configure defined at:
C:/users/mohamed_gamal/downloads/tensorflow_src/tensorflow/tools/toolchains/embedded/arm-linux/arm_linux_toolchain_configure.bzl:34:48: in
ERROR: An error occurred during the fetch of repository 'local_config_embedded_arm':
Traceback (most recent call last):
File "C:/users/mohamed_gamal/downloads/tensorflow_src/tensorflow/tools/toolchains/embedded/arm-linux/arm_linux_toolchain_configure.bzl", line 23, column 9, in _arm_linux_toolchain_configure_impl
_tpl(repository_ctx, "cc_config.bzl", {
File "C:/users/mohamed_gamal/downloads/tensorflow_src/tensorflow/tools/toolchains/embedded/arm-linux/arm_linux_toolchain_configure.bzl", line 6, column 28, in _tpl
repository_ctx.template(
Error in template: Unable to load package for //tensorflow/tools/toolchains/embedded/arm-linux:cc_config.bzl.tpl: BUILD file not found in any of the following directories. Add a BUILD file to a directory to mark it as a package.
C:/users/mohamed_gamal/downloads/tensorflow_src/tensorflow/tools/toolchains/embedded/arm-linux
DEBUG: Rule 'io_bazel_rules_docker' indicated that a canonical reproducible form can be obtained by modifying arguments shallow_since = "1596824487 -0400"
DEBUG: Repository io_bazel_rules_docker instantiated at:
C:/users/mohamed_gamal/downloads/tensorflow_src/WORKSPACE:23:14: in
C:/users/mohamed_gamal/downloads/tensorflow_src/tensorflow/workspace0.bzl:110:34: in workspace
C:/users/mohamed_gamal/_bazel_mohamed_gamal/wmmhak3q/external/bazel_toolchains/repositories/repositories.bzl:35:23: in repositories
Repository rule git_repository defined at:
C:/users/mohamed_gamal/_bazel_mohamed_gamal/wmmhak3q/external/bazel_tools/tools/build_defs/repo/git.bzl:199:33: in
ERROR: C:/users/mohamed_gamal/downloads/tensorflow_src/tensorflow/lite/BUILD:1158:24: //tensorflow/lite:libtensorflowlite.so depends on #local_config_embedded_arm//:toolchain in repository #local_config_embedded_arm which failed to fetch. no such package '#local_config_embedded_arm//': Unable to load package for //tensorflow/tools/toolchains/embedded/arm-linux:cc_config.bzl.tpl: BUILD file not found in any of the following directories. Add a BUILD file to a directory to mark it as a package.
C:/users/mohamed_gamal/downloads/tensorflow_src/tensorflow/tools/toolchains/embedded/arm-linux
ERROR: Analysis of target '//tensorflow/lite:libtensorflowlite.so' failed; build aborted: Analysis failed
INFO: Elapsed time: 0.724s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded, 0 targets configured)
I'm new to TF and want to do a compile from source as my desktop does not have a CPU or GPU that supports AVX instructions. My system has an Intel i7 930 processor (Bloomfield from the nehalem family) and a Nvidea GTS-250 CPU. Yeah I know, both are getting long in the teeth.
The following is the full stack where I am failing in the process. I am following instructions from the following webpage.
https://www.tensorflow.org/install/source_windows
I pushed forward with the compile and ended up seeing the following errors...
H:\Python\TensorFlowCompile\tensorflow>python ./configure.py
WARNING: --batch mode is deprecated. Please instead explicitly shut down your Bazel server using the command "bazel shutdown".
You have bazel 0.29.1 installed.
Please specify the location of python. [Default is C:\Users\Zeek\AppData\Local\Programs\Python\Python37\python.exe]:
Found possible Python library paths:
C:\Users\Zeek\AppData\Local\Programs\Python\Python37\lib\site-packages
Please input the desired Python library path to use. Default is [C:\Users\Zeek\AppData\Local\Programs\Python\Python37\lib\site-packages]
Do you wish to build TensorFlow with XLA JIT support? [y/N]: N
No XLA JIT support will be enabled for TensorFlow.
Do you wish to build TensorFlow with ROCm support? [y/N]: N
No ROCm support will be enabled for TensorFlow.
Do you wish to build TensorFlow with CUDA support? [y/N]: N
No CUDA support will be enabled for TensorFlow.
Please specify optimization flags to use during compilation when bazel option "--config=opt" is specified [Default is /arch:AVX]: --config=v2 -march=nehalem
Would you like to override eigen strong inline for some C++ compilation to reduce the compilation time? [Y/n]: Y
Eigen strong inline overridden.
Preconfigured Bazel build configs. You can use any of the below by adding "--config=<>" to your build command. See .bazelrc for more details.
--config=mkl # Build with MKL support.
--config=monolithic # Config for mostly static monolithic build.
--config=ngraph # Build with Intel nGraph support.
--config=numa # Build with NUMA support.
--config=dynamic_kernels # (Experimental) Build kernels into separate shared objects.
--config=v2 # Build TensorFlow 2.x instead of 1.x.
Preconfigured Bazel build configs to DISABLE default on features:
--config=noaws # Disable AWS S3 filesystem support.
--config=nogcp # Disable GCP support.
--config=nohdfs # Disable HDFS support.
--config=nonccl # Disable NVIDIA NCCL support.
H:\Python\TensorFlowCompile\tensorflow>bazel build //tensorflow/tools/pip_package:build_pip_package
Starting local Bazel server and connecting to it...
INFO: Options provided by the client:
Inherited 'common' options: --isatty=0 --terminal_columns=269
INFO: Options provided by the client:
'build' options: --python_path=C:/Users/Zeek/AppData/Local/Programs/Python/Python37/python.exe
INFO: Reading rc options for 'build' from h:\python\tensorflowcompile\tensorflow\.bazelrc:
'build' options: --apple_platform_type=macos --define framework_shared_object=true --define open_source_build=true --java_toolchain=//third_party/toolchains/java:tf_java_toolchain --host_java_toolchain=//third_party/toolchains/java:tf_java_toolchain --define=use_fast_cpp_protos=true --define=allow_oversize_protos=true --spawn_strategy=standalone --strategy=Genrule=standalone -c opt --cxxopt=-std=c++14 --host_cxxopt=-std=c++14 --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 'build' from h:\python\tensorflowcompile\tensorflow\.tf_configure.bazelrc:
'build' options: --action_env PYTHON_BIN_PATH=C:/Users/Zeek/AppData/Local/Programs/Python/Python37/python.exe --action_env PYTHON_LIB_PATH=C:/Users/Zeek/AppData/Local/Programs/Python/Python37/lib/site-packages --python_path=C:/Users/Zeek/AppData/Local/Programs/Python/Python37/python.exe --config monolithic --copt=-w --host_copt=-w --copt=-DWIN32_LEAN_AND_MEAN --host_copt=-DWIN32_LEAN_AND_MEAN --copt=-DNOGDI --host_copt=-DNOGDI --verbose_failures --distinct_host_configuration=false --define=override_eigen_strong_inline=true --action_env TF_CONFIGURE_IOS=0
INFO: Found applicable config definition build:v2 in file h:\python\tensorflowcompile\tensorflow\.bazelrc: --define=tf_api_version=2
INFO: Found applicable config definition build:monolithic in file h:\python\tensorflowcompile\tensorflow\.bazelrc: --define framework_shared_object=false
INFO: Found applicable config definition build:monolithic in file h:\python\tensorflowcompile\tensorflow\.bazelrc: --define framework_shared_object=false
Loading:
Loading: 0 packages loaded
Loading: 0 packages loaded
Analyzing: target //tensorflow/tools/pip_package:build_pip_package (1 packages loaded, 0 targets configured)
Analyzing: target //tensorflow/tools/pip_package:build_pip_package (6 packages loaded, 18 targets configured)
Analyzing: target //tensorflow/tools/pip_package:build_pip_package (6 packages loaded, 18 targets configured)
Analyzing: target //tensorflow/tools/pip_package:build_pip_package (6 packages loaded, 18 targets configured)
INFO: Call stack for the definition of repository 'com_google_protobuf' which is a tf_http_archive (rule definition at H:/python/tensorflowcompile/tensorflow/third_party/repo.bzl:121:19):
- H:/python/tensorflowcompile/tensorflow/tensorflow/workspace.bzl:434:5
- H:/python/tensorflowcompile/tensorflow/WORKSPACE:19:1
Analyzing: target //tensorflow/tools/pip_package:build_pip_package (6 packages loaded, 18 targets configured)
INFO: Repository 'com_google_protobuf' used the following cache hits instead of downloading the corresponding file.
* Hash 'b9e92f9af8819bbbc514e2902aec860415b70209f31dfc8c4fa72515a5df9d59' for https://storage.googleapis.com/mirror.tensorflow.org/github.com/protocolbuffers/protobuf/archive/310ba5ee72661c081129eb878c1bbcec936b20f0.tar.gz
If the definition of 'com_google_protobuf' was updated, verify that the hashes were also updated.
ERROR: An error occurred during the fetch of repository 'com_google_protobuf':
Traceback (most recent call last):
File "H:/python/tensorflowcompile/tensorflow/third_party/repo.bzl", line 101
_apply_patch(ctx, ctx.attr.patch_file)
File "H:/python/tensorflowcompile/tensorflow/third_party/repo.bzl", line 68, in _apply_patch
_execute_and_check_ret_code(ctx, cmd)
File "H:/python/tensorflowcompile/tensorflow/third_party/repo.bzl", line 52, in _execute_and_check_ret_code
fail("Non-zero return code({1}) when ...))
Non-zero return code(127) when executing 'C:\msys64\usr\bin\bash.exe -l -c "patch" "-p1" "-d" "C:/users/Zeek/_bazel_Zeek/hfhzrtpt/external/com_google_protobuf" "-i" "H:/python/tensorflowcompile/tensorflow/third_party/protobuf/protobuf.patch"':
Stdout:
Stderr: /usr/bin/bash: patch: command not found
ERROR: Analysis of target '//tensorflow/tools/pip_package:build_pip_package' failed; build aborted: no such package '#com_google_protobuf//': Traceback (most recent call last):
File "H:/python/tensorflowcompile/tensorflow/third_party/repo.bzl", line 101
_apply_patch(ctx, ctx.attr.patch_file)
File "H:/python/tensorflowcompile/tensorflow/third_party/repo.bzl", line 68, in _apply_patch
_execute_and_check_ret_code(ctx, cmd)
File "H:/python/tensorflowcompile/tensorflow/third_party/repo.bzl", line 52, in _execute_and_check_ret_code
fail("Non-zero return code({1}) when ...))
Non-zero return code(127) when executing 'C:\msys64\usr\bin\bash.exe -l -c "patch" "-p1" "-d" "C:/users/Zeek/_bazel_Zeek/hfhzrtpt/external/com_google_protobuf" "-i" "H:/python/tensorflowcompile/tensorflow/third_party/protobuf/protobuf.patch"':
Stdout:
Stderr: /usr/bin/bash: patch: command not found
INFO: Elapsed time: 19.298s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (6 packages loaded, 18 targets configured)
FAILED: Build did NOT complete successfully (6 packages loaded, 18 targets configured)
I ran with a newer version of bazel prior to this compile and I was presented with the following error so that is why I reverted back to 0.29.1
H:\Python\TensorFlowCompile\tensorflow>python ./configure.py
Extracting Bazel installation...
WARNING: --batch mode is deprecated. Please instead explicitly shut down your Bazel server using the command "bazel shutdown".
You have bazel 1.0.1 installed.
Please downgrade your bazel installation to version 0.29.1 or lower to build TensorFlow! To downgrade: download the installer for the old version (from https://github.com/bazelbuild/bazel/releases) then run the installer.
Any thoughts on where I am going wrong, I am still pretty new at this so it's probably something pretty glaring/easy....
[Edit] this seemed to be resolved by setting up patch s it wasn't installed:
pacman -Syuu patch
**I pushed a bit farther and now I'm failing at the zip stage as follows.. **
INFO: Analyzed target //tensorflow/tools/pip_package:build_pip_package (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
[0 / 23] [Prepa] PythonZipper tensorflow/python/keras/api/create_tensorflow.python_api_1_keras_python_api_gen_compat_v1.zip ... (3 actions, 0 running)
ERROR: H:/python/tensorflowcompile/tensorflow/tensorflow/lite/python/BUILD:46:1: PythonZipper tensorflow/lite/python/tflite_convert.zip failed (Exit 255)
FATAL: MappedOutputFile(bazel-out/x64_windows-opt/bin/tensorflow/lite/python/tflite_convert.zip): CreateFileMapping failed
Target //tensorflow/tools/pip_package:build_pip_package failed to build
INFO: Elapsed time: 38.195s, Critical Path: 4.35s
INFO: 0 processes.
FAILED: Build did NOT complete successfully
FAILED: Build did NOT complete successfully
**I then tried to go back to the python config stage to make sure that I picked v2 and the proper family of CPU but when I redo the compile I see ANOTHER error where it is failing much sooner.. **
java.lang.RuntimeException: Unrecoverable error while evaluating node 'REPOSITORY_DIRECTORY:#local_config_cc' (requested by nodes 'REPOSITORY:#local_config_cc')
at com.google.devtools.build.skyframe.AbstractParallelEvaluator$Evaluate.run(AbstractParallelEvaluator.java:528)
at com.google.devtools.build.lib.concurrent.AbstractQueueVisitor$WrappedRunnable.run(AbstractQueueVisitor.java:399)
at java.base/java.util.concurrent.ForkJoinTask$AdaptedRunnableAction.exec(Unknown Source)
at java.base/java.util.concurrent.ForkJoinTask.doExec(Unknown Source)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(Unknown Source)
at java.base/java.util.concurrent.ForkJoinPool.scan(Unknown Source)
at java.base/java.util.concurrent.ForkJoinPool.runWorker(Unknown Source)
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(Unknown Source)
Caused by: java.nio.file.InvalidPathException: Illegal char <> at index 60: C:/users/bill/_bazel_bill/hfhzrtpt/external/local_config_cc/*********************************************************************
** Visual Studio 2017 Developer Command Prompt v15.0
** Copyright (c) 2017 Microsoft Corporation
C:/Program Files (x86)/Microsoft Visual Studio/2017/BuildTools/VC/Auxiliary/Build/VCVARSALL.BAT
at java.base/sun.nio.fs.WindowsPathParser.normalize(Unknown Source)
at java.base/sun.nio.fs.WindowsPathParser.parse(Unknown Source)
at java.base/sun.nio.fs.WindowsPathParser.parse(Unknown Source)
at java.base/sun.nio.fs.WindowsPath.parse(Unknown Source)
at java.base/sun.nio.fs.WindowsFileSystem.getPath(Unknown Source)
at java.base/java.nio.file.Path.of(Unknown Source)
at java.base/java.nio.file.Paths.get(Unknown Source)
at com.google.devtools.build.lib.vfs.JavaIoFileSystem.getNioPath(JavaIoFileSystem.java:84)
at com.google.devtools.build.lib.vfs.JavaIoFileSystem.exists(JavaIoFileSystem.java:119)
at com.google.devtools.build.lib.vfs.Path.exists(Path.java:356)
at com.google.devtools.build.lib.bazel.repository.skylark.SkylarkPath.exists(SkylarkPath.java:79)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at com.google.devtools.build.lib.syntax.MethodDescriptor.call(MethodDescriptor.java:135)
at com.google.devtools.build.lib.syntax.DotExpression.eval(DotExpression.java:126)
at com.google.devtools.build.lib.syntax.DotExpression.doEval(DotExpression.java:51)
at com.google.devtools.build.lib.syntax.Expression.eval(Expression.java:75)
at com.google.devtools.build.lib.syntax.UnaryOperatorExpression.doEval(UnaryOperatorExpression.java:98)
at com.google.devtools.build.lib.syntax.Expression.eval(Expression.java:75)
at com.google.devtools.build.lib.syntax.Eval.execIf(Eval.java:139)
at com.google.devtools.build.lib.syntax.Eval.execDispatch(Eval.java:214)
at com.google.devtools.build.lib.syntax.Eval.exec(Eval.java:183)
at com.google.devtools.build.lib.syntax.UserDefinedFunction.call(UserDefinedFunction.java:91)
at com.google.devtools.build.lib.syntax.BaseFunction.callWithArgArray(BaseFunction.java:474)
at com.google.devtools.build.lib.syntax.BaseFunction.call(BaseFunction.java:436)
at com.google.devtools.build.lib.syntax.FuncallExpression.callFunction(FuncallExpression.java:992)
at com.google.devtools.build.lib.syntax.FuncallExpression.doEval(FuncallExpression.java:904)
at com.google.devtools.build.lib.syntax.Expression.eval(Expression.java:75)
at com.google.devtools.build.lib.syntax.UnaryOperatorExpression.doEval(UnaryOperatorExpression.java:98)
at com.google.devtools.build.lib.syntax.Expression.eval(Expression.java:75)
at com.google.devtools.build.lib.syntax.Eval.execIf(Eval.java:139)
at com.google.devtools.build.lib.syntax.Eval.execDispatch(Eval.java:214)
at com.google.devtools.build.lib.syntax.Eval.exec(Eval.java:183)
at com.google.devtools.build.lib.syntax.UserDefinedFunction.call(UserDefinedFunction.java:91)
at com.google.devtools.build.lib.syntax.BaseFunction.callWithArgArray(BaseFunction.java:474)
at com.google.devtools.build.lib.syntax.BaseFunction.call(BaseFunction.java:436)
at com.google.devtools.build.lib.syntax.FuncallExpression.callFunction(FuncallExpression.java:992)
at com.google.devtools.build.lib.syntax.FuncallExpression.doEval(FuncallExpression.java:904)
at com.google.devtools.build.lib.syntax.Expression.eval(Expression.java:75)
at com.google.devtools.build.lib.syntax.Eval.execAssignment(Eval.java:72)
at com.google.devtools.build.lib.syntax.Eval.execDispatch(Eval.java:192)
at com.google.devtools.build.lib.syntax.Eval.exec(Eval.java:183)
at com.google.devtools.build.lib.syntax.Eval.execStatements(Eval.java:231)
at com.google.devtools.build.lib.syntax.Eval.execIf(Eval.java:144)
at com.google.devtools.build.lib.syntax.Eval.execDispatch(Eval.java:214)
at com.google.devtools.build.lib.syntax.Eval.exec(Eval.java:183)
at com.google.devtools.build.lib.syntax.UserDefinedFunction.call(UserDefinedFunction.java:91)
at com.google.devtools.build.lib.syntax.BaseFunction.callWithArgArray(BaseFunction.java:474)
at com.google.devtools.build.lib.syntax.BaseFunction.call(BaseFunction.java:436)
at com.google.devtools.build.lib.syntax.FuncallExpression.callFunction(FuncallExpression.java:992)
at com.google.devtools.build.lib.syntax.FuncallExpression.doEval(FuncallExpression.java:904)
at com.google.devtools.build.lib.syntax.Expression.eval(Expression.java:75)
at com.google.devtools.build.lib.syntax.Eval.execAssignment(Eval.java:72)
at com.google.devtools.build.lib.syntax.Eval.execDispatch(Eval.java:192)
at com.google.devtools.build.lib.syntax.Eval.exec(Eval.java:183)
at com.google.devtools.build.lib.syntax.UserDefinedFunction.call(UserDefinedFunction.java:91)
at com.google.devtools.build.lib.syntax.BaseFunction.callWithArgArray(BaseFunction.java:474)
at com.google.devtools.build.lib.syntax.BaseFunction.call(BaseFunction.java:436)
at com.google.devtools.build.lib.syntax.FuncallExpression.callFunction(FuncallExpression.java:992)
at com.google.devtools.build.lib.syntax.FuncallExpression.doEval(FuncallExpression.java:904)
at com.google.devtools.build.lib.syntax.Expression.eval(Expression.java:75)
at com.google.devtools.build.lib.syntax.Eval.execDispatch(Eval.java:201)
at com.google.devtools.build.lib.syntax.Eval.exec(Eval.java:183)
at com.google.devtools.build.lib.syntax.Eval.execStatements(Eval.java:231)
at com.google.devtools.build.lib.syntax.Eval.execIfBranch(Eval.java:83)
at com.google.devtools.build.lib.syntax.Eval.execDispatch(Eval.java:198)
at com.google.devtools.build.lib.syntax.Eval.exec(Eval.java:183)
at com.google.devtools.build.lib.syntax.Eval.execIf(Eval.java:140)
at com.google.devtools.build.lib.syntax.Eval.execDispatch(Eval.java:214)
at com.google.devtools.build.lib.syntax.Eval.exec(Eval.java:183)
at com.google.devtools.build.lib.syntax.UserDefinedFunction.call(UserDefinedFunction.java:91)
at com.google.devtools.build.lib.syntax.BaseFunction.callWithArgArray(BaseFunction.java:474)
at com.google.devtools.build.lib.syntax.BaseFunction.call(BaseFunction.java:436)
at com.google.devtools.build.lib.bazel.repository.skylark.SkylarkRepositoryFunction.fetch(SkylarkRepositoryFunction.java:173)
at com.google.devtools.build.lib.rules.repository.RepositoryDelegatorFunction.fetchRepository(RepositoryDelegatorFunction.java:298)
at com.google.devtools.build.lib.rules.repository.RepositoryDelegatorFunction.compute(RepositoryDelegatorFunction.java:225)
at com.google.devtools.build.skyframe.AbstractParallelEvaluator$Evaluate.run(AbstractParallelEvaluator.java:451)
... 7 more
FAILED: Build did NOT complete successfully (231 packages loaded, 3779 targets configured)
WARNING: Waiting for server process to terminate (waited 5 seconds, waiting at most 60)
H:\Python\TensorFlowCompile\tensorflow>
Sorry folks I'm not sure where or how I show approach this one at this time... Is there a way to start the compile fresh, was there something that I missed that failed the pythonzip stage, was there a problem in my bezal config to start with....
TensorFlow doesn't yet support Bazel 1.x (it's coming, but not yet done), so yes you'll need 0.29.1 until then.
Set the environment variable to point to your VC directory, see "Installing and Using Bazel" > "Installing on Windows" > "Troubleshooting" > "Problem: Bazel does not find Visual Studio or Visual C++".
Start a normal cmd.exe shell, no need to run the Visual Studio command line.
Install Python modules required by TensorFlow: python -m pip install numpy keras_preprocessing
Configure TensorFlow: python configure.py
Build the pip module: bazel build --config=opt //tensorflow/tools/pip_package:build_pip_package
Many thanks for the responses all. I was able to get TF working as listed above. I've sense upgraded the CPU and GPUs too!
I'm trying to build //tensorflow/python/tools:print_selective_registration_header and get following output:
$ bazel build --copt="-DUSE_GEMM_FOR_CONV" tensorflow/python/tools:print_selective_registration_header
...
INFO: Analyzed target //tensorflow/python/tools:print_selective_registration_header (377 packages loaded, 24256 targets configured).
INFO: Found 1 target...
INFO: Deleting stale sandbox base /private/var/tmp/_bazel_glebdavydov/01d4cf1f69cd2606674d307a7a455e95/sandbox
ERROR: /Users/glebdavydov/Downloads/tensorflow-master/tensorflow/c/BUILD:372:1: undeclared inclusion(s) in rule '//tensorflow/c:ops':
this rule is missing dependency declarations for the following files included by 'tensorflow/c/ops.cc':
'tensorflow/contrib/makefile/downloads/absl/absl/strings/string_view.h'
'tensorflow/contrib/makefile/downloads/absl/absl/types/optional.h'
Target //tensorflow/python/tools:print_selective_registration_header failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 54.737s, Critical Path: 13.10s
INFO: 4 processes: 4 local.
FAILED: Build did NOT complete successfully
How can I fix this?
I fixed that issue by installing version of bazel corresponding to this build configurations.
My Env:
Ubuntu 1604
Python 3.5.2
bazel 0.9.0
JDK 1.8.0_152
My problem:
I have ran the command ./configure before built the tensorflow source code. But I till get following error:
no such target '#local_config_git//:gen/spec.json': target 'gen/spec.json' not declared in package ......
Please specify optimization flags to use during compilation when bazel option "--config=opt" is specified [Default is -march=native]:
Add "--config=mkl" to your bazel command to build with MKL support.
Please note that MKL on MacOS or windows is still not supported.
If you would like to use a local MKL instead of downloading, please set the environment variable "TF_MKL_ROOT" every time before build.
Would you like to interactively configure ./WORKSPACE for Android builds? [y/N]: n
Not configuring the WORKSPACE for Android builds.
Configuration finished
root#ubuntu:/tensorflow# bazel build --config=opt //tensorflow/tools/pip_package:build_pip_package
......................................
ERROR: /tensorflow/tensorflow/core/BUILD:1653:1: no such target '#local_config_git//:gen/spec.json': target 'gen/spec.json' not declared in package '' defined by /root/.cache/bazel/_bazel_root/68a62076e91007a7908bc42a32e4cff9/external/local_config_git/BUILD and referenced by '//tensorflow/core:version_info_gen'
ERROR: /tensorflow/tensorflow/core/BUILD:1653:1: no such target '#local_config_git//:gen/head': target 'gen/head' not declared in package '' defined by /root/.cache/bazel/_bazel_root/68a62076e91007a7908bc42a32e4cff9/external/local_config_git/BUILD and referenced by '//tensorflow/core:version_info_gen'
ERROR: /tensorflow/tensorflow/core/BUILD:1653:1: no such target '#local_config_git//:gen/branch_ref': target 'gen/branch_ref' not declared in package '' defined by /root/.cache/bazel/_bazel_root/68a62076e91007a7908bc42a32e4cff9/external/local_config_git/BUILD and referenced by '//tensorflow/core:version_info_gen'
ERROR: Analysis of target '//tensorflow/tools/pip_package:build_pip_package' failed; build aborted: Loading failed
INFO: Elapsed time: 29.514s
FAILED: Build did NOT complete successfully (113 packages loaded)
currently loading: tensorflow/core/kernels
root#ubuntu:/tensorflow#
ERROR information