-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2bd05ad
commit 9a21672
Showing
7 changed files
with
43 additions
and
5 deletions.
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
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 2fe3e37744c810590e631c01fb57133080fc5f46 Mon Sep 17 00:00:00 2001 | ||
From: "H. Vetinari" <[email protected]> | ||
Date: Thu, 2 Dec 2021 08:39:53 +1100 | ||
Subject: [PATCH 1/5] do not mix static & shared builds | ||
Subject: [PATCH 1/6] do not mix static & shared builds | ||
|
||
--- | ||
src/CMakeLists.txt | 20 ++++++++++---------- | ||
|
2 changes: 1 addition & 1 deletion
2
recipe/patches/0002-do-not-build-vendored-abseil-libprotobuf-lite.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 ab5c20be4a987d1cd6d2e472634f5e1b9c11211f Mon Sep 17 00:00:00 2001 | ||
From: "H. Vetinari" <[email protected]> | ||
Date: Thu, 2 Dec 2021 10:05:12 +1100 | ||
Subject: [PATCH 2/5] do not build vendored abseil & libprotobuf-lite | ||
Subject: [PATCH 2/6] do not build vendored abseil & libprotobuf-lite | ||
|
||
ensure we can use shared builds of libprotobuf also on windows | ||
--- | ||
|
2 changes: 1 addition & 1 deletion
2
recipe/patches/0003-point-to-our-libs-headers-for-windows-in-setup.py.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 428ac3758e24b1aeedec8e0568d128e2097d1646 Mon Sep 17 00:00:00 2001 | ||
From: "H. Vetinari" <[email protected]> | ||
Date: Sun, 11 Dec 2022 01:09:03 +1100 | ||
Subject: [PATCH 3/5] point to our libs / headers for windows in setup.py | ||
Subject: [PATCH 3/6] point to our libs / headers for windows in setup.py | ||
|
||
also do not risk building against bundled libs, nor | ||
setting /MT for the MSVC static runtime libs | ||
|
2 changes: 1 addition & 1 deletion
2
recipe/patches/0004-also-install-pkg-config-files-on-windows.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 f6ec12fe46a666940007cb205e715ee6f3916e97 Mon Sep 17 00:00:00 2001 | ||
From: "H. Vetinari" <[email protected]> | ||
Date: Mon, 12 Dec 2022 14:36:45 +1100 | ||
Subject: [PATCH 4/5] also install pkg-config files on windows | ||
Subject: [PATCH 4/6] also install pkg-config files on windows | ||
|
||
--- | ||
CMakeLists.txt | 4 +--- | ||
|
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 366a1080b048a43452bdfb43968c5f2a44acdcf4 Mon Sep 17 00:00:00 2001 | ||
From: "H. Vetinari" <[email protected]> | ||
Date: Wed, 18 Jan 2023 19:44:15 +1100 | ||
Subject: [PATCH 5/5] create and install CMake metadata | ||
Subject: [PATCH 5/6] create and install CMake metadata | ||
|
||
--- | ||
CMakeLists.txt | 10 ++++++++++ | ||
|
36 changes: 36 additions & 0 deletions
36
recipe/patches/0006-also-link-to-static-absl_flags_-on-windows.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,36 @@ | ||
From 64f7608bd0757387cee221df7014c9bdbe78585b Mon Sep 17 00:00:00 2001 | ||
From: "H. Vetinari" <[email protected]> | ||
Date: Tue, 20 Feb 2024 17:43:23 +1100 | ||
Subject: [PATCH 6/6] also link to static absl_flags_* on windows | ||
|
||
--- | ||
python/setup.py | 10 +++++++++- | ||
1 file changed, 9 insertions(+), 1 deletion(-) | ||
|
||
diff --git a/python/setup.py b/python/setup.py | ||
index fb301ac..4366d1a 100755 | ||
--- a/python/setup.py | ||
+++ b/python/setup.py | ||
@@ -117,13 +117,21 @@ if os.name == 'nt': | ||
] | ||
elif True: | ||
cflags = ['/std:c++17', '/MD', '/I' + os.environ["LIBRARY_INC"]] | ||
+ # most of abseil can be built as shared, which ends up in one giant library | ||
+ # called abseil_dll; the absl_flags_* libraries always stay static | ||
+ absl_libs = [ | ||
+ "abseil_dll", "absl_flags", "absl_flags_commandlineflag", "absl_flags_commandlineflag_internal", | ||
+ "absl_flags_config", "absl_flags_internal", "absl_flags_marshalling", "absl_flags_parse", | ||
+ "absl_flags_private_handle_accessor", "absl_flags_program_name", "absl_flags_reflection", | ||
+ "absl_flags_usage", "absl_flags_usage_internal", | ||
+ ] | ||
libs = [ | ||
# equivalent of -L$PREFIX/lib -lsentencepiece -lsentencepiece_train -lprotobuf-lite | ||
os.environ["LIBRARY_LIB"] + f"\\{x}.lib" | ||
# protobuf actually has the lib-prefix in the name also on windows; | ||
# since libsentencepiece is static on windows, we also need _its_ | ||
# host dependencies for the link interface, i.e. also abseil | ||
- for x in ["sentencepiece", "sentencepiece_train", "libprotobuf-lite", "abseil_dll"] | ||
+ for x in ["sentencepiece", "sentencepiece_train", "libprotobuf-lite"] + absl_libs | ||
] | ||
else: | ||
# build library locally with cmake and vc++. |