Skip to content

Commit ce52674

Browse files
StonepiaCuiYifeng
authored andcommitted
[Doc] Update CMAKE_PREFIX_PATH for XPU windows README (pytorch#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: pytorch#148863 Approved by: https://github.com/CuiYifeng, https://github.com/malfet Co-authored-by: Cui, Yifeng <[email protected]>
1 parent 31634b8 commit ce52674

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,16 @@ Please make sure [the common prerequisites](#prerequisites) as well as [the prer
355355
Then PyTorch can be built with the command:
356356

357357
```cmd
358+
:: CMD Commands:
359+
:: Set the CMAKE_PREFIX_PATH to help find corresponding packages
360+
:: %CONDA_PREFIX% only works after `conda activate custom_env`
361+
362+
if defined CMAKE_PREFIX_PATH (
363+
set "CMAKE_PREFIX_PATH=%CONDA_PREFIX%\Library;%CMAKE_PREFIX_PATH%"
364+
) else (
365+
set "CMAKE_PREFIX_PATH=%CONDA_PREFIX%\Library"
366+
)
367+
358368
python setup.py develop
359369
```
360370

0 commit comments

Comments
 (0)