Skip to content

Commit

Permalink
use C++17 to match abseil ABI in libsentencepiece
Browse files Browse the repository at this point in the history
  • Loading branch information
h-vetinari committed Jan 20, 2023
1 parent 117f982 commit a3a3a8e
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 5 deletions.
1 change: 1 addition & 0 deletions recipes/torchtext/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ source:
- patches/0003-remove-unnecessary-installation-requirements.patch
- patches/0004-load-library-from-correct-place.patch
- patches/0005-don-t-try-to-init-submodules.patch
- patches/0006-must-use-C-17-to-match-abseil.patch

build:
number: 0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 420cbd5a4c2b46e285529eb3c15de8847818f5dc Mon Sep 17 00:00:00 2001
From: "H. Vetinari" <[email protected]>
Date: Wed, 1 Dec 2021 21:07:42 +1100
Subject: [PATCH 1/5] do not build third_party libs
Subject: [PATCH 1/6] do not build third_party libs

---
CMakeLists.txt | 5 ++++-
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 60d8122796befb3fe5798c09463e18ac16f5d8d1 Mon Sep 17 00:00:00 2001
From: "H. Vetinari" <[email protected]>
Date: Wed, 18 Jan 2023 16:56:57 +1100
Subject: [PATCH 2/5] fix some CMake arguments for our infrastructure
Subject: [PATCH 2/6] fix some CMake arguments for our infrastructure

---
tools/setup_helpers/extension.py | 10 ++++------
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 12ec329580410d3bfd02ed2a950c2d7de812bbbf Mon Sep 17 00:00:00 2001
From: "H. Vetinari" <[email protected]>
Date: Wed, 18 Jan 2023 22:06:33 +1100
Subject: [PATCH 3/5] remove unnecessary installation requirements
Subject: [PATCH 3/6] remove unnecessary installation requirements

---
setup.py | 2 +-
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From cc583924ad87bc2b9a0b3b89753885446a2e1eec Mon Sep 17 00:00:00 2001
From: "H. Vetinari" <[email protected]>
Date: Wed, 18 Jan 2023 22:25:03 +1100
Subject: [PATCH 4/5] load library from correct place
Subject: [PATCH 4/6] load library from correct place

---
torchtext/_extension.py | 2 +-
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From a2e6933a9ae206f216e4b20d14010912f5ff9758 Mon Sep 17 00:00:00 2001
From: "H. Vetinari" <[email protected]>
Date: Wed, 18 Jan 2023 22:58:13 +1100
Subject: [PATCH 5/5] don't try to init submodules
Subject: [PATCH 5/6] don't try to init submodules

---
setup.py | 1 -
Expand Down
25 changes: 25 additions & 0 deletions recipes/torchtext/patches/0006-must-use-C-17-to-match-abseil.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
From 37c5c5e4e1c729bf28ac53fa6eedc0a55361bd4f Mon Sep 17 00:00:00 2001
From: "H. Vetinari" <[email protected]>
Date: Fri, 20 Jan 2023 17:16:20 +1100
Subject: [PATCH 6/6] must use C++17 to match abseil

---
CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 46312680..cc136ad5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -27,7 +27,7 @@ if(env_cxx_standard GREATER -1)
"PyTorch requires -std=c++14. Please remove -std=c++ settings in your environment.")
endif()

-set(CMAKE_CXX_STANDARD 14)
+set(CMAKE_CXX_STANDARD 17)
set(CMAKE_C_STANDARD 11)

set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
--
2.38.1.windows.1

0 comments on commit a3a3a8e

Please sign in to comment.