Auto set libuv_ROOT env var for Gloo submodule on Windows platform (#45484)

Summary:
Fixes #{issue number}

Pull Request resolved: https://github.com/pytorch/pytorch/pull/45484

Reviewed By: lw

Differential Revision: D23990724

Pulled By: mrshenli

fbshipit-source-id: 1987ce7eb7d3f9d3120c07e954cd6581cd3caf59
This commit is contained in:
gunandrose4u 2020-09-29 08:56:46 -07:00 committed by Facebook GitHub Bot
parent 6d37126a10
commit 0a38aed025
2 changed files with 7 additions and 2 deletions

View file

@ -292,6 +292,12 @@ if(LINUX)
set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-as-needed")
endif()
if(WIN32 AND USE_DISTRIBUTED)
if(NOT DEFINED ENV{libuv_ROOT})
set(ENV{libuv_ROOT} $ENV{CONDA_PREFIX}\\Library)
endif()
endif()
if(MSVC)
foreach(flag_var
CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE

View file

@ -186,10 +186,9 @@ conda install pkg-config libuv
On Windows
```bash
# Add these packages and set libuv_ROOT environment variable if torch.distributed is needed.
# Add these packages if torch.distributed is needed.
# Distributed package support on Windows is a prototype feature and is subject to changes.
conda install -y -q -c rdonnelly libuv
set libuv_ROOT={conda active env location}\Library
```
#### Get the PyTorch Source