Skip to content

Commit de7707c

Browse files
committed
robustify CONDA_BUILD_CROSS_COMPILATION handling
1 parent 71e319d commit de7707c

6 files changed

+8
-8
lines changed

recipe/patches/0010-point-include-paths-to-PREFIX-include.patch

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
From 8965e3dbd5a2ec0134a0e603e705896ac59b1882 Mon Sep 17 00:00:00 2001
1+
From 2e9805edf7c26bf7890a8704460047592fff3a79 Mon Sep 17 00:00:00 2001
22
From: "H. Vetinari" <[email protected]>
33
Date: Thu, 23 Jan 2025 22:58:14 +1100
44
Subject: [PATCH 10/15] point include paths to $PREFIX/include
@@ -8,15 +8,15 @@ Subject: [PATCH 10/15] point include paths to $PREFIX/include
88
1 file changed, 18 insertions(+)
99

1010
diff --git a/torch/utils/cpp_extension.py b/torch/utils/cpp_extension.py
11-
index 23e2499903c..ea5516ba6f6 100644
11+
index 23e2499903c..a8caba3c058 100644
1212
--- a/torch/utils/cpp_extension.py
1313
+++ b/torch/utils/cpp_extension.py
1414
@@ -1208,10 +1208,28 @@ def include_paths(device_type: str = "cpu") -> List[str]:
1515
A list of include path strings.
1616
"""
1717
lib_include = os.path.join(_TORCH_PATH, 'include')
1818
+ if (os.environ.get("CONDA_BUILD", None) is not None
19-
+ and os.environ.get("CONDA_BUILD_CROSS_COMPILATION", None) is not None):
19+
+ and os.environ.get("CONDA_BUILD_CROSS_COMPILATION", None) not in (None, "", "0")):
2020
+ # to avoid problems in cross-compilation, we need to point to the same environment
2121
+ # where the currently running pytorch is -- i.e. the BUILD_PREFIX. See
2222
+ # https://github.com/conda-forge/pytorch-cpu-feedstock/issues/349

recipe/patches/0011-Add-conda-prefix-to-inductor-include-paths.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
From 7bcc04c68f85133e748165712ba413bc1aad3c54 Mon Sep 17 00:00:00 2001
1+
From e8eef4b33903af5886cbde7b4342ebc2705933ef Mon Sep 17 00:00:00 2001
22
From: Daniel Petry <[email protected]>
33
Date: Tue, 21 Jan 2025 17:45:23 -0600
44
Subject: [PATCH 11/15] Add conda prefix to inductor include paths

recipe/patches/0012-make-ATEN_INCLUDE_DIR-relative-to-TORCH_INSTALL_PREF.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
From 91515b50ac575123275716f735c9efc45ca801cb Mon Sep 17 00:00:00 2001
1+
From 7c955a22b748da66317f69f49f2e99d826083a0d Mon Sep 17 00:00:00 2001
22
From: "H. Vetinari" <[email protected]>
33
Date: Tue, 28 Jan 2025 14:15:34 +1100
44
Subject: [PATCH 12/15] make ATEN_INCLUDE_DIR relative to TORCH_INSTALL_PREFIX

recipe/patches/0013-remove-DESTINATION-lib-from-CMake-install-TARGETS-di.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
From cdfb398e25f4082878db4413a298abd90e5ce6fe Mon Sep 17 00:00:00 2001
1+
From c4cc82934faf2e32ab283a2ec2d9266049db9872 Mon Sep 17 00:00:00 2001
22
From: "H. Vetinari" <[email protected]>
33
Date: Tue, 28 Jan 2025 10:58:29 +1100
44
Subject: [PATCH 13/15] remove `DESTINATION lib` from CMake `install(TARGETS`

recipe/patches/0014-avoid-deprecated-find_package-CUDA-in-caffe2-CMake-m.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
From 51b4b5b5df27cafd2ba286550764b2b893e7f8b2 Mon Sep 17 00:00:00 2001
1+
From e644304ce9c67c3f4185141dc603f8196e32a7cd Mon Sep 17 00:00:00 2001
22
From: "H. Vetinari" <[email protected]>
33
Date: Thu, 30 Jan 2025 08:33:44 +1100
44
Subject: [PATCH 14/15] avoid deprecated `find_package(CUDA)` in caffe2 CMake

recipe/patches/0015-export-AOTI_TORCH_EXPORT-on-Windows.-140030.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
From ba332a8f5f5d22892c86b40153e93ed801cceb4f Mon Sep 17 00:00:00 2001
1+
From afc5756195b26f0fcbe0ee96a267149db0bbe71c Mon Sep 17 00:00:00 2001
22
From: Xu Han <[email protected]>
33
Date: Wed, 15 Jan 2025 23:43:41 +0000
44
Subject: [PATCH 15/15] export AOTI_TORCH_EXPORT on Windows. (#140030)

0 commit comments

Comments
 (0)