From ce52674b7651921630019de62323ee0bfd69516d Mon Sep 17 00:00:00 2001 From: Stonepia Date: Tue, 1 Apr 2025 04:43:07 +0000 Subject: [PATCH] [Doc] Update CMAKE_PREFIX_PATH for XPU windows README (#148863) We found that the `pip install cmake` and `conda install cmake` has different behavior. The reason is that the pip installed one doesn't find the corresponding libs under conda env. So we need to set the `CMAKE_PREFIX_PATH` for alignment. Pull Request resolved: https://github.com/pytorch/pytorch/pull/148863 Approved by: https://github.com/CuiYifeng, https://github.com/malfet Co-authored-by: Cui, Yifeng --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index 299cca8e34fd..fcdf761295ae 100644 --- a/README.md +++ b/README.md @@ -355,6 +355,16 @@ Please make sure [the common prerequisites](#prerequisites) as well as [the prer Then PyTorch can be built with the command: ```cmd +:: CMD Commands: +:: Set the CMAKE_PREFIX_PATH to help find corresponding packages +:: %CONDA_PREFIX% only works after `conda activate custom_env` + +if defined CMAKE_PREFIX_PATH ( + set "CMAKE_PREFIX_PATH=%CONDA_PREFIX%\Library;%CMAKE_PREFIX_PATH%" +) else ( + set "CMAKE_PREFIX_PATH=%CONDA_PREFIX%\Library" +) + python setup.py develop ```