From 42e7cdc50a76c8f95299b3e2790cdafc4c4cf9fd Mon Sep 17 00:00:00 2001 From: Joe Zhu Date: Mon, 30 Nov 2020 11:14:04 -0800 Subject: [PATCH] Improve libuv detection on Windows (#48571) Summary: Fixes https://github.com/pytorch/pytorch/issues/48304 Pull Request resolved: https://github.com/pytorch/pytorch/pull/48571 Reviewed By: ejguan Differential Revision: D25220903 Pulled By: mrshenli fbshipit-source-id: a485568621c4e289c5439474c2651186bc63c2f0 --- CMakeLists.txt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ce36d2d659c..a388a4549d6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -244,17 +244,17 @@ if(WIN32) find_library( libuv_tmp_LIBRARY NAMES uv libuv - HINTS $ENV{CONDA_PREFIX}\\Library + HINTS $ENV{CONDA_PREFIX}\\Library $ENV{PREFIX}\\Library PATH_SUFFIXES lib - REQUIRED NO_DEFAULT_PATH) - if(NOT EXISTS ${libuv_tmp_LIBRARY}) + if(NOT libuv_tmp_LIBRARY) set(USE_DISTRIBUTED OFF) set(USE_GLOO OFF) message( - WARNING "Libuv is not installed in current conda env. Set USE_DISTRIBUTED to OFF.") + WARNING "Libuv is not installed in current conda env. Set USE_DISTRIBUTED to OFF. " + "Please run command 'conda install -c conda-forge libuv=1.39' to install libuv.") else() - set(ENV{libuv_ROOT} $ENV{CONDA_PREFIX}\\Library) + set(ENV{libuv_ROOT} ${libuv_tmp_LIBRARY}/../../) endif() endif() endif()