Skip to content

Commit c2ccaa3

Browse files
pytorchbotjansel
andauthored
[inductor] Fix inductor windows linker error (pytorch#150447)
[inductor] Fix inductor windows linker error (pytorch#150256) Fixes pytorch#149889 Pull Request resolved: pytorch#150256 Approved by: https://github.com/anijain2305, https://github.com/eellison (cherry picked from commit 37ebb0b) Co-authored-by: Jason Ansel <[email protected]>
1 parent 6569576 commit c2ccaa3

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

torch/_inductor/cpp_builder.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -807,8 +807,13 @@ def _get_python_related_args() -> tuple[list[str], list[str]]:
807807
python_include_dirs.append(python_include_path)
808808

809809
if _IS_WINDOWS:
810-
python_path = os.path.dirname(sys.executable)
811-
python_lib_path = [os.path.join(python_path, "libs")]
810+
python_lib_path = [
811+
str(
812+
(
813+
Path(sysconfig.get_path("include", scheme="nt")).parent / "libs"
814+
).absolute()
815+
)
816+
]
812817
else:
813818
python_lib_path = [sysconfig.get_config_var("LIBDIR")]
814819

0 commit comments

Comments
 (0)