microsoft / vcpkg

C++ Library Manager for Windows, Linux, and MacOS
MIT License
22.18k stars 6.16k forks source link

[TensorFlow] build failure #37291

Open DougRogers opened 3 months ago

DougRogers commented 3 months ago

Operating system

Windows x64

Compiler

Visual Studio 2022

Steps to reproduce the behavior

vcpkg install tensorflow

Failure logs

Error building -- Configuring TensorFlow (dbg) CMake Error at scripts/cmake/vcpkg_execute_required_process.cmake:112 (message): Command failed: C:/vcpkg/downloads/tools/msys2/70baefe917a26e68/mingw64/bin/python3.exe C:/vcpkg/buildtrees/tensorflow/x64-windows-dbg/configure.py --workspace C:/vcpkg/buildtrees/tensorflow/x64-windows-dbg Working Directory: C:/vcpkg/buildtrees/tensorflow/x64-windows-dbg Error code: 1 See logs for more information: C:\vcpkg\buildtrees\tensorflow\config-x64-windows-dbg-out.log

Call Stack (most recent call first): installed/x64-windows/share/tensorflow-common/tensorflow-common.cmake:187 (vcpkg_execute_required_process) ports/tensorflow/portfile.cmake:5 (include) scripts/ports.cmake:175 (include) error: building tensorflow:x64-windows failed with: BUILD_FAILED

Additional context

Contents of C:\vcpkg\buildtrees\tensorflow\config-x64-windows-dbg-out.log Cannot find bazel. Please install bazel/bazelisk.

There is no port for bazel.

DougRogers commented 3 months ago

I renamed bazel to bazel.exe in the .installed\x64-windows\tools directory and get this error in the debug file

You have bazel 5.2.0 installed.
Would you like to override eigen strong inline for some C++ compilation to reduce the compilation time? [Y/n]: 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=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.
DougRogers commented 3 months ago

Is set the environment variable for bazel (BAZEL_VC) to "C:\Program Files\Microsoft Visual Studio\2022\Community\VC" and now get

Starting local Bazel server and connecting to it...
ERROR: Expected value after --jobs
/usr/bin/bash: line 1: 17: command not found
/usr/bin/bash: line 1: --compilation_mode=dbg: command not found
dg0yt commented 3 months ago

The tensorflow port is far from working for windows. Related: https://github.com/microsoft/vcpkg/pull/31704

DougRogers commented 3 months ago

This fix was not added to TensorFlow. https://github.com/microsoft/vcpkg/pull/31704

I am getting farther in the build


Starting local Bazel server and connecting to it...
INFO: Options provided by the client:
  Inherited 'common' options: --isatty=0 --terminal_columns=80
INFO: Reading rc options for 'build' from c:\vcpkg\buildtrees\tensorflow\x64-windows-dbg\.bazelrc:
  Inherited 'common' options: --experimental_repo_remote_exec
INFO: Options provided by the client:
  'build' options: --python_path=C:/vcpkg/downloads/tools/msys2/70baefe917a26e68/mingw64/bin/python.exe
INFO: Reading rc options for 'build' from c:\vcpkg\buildtrees\tensorflow\x64-windows-dbg\.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:\vcpkg\buildtrees\tensorflow\x64-windows-dbg\.tf_configure.bazelrc:
  'build' options: --action_env PYTHON_BIN_PATH=C:/vcpkg/downloads/tools/msys2/70baefe917a26e68/mingw64/bin/python3.exe --action_env PYTHON_LIB_PATH=C:/vcpkg/downloads/tools/msys2/70baefe917a26e68/mingw64/lib/python3.11/site-packages --python_path=C:/vcpkg/downloads/tools/msys2/70baefe917a26e68/mingw64/bin/python3.exe --define=with_xla_support=false --copt=/d2ReducedOptimizeHugeFunctions --host_copt=/d2ReducedOptimizeHugeFunctions --define=override_eigen_strong_inline=true
INFO: Reading rc options for 'build' from c:\vcpkg\buildtrees\tensorflow\x64-windows-dbg\.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:\vcpkg\buildtrees\tensorflow\x64-windows-dbg\.bazelrc: --output_filter=DONT_MATCH_ANYTHING
INFO: Found applicable config definition build:v2 in file c:\vcpkg\buildtrees\tensorflow\x64-windows-dbg\.bazelrc: --define=tf_api_version=2 --action_env=TF2_BEHAVIOR=1
INFO: Found applicable config definition build:windows in file c:\vcpkg\buildtrees\tensorflow\x64-windows-dbg\.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:\vcpkg\buildtrees\tensorflow\x64-windows-dbg\.bazelrc: --define framework_shared_object=false --experimental_link_static_libraries_once=false
WARNING: Usage: bazel build <options> <targets>.
Invoke `bazel help build` for full description of usage and options.
Your request is correct, but requested an empty set of targets. Nothing will be built.
Loading: 
Loading: 0 packages loaded
Analyzing: 0 targets (0 packages loaded)
Analyzing: 0 targets (0 packages loaded, 0 targets configured)
INFO: Analyzed 0 targets (0 packages loaded, 0 targets configured).
INFO: Found 0 targets...
[0 / 1] [Prepa] BazelWorkspaceStatusAction stable-status.txt
INFO: Elapsed time: 2.788s, Critical Path: 0.03s
INFO: 1 process: 1 internal.
INFO: Build completed successfully, 1 total action
INFO: Build completed successfully, 1 total action
/usr/bin/bash: line 1: --compilation_mode=dbg: command not found