Environment
Environment:
OS: Windows 10
Python: 3.8
Visual Studio: 2019
What I Tried?
clone vcpkg github repo and install vcpkg and then enter command:
vcpkg.exe install libtorch:x64-windows
Full Error Log
G:\VCPKG\vcpkg>vcpkg.exe install libtorch:x64-windows --clean-after-build
Computing installation plan...
The following packages will be built and installed:
libtorch[core,xnnpack]:x64-windows -> 1.12.1#2
Detecting compiler hash for triplet x64-windows...
Restored 0 package(s) from C:\Users\Javad\AppData\Local\vcpkg\archives in 17.7 ms. Use --debug to see more details.
Installing 1/1 libtorch:x64-windows...
Building libtorch[core,xnnpack]:x64-windows...
-- Using cached pytorch-pytorch-v1.12.1.tar.gz.
-- Cleaning sources at G:/VCPKG/vcpkg/buildtrees/libtorch/src/v1.12.1-d15308d103.clean. Use --editable to skip cleaning for the packages you specify.
-- Extracting source G:/VCPKG/vcpkg/downloads/pytorch-pytorch-v1.12.1.tar.gz
-- Applying patch pytorch-pr-85958.patch
-- Applying patch fix-cmake.patch
-- Applying patch fix-fbgemm-include.patch
-- Applying patch fix-c10-glog.patch
-- Applying patch use-flatbuffers2.patch
-- Applying patch fix-windows.patch
-- Using source at G:/VCPKG/vcpkg/buildtrees/libtorch/src/v1.12.1-d15308d103.clean
-- Using flatc: G:/VCPKG/vcpkg/installed/x64-windows/tools/flatbuffers/flatc.exe
-- Using protoc: G:/VCPKG/vcpkg/installed/x64-windows/tools/protobuf/protoc.exe
-- Setting up python virtual environmnent...
-- Installing python packages: typing-extensions;pyyaml;numpy
-- Setting up python virtual environmnent...finished.
-- Using Python3: G:/VCPKG/vcpkg/buildtrees/libtorch/x64-windows-venv/Scripts/python.exe
-- Configuring x64-windows-dbg
-- Configuring x64-windows-rel
-- Building x64-windows-dbg
-- Building x64-windows-rel
-- Building x64-windows-dbg
CMake Error at scripts/cmake/vcpkg_execute_build_process.cmake:134 (message):
Command failed: G:/VCPKG/vcpkg/downloads/tools/cmake-3.25.1-windows/cmake-3.25.1-windows-i386/bin/cmake.exe --build . --config Debug --target torch_cpu -- -v -j9
Working Directory: G:/VCPKG/vcpkg/buildtrees/libtorch/x64-windows-dbg
See logs for more information:
G:\VCPKG\vcpkg\buildtrees\libtorch\build-torch_cpu-x64-windows-dbg-out.log
Call Stack (most recent call first):
installed/x64-windows/share/vcpkg-cmake/vcpkg_cmake_build.cmake:74 (vcpkg_execute_build_process)
ports/libtorch/portfile.cmake:157 (vcpkg_cmake_build)
scripts/ports.cmake:147 (include)
error: building libtorch:x64-windows failed with: BUILD_FAILED
Please ensure you're using the latest port files with git pull and vcpkg update.
Then check for known issues at:
https://github.com/microsoft/vcpkg/issues?q=is%3Aissue+is%3Aopen+in%3Atitle+libtorch
You can submit a new issue at:
https://github.com/microsoft/vcpkg/issues/new?title=[libtorch]+Build+error&body=Copy+issue+body+from+G%3A%2FVCPKG%2Fvcpkg%2Finstalled%2Fvcpkg%2Fissue_body.md
Explanation:
I try to install libtorch for visual studio c++ with vcpkg but it doesnt build