Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[libtorch] Build error #33346

Closed
dwhaynes opened this issue Aug 24, 2023 · 6 comments
Closed

[libtorch] Build error #33346

dwhaynes opened this issue Aug 24, 2023 · 6 comments
Assignees
Labels
requires:repro The issue is not currently repro-able Stale

Comments

@dwhaynes
Copy link

Package: libtorch[core,xnnpack]:x64-windows -> 1.12.1#3

Host Environment

  • Host: x64-windows
  • Compiler: MSVC 19.37.32822.0
  • vcpkg-tool version: 2023-08-09-9990a4c9026811a312cb2af78bf77f3d9d288416
    vcpkg-scripts version: da7048d 2023-08-23 (7 hours ago)

To Reproduce

vcpkg install libtorch:x64-windows
Failure logs

-- Using cached pytorch-pytorch-v1.12.1.tar.gz.
-- Cleaning sources at C:/vcpkg/buildtrees/libtorch/src/v1.12.1-e1cb316ec6.clean. Use --editable to skip cleaning for the packages you specify.
-- Extracting source C:/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
-- Applying patch fix_werror.patch
-- Using source at C:/vcpkg/buildtrees/libtorch/src/v1.12.1-e1cb316ec6.clean
-- Using flatc: C:/vcpkg/installed/x64-windows/tools/flatbuffers/flatc.exe
-- Using protoc: C:/vcpkg/installed/x64-windows/tools/protobuf/protoc.exe
-- Using cached pypa-get-pip-38e54e5de07c66e875c11a1ebbdb938854625dd8.tar.gz.
-- Cleaning sources at C:/vcpkg/buildtrees/libtorch/src/8854625dd8-861bd167bd.clean. Use --editable to skip cleaning for the packages you specify.
-- Extracting source C:/vcpkg/downloads/pypa-get-pip-38e54e5de07c66e875c11a1ebbdb938854625dd8.tar.gz
-- Using source at C:/vcpkg/buildtrees/libtorch/src/8854625dd8-861bd167bd.clean
CMake Error at scripts/cmake/vcpkg_execute_required_process.cmake:112 (message):
    Command failed: C:/vcpkg/downloads/tools/python/python-3.11.4-x64/python.exe C:/vcpkg/buildtrees/libtorch/src/8854625dd8-861bd167bd.clean/public/get-pip.py --no-warn-script-location
    Working Directory: C:/vcpkg/buildtrees/libtorch
    Error code: 1
    See logs for more information:
      C:\vcpkg\buildtrees\libtorch\get-pip-x64-windows-err.log

Call Stack (most recent call first):
  installed/x64-windows/share/vcpkg-get-python-packages/x_vcpkg_get_python_packages.cmake:48 (vcpkg_execute_required_process)
  ports/libtorch/portfile.cmake:35 (x_vcpkg_get_python_packages)
  scripts/ports.cmake:147 (include)



C:\vcpkg\buildtrees\libtorch\get-pip-x64-windows-err.log
Traceback (most recent call last):
  File "C:\vcpkg\buildtrees\libtorch\src\8854625dd8-861bd167bd.clean\public\get-pip.py", line 33324, in <module>
    main()
  File "C:\vcpkg\buildtrees\libtorch\src\8854625dd8-861bd167bd.clean\public\get-pip.py", line 135, in main
    bootstrap(tmpdir=tmpdir)
  File "C:\vcpkg\buildtrees\libtorch\src\8854625dd8-861bd167bd.clean\public\get-pip.py", line 111, in bootstrap
    monkeypatch_for_cert(tmpdir)
  File "C:\vcpkg\buildtrees\libtorch\src\8854625dd8-861bd167bd.clean\public\get-pip.py", line 92, in monkeypatch_for_cert
    from pip._internal.commands.install import InstallCommand
  File "C:\Users\username\AppData\Local\Temp\tmp4ih2mka3\pip.zip\pip\_internal\commands\__init__.py", line 9, in <module>
  File "C:\Users\username\AppData\Local\Temp\tmp4ih2mka3\pip.zip\pip\_internal\cli\base_command.py", line 15, in <module>
  File "C:\Users\username\AppData\Local\Temp\tmp4ih2mka3\pip.zip\pip\_internal\cli\cmdoptions.py", line 23, in <module>
  File "C:\Users\username\AppData\Local\Temp\tmp4ih2mka3\pip.zip\pip\_internal\cli\parser.py", line 12, in <module>
  File "C:\Users\username\AppData\Local\Temp\tmp4ih2mka3\pip.zip\pip\_internal\configuration.py", line 24, in <module>
  File "C:\Users\username\AppData\Local\Temp\tmp4ih2mka3\pip.zip\pip\_internal\utils\appdirs.py", line 13, in <module>
  File "C:\Users\username\AppData\Local\Temp\tmp4ih2mka3\pip.zip\pip\_vendor\platformdirs\__init__.py", line 33, in <module>
  File "C:\Users\username\AppData\Local\Temp\tmp4ih2mka3\pip.zip\pip\_vendor\platformdirs\__init__.py", line 29, in _set_platform_dir_class
  File "importlib\__init__.py", line 126, in import_module
  File "C:\Users\username\AppData\Local\Temp\tmp4ih2mka3\pip.zip\pip\_vendor\platformdirs\windows.py", line 3, in <module>
  File "ctypes\__init__.py", line 8, in <module>
ImportError: DLL load failed while importing _ctypes: The specified module could not be found.

Vcpkg is calling the wrong python. I have Anaconda installed but it isn't detected. A new python gets installed which doesn't work for some reason or another. I've tried pointing it to the anaconda version but it doesn't work. I believe that the flaw is somewhere in x_vcpkg_get_python_packages.cmake but I don't know how to fix it.

@dg0yt
Copy link
Contributor

dg0yt commented Aug 24, 2023

ImportError: DLL load failed while importing _ctypes: The specified module could not be found.

AFAICT this error occurs when python needs DLLs which are not in PATH.
And indeed, the port passes the location of python to the cmake, but it doesn't modify PATH.

I have Anaconda installed but it isn't detected.

Note that the vcpkg tool cleans the PATH before running builds on Windows.

@Cheney-W Cheney-W added the requires:repro The issue is not currently repro-able label Aug 24, 2023
@dwhaynes
Copy link
Author

I just did a quick git pull and saw python3 and libffi updates, but the build still failed.

@github-actions
Copy link

This is an automated message. Per our repo policy, stale issues get closed if there has been no activity in the past 28 days. The issue will be automatically closed in 14 days. If you wish to keep this issue open, please add a new comment.

@github-actions github-actions bot added Stale and removed Stale labels Sep 22, 2023
@github-actions
Copy link

This is an automated message. Per our repo policy, stale issues get closed if there has been no activity in the past 28 days. The issue will be automatically closed in 14 days. If you wish to keep this issue open, please add a new comment.

Copy link

This is an automated message. Per our repo policy, stale issues get closed if there has been no activity in the past 28 days. The issue will be automatically closed in 14 days. If you wish to keep this issue open, please add a new comment.

@Neumann-A
Copy link
Contributor

duplicate of #34746

@Cheney-W Cheney-W closed this as not planned Won't fix, can't repro, duplicate, stale Jan 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
requires:repro The issue is not currently repro-able Stale
Projects
None yet
Development

No branches or pull requests

4 participants