-
-
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.
automerged PR by conda-forge/automerge-action
- Loading branch information
Showing
16 changed files
with
188 additions
and
3,062 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
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
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,20 +1,20 @@ | ||
From df7925b506acf44eb3f06ce94e812c8a23f83699 Mon Sep 17 00:00:00 2001 | ||
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/8] do not mix static & shared builds | ||
Subject: [PATCH 1/7] do not mix static & shared builds | ||
|
||
--- | ||
src/CMakeLists.txt | 20 ++++++++++---------- | ||
1 file changed, 10 insertions(+), 10 deletions(-) | ||
|
||
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt | ||
index 1c7726e..39b0ef2 100644 | ||
index 8d4a34f..fbdf238 100644 | ||
--- a/src/CMakeLists.txt | ||
+++ b/src/CMakeLists.txt | ||
@@ -220,18 +220,18 @@ endif() | ||
if (SPM_ENABLE_SHARED) | ||
add_library(sentencepiece SHARED ${SPM_SRCS}) | ||
add_library(sentencepiece_train SHARED ${SPM_TRAIN_SRCS}) | ||
@@ -228,18 +228,18 @@ if (SPM_ENABLE_SHARED) | ||
target_link_libraries(sentencepiece log) | ||
target_link_libraries(sentencepiece_train log) | ||
endif() | ||
-endif() | ||
- | ||
-add_library(sentencepiece-static STATIC ${SPM_SRCS}) | ||
|
@@ -37,7 +37,7 @@ index 1c7726e..39b0ef2 100644 | |
set_target_properties(sentencepiece sentencepiece_train PROPERTIES SOVERSION 0 VERSION 0.0.0) | ||
set_target_properties(sentencepiece PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS YES) | ||
set_target_properties(sentencepiece_train PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS YES) | ||
@@ -246,10 +246,10 @@ else() | ||
@@ -254,10 +254,10 @@ else() | ||
add_library(sentencepiece ALIAS sentencepiece-static) | ||
add_library(sentencepiece_train ALIAS sentencepiece_train-static) | ||
set(SPM_INSTALLTARGETS sentencepiece-static sentencepiece_train-static) | ||
|
74 changes: 0 additions & 74 deletions
74
recipe/patches/0002-do-not-build-vendored-abseil-libprotobuf-lite.patch
This file was deleted.
Oops, something went wrong.
26 changes: 26 additions & 0 deletions
26
recipe/patches/0002-ensure-we-set-PROTOBUF_USE_DLLS-when-using-our-own-p.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,26 @@ | ||
From 185e8cd8603d188cccdb6f170a60d2984211b70c Mon Sep 17 00:00:00 2001 | ||
From: "H. Vetinari" <[email protected]> | ||
Date: Thu, 2 Dec 2021 10:05:12 +1100 | ||
Subject: [PATCH 2/7] ensure we set PROTOBUF_USE_DLLS when using our own | ||
protobuf | ||
|
||
--- | ||
src/CMakeLists.txt | 5 +++++ | ||
1 file changed, 5 insertions(+) | ||
|
||
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt | ||
index fbdf238..2b8aefa 100644 | ||
--- a/src/CMakeLists.txt | ||
+++ b/src/CMakeLists.txt | ||
@@ -71,6 +71,11 @@ if (SPM_PROTOBUF_PROVIDER STREQUAL "internal") | ||
include_directories(builtin_pb) | ||
elseif (SPM_PROTOBUF_PROVIDER STREQUAL "package") | ||
find_package(Protobuf REQUIRED) | ||
+ if (MSVC) | ||
+ add_definitions("/DPROTOBUF_USE_DLLS") | ||
+ else() | ||
+ add_definitions("-DPROTOBUF_USE_DLLS") | ||
+ endif() | ||
include_directories(${Protobuf_INCLUDE_DIRS}) | ||
protobuf_generate_cpp(SPM_PROTO_SRCS SPM_PROTO_HDRS sentencepiece.proto) | ||
protobuf_generate_cpp(SPM_MODEL_PROTO_SRCS SPM_MODEL_PROTO_HDRS sentencepiece_model.proto) |
46 changes: 0 additions & 46 deletions
46
recipe/patches/0003-consistently-use-absolute-paths-for-CMAKE_INSTALL_-D.patch
This file was deleted.
Oops, something went wrong.
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 e884436083b6d5c2beee6bc341f0a55958715f01 Mon Sep 17 00:00:00 2001 | ||
From a285dbb0bb469256fb43f483e398cc0f028cd2c8 Mon Sep 17 00:00:00 2001 | ||
From: "H. Vetinari" <[email protected]> | ||
Date: Sun, 11 Dec 2022 01:09:03 +1100 | ||
Subject: [PATCH 6/8] point to our libs / headers for windows in setup.py | ||
Subject: [PATCH 3/7] 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 | ||
|
@@ -10,7 +10,7 @@ setting /MT for the MSVC static runtime libs | |
1 file changed, 13 insertions(+), 8 deletions(-) | ||
|
||
diff --git a/python/setup.py b/python/setup.py | ||
index 5411231..d8f0b5e 100755 | ||
index d600321..fb301ac 100755 | ||
--- a/python/setup.py | ||
+++ b/python/setup.py | ||
@@ -77,10 +77,11 @@ class build_ext(_build_ext): | ||
|
@@ -28,7 +28,7 @@ index 5411231..d8f0b5e 100755 | |
cflags = cflags + run_pkg_config('cflags') | ||
libs = run_pkg_config('libs') | ||
else: | ||
@@ -106,17 +107,21 @@ if os.name == 'nt': | ||
@@ -108,17 +109,21 @@ if os.name == 'nt': | ||
arch = 'win32' | ||
if sys.maxsize > 2**32: | ||
arch = 'amd64' | ||
|
@@ -46,12 +46,12 @@ index 5411231..d8f0b5e 100755 | |
libs = [ | ||
- '..\\build\\root\\lib\\sentencepiece.lib', | ||
- '..\\build\\root\\lib\\sentencepiece_train.lib', | ||
+ # equivalent of -L$PREFIX/lib -lsentencepiece -lsentencepiece_train -lprotobuf | ||
+ # 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", "abseil_dll"] | ||
+ for x in ["sentencepiece", "sentencepiece_train", "libprotobuf-lite", "abseil_dll"] | ||
] | ||
else: | ||
# build library locally with cmake and vc++. |
Oops, something went wrong.