microsoft / vcpkg

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

[tensorflow] Build error on x64-windows #37873

Open circle-jin opened 5 months ago

circle-jin commented 5 months ago

Operating system

x64-windows

Compiler

MSVC

Steps to reproduce the behavior

vcpkg install tensorflow

Failure logs

PS C:\Users\foop7> vcpkg install tensorflow Computing installation plan... The following packages will be built and installed: tensorflow:x64-windows@2.10.0 Detecting compiler hash for triplet x64-windows... Compiler found: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.39.33519/bin/Hostx64/x64/cl.exe Restored 0 package(s) from C:\Users\foop7\AppData\Local\vcpkg\archives in 144 us. Use --debug to see more details. Installing 1/1 tensorflow:x64-windows@2.10.0... Building tensorflow:x64-windows@2.10.0... -- Using cached msys2-bash-5.2.026-1-x86_64.pkg.tar.zst. -- Using cached msys2-unzip-6.0-3-x86_64.pkg.tar.zst. -- Using cached msys2-patch-2.7.6-2-x86_64.pkg.tar.zst. -- Using cached msys2-diffutils-3.10-1-x86_64.pkg.tar.zst. -- Using cached msys2-libintl-0.22.4-1-x86_64.pkg.tar.zst. -- Using cached msys2-gzip-1.13-1-x86_64.pkg.tar.zst. -- Using cached msys2-coreutils-8.32-5-x86_64.pkg.tar.zst. -- Using cached msys2-mingw-w64-x86_64-python-numpy-1.26.3-1-any.pkg.tar.zst. -- Using cached msys2-file-5.45-1-x86_64.pkg.tar.zst. -- Using cached msys2-gawk-5.3.0-1-x86_64.pkg.tar.zst. -- Using cached msys2-grep-1~3.0-6-x86_64.pkg.tar.zst. -- Using cached msys2-make-4.4.1-1-x86_64.pkg.tar.zst. -- Using cached msys2-pkgconf-2.1.0-1-x86_64.pkg.tar.zst. -- Using cached msys2-sed-4.9-1-x86_64.pkg.tar.zst. -- Using cached msys2-msys2-runtime-3.4.10-4-x86_64.pkg.tar.zst. -- Using cached msys2-libbz2-1.0.8-4-x86_64.pkg.tar.zst. -- Using cached msys2-libiconv-1.17-1-x86_64.pkg.tar.zst. -- Using cached msys2-gcc-libs-13.2.0-2-x86_64.pkg.tar.zst. -- Using cached msys2-gmp-6.3.0-1-x86_64.pkg.tar.zst. -- Using cached msys2-mingw-w64-x86_64-openblas-0.3.26-1-any.pkg.tar.zst. -- Using cached msys2-mingw-w64-x86_64-python-3.11.7-1-any.pkg.tar.zst. -- Using cached msys2-liblzma-5.4.6-2-x86_64.pkg.tar.zst. -- Using cached msys2-libzstd-1.5.5-1-x86_64.pkg.tar.zst. -- Using cached msys2-zlib-1.3.1-1-x86_64.pkg.tar.zst. -- Using cached msys2-libreadline-8.2.010-1-x86_64.pkg.tar.zst. -- Using cached msys2-mpfr-4.2.1-1-x86_64.pkg.tar.zst. -- Using cached msys2-libpcre-8.45-4-x86_64.pkg.tar.zst. -- Using cached msys2-mingw-w64-x86_64-gcc-libgfortran-13.2.0-3-any.pkg.tar.zst. -- Using cached msys2-mingw-w64-x86_64-gcc-libs-13.2.0-3-any.pkg.tar.zst. -- Using cached msys2-mingw-w64-x86_64-libwinpthread-git-11.0.0.r551.g86a5e0f41-1-any.pkg.tar.zst. -- Using cached msys2-mingw-w64-x86_64-bzip2-1.0.8-3-any.pkg.tar.zst. -- Using cached msys2-mingw-w64-x86_64-expat-2.5.0-1-any.pkg.tar.zst. -- Using cached msys2-mingw-w64-x86_64-libffi-3.4.4-1-any.pkg.tar.zst. -- Using cached msys2-mingw-w64-x86_64-mpdecimal-2.5.1-1-any.pkg.tar.zst. -- Using cached msys2-mingw-w64-x86_64-ncurses-6.4.20231217-1-any.pkg.tar.zst. -- Using cached msys2-mingw-w64-x86_64-openssl-3.2.1-1-any.pkg.tar.zst. -- Using cached msys2-mingw-w64-x86_64-sqlite3-3.45.1-1-any.pkg.tar.zst. -- Using cached msys2-mingw-w64-x86_64-tcl-8.6.13-1-any.pkg.tar.zst. -- Using cached msys2-mingw-w64-x86_64-tk-8.6.12-2-any.pkg.tar.zst. -- Using cached msys2-mingw-w64-x86_64-xz-5.4.6-2-any.pkg.tar.zst. -- Using cached msys2-mingw-w64-x86_64-zlib-1.3.1-1-any.pkg.tar.zst. -- Using cached msys2-ncurses-6.4-2-x86_64.pkg.tar.zst. -- Using cached msys2-mingw-w64-x86_64-libsystre-1.0.1-5-any.pkg.tar.zst. -- Using cached msys2-mingw-w64-x86_64-readline-8.2.010-1-any.pkg.tar.zst. -- Using cached msys2-mingw-w64-x86_64-gettext-runtime-0.22.4-5-any.pkg.tar.zst. -- Using cached msys2-mingw-w64-x86_64-libtre-git-r177.07e66d0-2-any.pkg.tar.zst. -- Using cached msys2-mingw-w64-x86_64-termcap-1.3.1-7-any.pkg.tar.zst. -- Using cached msys2-mingw-w64-x86_64-libiconv-1.17-4-any.pkg.tar.zst. -- Using msys root at C:/Users/foop7/vcpkg/downloads/tools/msys2/70baefe917a26e68 -- Using cached tensorflow-tensorflow-v2.10.0.tar.gz. -- Extracting source C:/Users/foop7/vcpkg/downloads/tensorflow-tensorflow-v2.10.0.tar.gz -- Applying patch C:/Users/foop7/vcpkg/installed/x64-windows/share/tensorflow-common/fix-build-error.patch -- Applying patch C:/Users/foop7/vcpkg/installed/x64-windows/share/tensorflow-common/fix-windows-build.patch -- Using source at C:/Users/foop7/vcpkg/buildtrees/tensorflow/src/v2.10.0-257b67b673.clean -- Configuring TensorFlow (dbg) CMake Error at scripts/cmake/vcpkg_execute_required_process.cmake:112 (message): Command failed: C:/Users/foop7/vcpkg/downloads/tools/msys2/70baefe917a26e68/mingw64/bin/python3.exe C:/Users/foop7/vcpkg/buildtrees/tensorflow/x64-windows-dbg/configure.py --workspace C:/Users/foop7/vcpkg/buildtrees/tensorflow/x64-windows-dbg Working Directory: C:/Users/foop7/vcpkg/buildtrees/tensorflow/x64-windows-dbg Error code: 1 See logs for more information: C:\Users\foop7\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)

Additional context

The log file config-x64-windows-dbg-out.log contains an entry stating "Cannot find bazel. Please install bazel/bazelisk." This likely indicates that the system is unable to locate bazel, despite the vcpkg-tool-bazel:x64-windows@5.2.0 package being installed. Given this, it seems additional steps may be needed to install bazel separately in the Windows environment and include it in the system's PATH as part of the environment variable configuration. As I'm new to using vcpkg and aiming to install the tensorflow package, I would greatly appreciate any guidance on this matter.

For your information, I installed vcpkg using the git clone method, and I am currently on commit version "ce1916404fc6f2b645f419a6d47b7ebafe686582."

jimwang118 commented 4 months ago

I've reproduced the issue locally and will try to fix it.

jimwang118 commented 4 months ago

I added a patch in configure.py and now bazel can be found, but there is a linking problem when compiling and I don't know much about tensorflow. I submitted an issue upstream and hoped that upstream could help give suggestions. fix_find_bazel.patch