Skip to content

Commit 93af0f0

Browse files
authored
fix windows build failure (#1456)
# Motivation 1. fix codegen path on Windows - avoid `//` on Windows, use posix style `\` instead. 2. `USE_C10D_XCCL` is an undefined option that can't be updated by caffe2_update_option on Windows. # Additional Context build pass on local Windows machine
1 parent 2dc1c70 commit 93af0f0

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ include(${TORCH_XPU_OPS_ROOT}/cmake/ONEMKL.cmake)
4040
include(${TORCH_XPU_OPS_ROOT}/cmake/BuildFlags.cmake)
4141

4242
option(USE_XCCL "Build with XCCL support" OFF)
43-
cmake_dependent_option(USE_C10D_XCCL "USE C10D XCCL" ON "USE_DISTRIBUTED;USE_XCCL" OFF)
43+
option(USE_C10D_XCCL "Build with XCCL support for C10D" ON)
4444

4545
# -- [ Re-generate the macros file for https://github.com/pytorch/pytorch/pull/147161
4646
macro(update_caffe2_macros_file)

tools/codegen/install_xpu_headers.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import os
33
import re
44
import shutil
5+
from pathlib import Path
56

67

78
parser = argparse.ArgumentParser(description="Utils for append ops headers")
@@ -65,7 +66,7 @@ def generate_xpu_ops_headers_cmake(src_dir, dst_dir, xpu_ops_headers):
6566
with open(os.path.join(src_dir, "xpu_ops_generated_headers.cmake"), "w") as fw:
6667
fw.write("set(xpu_ops_generated_headers\n")
6768
for header in xpu_ops_headers:
68-
fw.write(f' "{os.path.join(dst_dir, header)}"\n')
69+
fw.write(f' "{Path(os.path.join(dst_dir, header)).as_posix()}"\n')
6970
fw.write(")\n")
7071

7172

0 commit comments

Comments
 (0)