forked from conda-forge/staged-recipes
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
patch some CMake variables; always use ninja
- Loading branch information
1 parent
4e1146f
commit f174c91
Showing
3 changed files
with
46 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
recipes/torchtext/patches/0001-do-not-build-third_party-libs.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
From b530b275f1af85d2ae8da140e58796aa506186f8 Mon Sep 17 00:00:00 2001 | ||
From: "H. Vetinari" <[email protected]> | ||
Date: Wed, 1 Dec 2021 21:07:42 +1100 | ||
Subject: [PATCH] do not build third_party libs | ||
Subject: [PATCH 1/2] do not build third_party libs | ||
|
||
--- | ||
CMakeLists.txt | 5 ++++- | ||
|
43 changes: 43 additions & 0 deletions
43
recipes/torchtext/patches/0002-fix-some-CMake-arguments-for-our-infrastructure.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
From b9711d40d1a4b3a6d152d11ca925c949a413c53a Mon Sep 17 00:00:00 2001 | ||
From: "H. Vetinari" <[email protected]> | ||
Date: Wed, 18 Jan 2023 16:56:57 +1100 | ||
Subject: [PATCH 2/2] fix some CMake arguments for our infrastructure | ||
|
||
--- | ||
tools/setup_helpers/extension.py | 10 ++++------ | ||
1 file changed, 4 insertions(+), 6 deletions(-) | ||
|
||
diff --git a/tools/setup_helpers/extension.py b/tools/setup_helpers/extension.py | ||
index 760b3bb7..fdf64f94 100644 | ||
--- a/tools/setup_helpers/extension.py | ||
+++ b/tools/setup_helpers/extension.py | ||
@@ -64,12 +64,13 @@ class CMakeBuild(build_ext): | ||
cfg = "Debug" if self.debug else "Release" | ||
|
||
cmake_args = [ | ||
+ "-GNinja", | ||
f"-DCMAKE_BUILD_TYPE={cfg}", | ||
- f"-DCMAKE_PREFIX_PATH={torch.utils.cmake_prefix_path}", | ||
- f"-DCMAKE_INSTALL_PREFIX={extdir}", | ||
+ f"-DCMAKE_PREFIX_PATH={os.environ['PREFIX']}", | ||
+ f"-DCMAKE_INSTALL_PREFIX=lib", | ||
"-DCMAKE_VERBOSE_MAKEFILE=ON", | ||
f"-DPython_INCLUDE_DIR={distutils.sysconfig.get_python_inc()}", | ||
- f"-DTORCH_INSTALL_PREFIX:STRING={os.path.dirname(torch.__file__)}", | ||
+ f"-DTORCH_INSTALL_PREFIX:STRING={os.environ['PREFIX']}", | ||
"-DBUILD_TORCHTEXT_PYTHON_EXTENSION:BOOL=ON", | ||
"-DRE2_BUILD_TESTING:BOOL=OFF", | ||
"-DBUILD_TESTING:BOOL=OFF", | ||
@@ -80,9 +81,6 @@ class CMakeBuild(build_ext): | ||
] | ||
build_args = ["--target", "install"] | ||
|
||
- # Default to Ninja | ||
- if "CMAKE_GENERATOR" not in os.environ or platform.system() == "Windows": | ||
- cmake_args += ["-GNinja"] | ||
if platform.system() == "Windows": | ||
import sys | ||
|
||
-- | ||
2.38.1.windows.1 | ||
|